Basecamp Email Attachment Not Working Properly
It's quite hard to explain but I have a support form that allows users to
submit a request and attach a file, the request gets sent straight to
Basecamp, as well as sending various confirmation emails to my team, here
we can view all details the user submitted in the form as well as download
the attachements. However, on Basecamp it shows the file attachment in the
heading/title but does not let you download it:
Code:
$subject3 = "Todo list: WRS ID: $theData - $subject - $country - $name -
$now - file: $fileatt_name";
$subject5 = "Files";
Output:
WRS ID: 1361 - minor change on category page - UK - Karina M - Wednesday
October 02nd, 2013, 12:37 pm - file: matress_category_sept_2013.docx
Although it does upload it in Basecamp as a seperate task, where you can
download the attachment? Is there something im missing from my code above
to allow the attachment to be downloaded from here also?
Thursday, 3 October 2013
Wednesday, 2 October 2013
need to convert char to cell array
need to convert char to cell array
Hi I have the following object in matlab:
class(data{1}) =
char
which is stored in
class(data) =
cell
however I am trying to call:
[estt,este] = hmmtrain(data{1},e,t);
and get an error:
??? Error using ==> hmmtrain at 209
Seqs must be cell array or numerical array.
Is there a way to make each element of data compatible with the hmmtrain
function?
thanks very much
Hi I have the following object in matlab:
class(data{1}) =
char
which is stored in
class(data) =
cell
however I am trying to call:
[estt,este] = hmmtrain(data{1},e,t);
and get an error:
??? Error using ==> hmmtrain at 209
Seqs must be cell array or numerical array.
Is there a way to make each element of data compatible with the hmmtrain
function?
thanks very much
C# Parse through XML
C# Parse through XML
I've been reading through many tutorials and examples, but I'm lost. I
have an XML file with this type of data:
<?xml version="1.0"?>
<properties>
<property>
<name>Client Property A</name>
<phone>Client Property A Phone Number</phone>
</property>
<property>
<name>Client Property B</name>
<phone>Client Property B Phone Number</phone>
</property>
<property>
<name>Client Property C</name>
<phone>Client Property C Phone Number</phone>
</property>
</properties>
I'm trying to parse through this data in C# but having no luck at all. I
have this:
XmlTextReader xmldata = new XmlTextReader("http://url.to/xml");
XmlNodeList xmllist = doc.GetElementsByTagName("property");
processList( xmllist );
public void processList(XmlNodeList xmllist)
{
// Loop through each property node and list the information
foreach (XmlNode node in xmllist)
{
XmlElement nodeElement = (XmlElement)node;
txtBox.AppendText(nodeElement.GetElementsByTagName("name")[0].InnerText);
txtBox.AppendText(nodeElement.GetElementsByTagName("phone")[0].InnerText);
}
}
But nothing gets output in to my text box. :(
I've been reading through many tutorials and examples, but I'm lost. I
have an XML file with this type of data:
<?xml version="1.0"?>
<properties>
<property>
<name>Client Property A</name>
<phone>Client Property A Phone Number</phone>
</property>
<property>
<name>Client Property B</name>
<phone>Client Property B Phone Number</phone>
</property>
<property>
<name>Client Property C</name>
<phone>Client Property C Phone Number</phone>
</property>
</properties>
I'm trying to parse through this data in C# but having no luck at all. I
have this:
XmlTextReader xmldata = new XmlTextReader("http://url.to/xml");
XmlNodeList xmllist = doc.GetElementsByTagName("property");
processList( xmllist );
public void processList(XmlNodeList xmllist)
{
// Loop through each property node and list the information
foreach (XmlNode node in xmllist)
{
XmlElement nodeElement = (XmlElement)node;
txtBox.AppendText(nodeElement.GetElementsByTagName("name")[0].InnerText);
txtBox.AppendText(nodeElement.GetElementsByTagName("phone")[0].InnerText);
}
}
But nothing gets output in to my text box. :(
How to change python launch command in PyCharm
How to change python launch command in PyCharm
If I directly run start.py, I get:
Symbol not found: _OCIAttrGet
Referenced from: /Library/Python/2.7/site-packages/cx_Oracle.so
After some googling, I found that its because Oracle client arch issues. I
now run my script like this and it works:
arch -i386 python2.7 start.py
Now with a free edition of PyCharm available (thank you JetBrains), I
imported my projects but how do I set the "Run Configuration" to launch my
script the way I do it from terminal.
I tried:
Run -> Edit Configuration -> Python Interpreter but it is already
populated with the known python paths
Run -> Edit Configuration -> Interpreter Options but throws an error
saying unknown file "arch"
Any workarounds?
If I directly run start.py, I get:
Symbol not found: _OCIAttrGet
Referenced from: /Library/Python/2.7/site-packages/cx_Oracle.so
After some googling, I found that its because Oracle client arch issues. I
now run my script like this and it works:
arch -i386 python2.7 start.py
Now with a free edition of PyCharm available (thank you JetBrains), I
imported my projects but how do I set the "Run Configuration" to launch my
script the way I do it from terminal.
I tried:
Run -> Edit Configuration -> Python Interpreter but it is already
populated with the known python paths
Run -> Edit Configuration -> Interpreter Options but throws an error
saying unknown file "arch"
Any workarounds?
Tuesday, 1 October 2013
Having problems with webbrowser control in visual studio 2010
Having problems with webbrowser control in visual studio 2010
I have been trying to write a program (instead of a script) for
www.gifthulk.com mostly for data collection. The only problem i run into
with the program is that the web browser control wont load the log-in page
for the user so that i can have them sign in using the program.
The reason why i don't want to do this in a script is that i can't save
the data to a local file or connect to a custom built tcp server that
would store the data for me. The script would have to be a Grease-monkey
user-script, i don't know how to implement any other kind.
If there is a way to either fix the loading log-in popup page problem or
let a script connect remotely to my computers custom server and send data
the help would be very much appreciated.
I have been trying to write a program (instead of a script) for
www.gifthulk.com mostly for data collection. The only problem i run into
with the program is that the web browser control wont load the log-in page
for the user so that i can have them sign in using the program.
The reason why i don't want to do this in a script is that i can't save
the data to a local file or connect to a custom built tcp server that
would store the data for me. The script would have to be a Grease-monkey
user-script, i don't know how to implement any other kind.
If there is a way to either fix the loading log-in popup page problem or
let a script connect remotely to my computers custom server and send data
the help would be very much appreciated.
Video Tag of HTML5 (default image)
Video Tag of HTML5 (default image)
I am using video tag of HTML5
(http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_all). But
before playing the video it shows the very first second of the video as
the image; however, that image is solid black for my case; so I would like
to know if I can have the default image (before hitting the play button)
from somewhere of the middle of the video?
I hope my question is clear, if it is not clear please ask me what part is
ambiguous and I will provide more clarification
Appreciate it in advance.
I am using video tag of HTML5
(http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_all). But
before playing the video it shows the very first second of the video as
the image; however, that image is solid black for my case; so I would like
to know if I can have the default image (before hitting the play button)
from somewhere of the middle of the video?
I hope my question is clear, if it is not clear please ask me what part is
ambiguous and I will provide more clarification
Appreciate it in advance.
Apache - Return 404 for all execept selected
Apache - Return 404 for all execept selected
I am seeking for method to prevent access to Wordpress admin folder
"wp-admin", but also i need apache to generate 404 error (Not found) for
all, but not selected IPs. I found this post Returning 404 code for
unauthorized attempts and tried Rewrite solution, but does not work for
me.
So i keeping all websites in /usr/local/www/apache22/data and tried to use
such config in httpd.conf (Apache2.2 FreeBSD 9.1)
<Directory "/usr/local/www/apache22/data>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=77.120.9.3 [OR]
RewriteCond %{REMOTE_ADDR} !=77.120.9.5
RewriteRule ^wp-admin($|/) - [L,R=404]
</Directory>
For example, location of wp-admin for website is:
/usr/local/www/apache22/data/doman.com/wp-admin
I am seeking for method to prevent access to Wordpress admin folder
"wp-admin", but also i need apache to generate 404 error (Not found) for
all, but not selected IPs. I found this post Returning 404 code for
unauthorized attempts and tried Rewrite solution, but does not work for
me.
So i keeping all websites in /usr/local/www/apache22/data and tried to use
such config in httpd.conf (Apache2.2 FreeBSD 9.1)
<Directory "/usr/local/www/apache22/data>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !=77.120.9.3 [OR]
RewriteCond %{REMOTE_ADDR} !=77.120.9.5
RewriteRule ^wp-admin($|/) - [L,R=404]
</Directory>
For example, location of wp-admin for website is:
/usr/local/www/apache22/data/doman.com/wp-admin
Mint 15 Stopped connecting to new wireless networks [on hold]
Mint 15 Stopped connecting to new wireless networks [on hold]
I know this is Ubuntu forums, but I'm not receiving any answers from the
Mint community... I am a fresh migrant from Ubuntu 12.04 to Mint 15, and I
am having a wifi problem. I have two saved networks that I connected to
within the first couple of days of having mint, but upon trying to connect
to new networks in the following days, I'm having problems. In the network
manager screen, I can click on a network all day, but it never brings up
the password prompt or anything. On the network I'm on right now, I can go
to details, then when I click settings it says "error initializing editor:
insufficient privileges." This tells me I probably chmod'd something along
the way that no longer allows me to edit my wireless networks. I have
internet on the two that are saved, and I can connect to wired networks no
problem. I'm at a loss here and have found no similar problems on google.
Here is the output of mintwifi:
[code]* I. scanning WIFI PCI devices...
-- Atheros Communications Inc. AR928X Wireless Network Adapter
(PCI-Express) (rev 01)
==> PCI ID = 168c:002a (rev 01)
-------------------------
* II. querying ndiswrapper...
-------------------------
* III. querying iwconfig...
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11abgn ESSID:"java"
Mode:Managed Frequency:2.437 GHz Access Point: 00:18:39:4A:2A:54
Bit Rate=54 Mb/s Tx-Power=16 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-35 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:4 Invalid misc:283 Missed beacon:0
-------------------------
* IV. querying ifconfig...
eth0 Link encap:Ethernet HWaddr c8:0a:a9:84:af:71
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
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:65536 Metric:1
RX packets:1210 errors:0 dropped:0 overruns:0 frame:0
TX packets:1210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:253047 (253.0 KB) TX bytes:253047 (253.0 KB)
wlan0 Link encap:Ethernet HWaddr 70:f1:a1:7f:92:85
inet addr:192.168.1.107 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::72f1:a1ff:fe7f:9285/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13482 errors:0 dropped:0 overruns:0 frame:0
TX packets:12584 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12190123 (12.1 MB) TX bytes:2188578 (2.1 MB)
-------------------------
* V. querying DHCP...
[sudo] password for hollis:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload
/etc/init.d/smbd: 58: /etc/init.d/smbd: awk: not found
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd
RTNETLINK answers: File exists
-------------------------
* VI. querying nslookup google.com...
Server: 138.47.18.130
Address: 138.47.18.130#53
Non-authoritative answer:
Name: google.com
Address: 173.227.93.123
Name: google.com
Address: 173.227.93.84
Name: google.com
Address: 173.227.93.88
Name: google.com
Address: 173.227.93.89
Name: google.com
Address: 173.227.93.93
Name: google.com
Address: 173.227.93.94
Name: google.com
Address: 173.227.93.98
Name: google.com
Address: 173.227.93.99
Name: google.com
Address: 173.227.93.103
Name: google.com
Address: 173.227.93.104
Name: google.com
Address: 173.227.93.108
Name: google.com
Address: 173.227.93.109
Name: google.com
Address: 173.227.93.113
Name: google.com
Address: 173.227.93.114
Name: google.com
Address: 173.227.93.118
Name: google.com
Address: 173.227.93.119[/code]
I don't know if that does any good since I'm connected to java, but it's
there. Thanks for any help!
I know this is Ubuntu forums, but I'm not receiving any answers from the
Mint community... I am a fresh migrant from Ubuntu 12.04 to Mint 15, and I
am having a wifi problem. I have two saved networks that I connected to
within the first couple of days of having mint, but upon trying to connect
to new networks in the following days, I'm having problems. In the network
manager screen, I can click on a network all day, but it never brings up
the password prompt or anything. On the network I'm on right now, I can go
to details, then when I click settings it says "error initializing editor:
insufficient privileges." This tells me I probably chmod'd something along
the way that no longer allows me to edit my wireless networks. I have
internet on the two that are saved, and I can connect to wired networks no
problem. I'm at a loss here and have found no similar problems on google.
Here is the output of mintwifi:
[code]* I. scanning WIFI PCI devices...
-- Atheros Communications Inc. AR928X Wireless Network Adapter
(PCI-Express) (rev 01)
==> PCI ID = 168c:002a (rev 01)
-------------------------
* II. querying ndiswrapper...
-------------------------
* III. querying iwconfig...
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11abgn ESSID:"java"
Mode:Managed Frequency:2.437 GHz Access Point: 00:18:39:4A:2A:54
Bit Rate=54 Mb/s Tx-Power=16 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-35 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:4 Invalid misc:283 Missed beacon:0
-------------------------
* IV. querying ifconfig...
eth0 Link encap:Ethernet HWaddr c8:0a:a9:84:af:71
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
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:65536 Metric:1
RX packets:1210 errors:0 dropped:0 overruns:0 frame:0
TX packets:1210 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:253047 (253.0 KB) TX bytes:253047 (253.0 KB)
wlan0 Link encap:Ethernet HWaddr 70:f1:a1:7f:92:85
inet addr:192.168.1.107 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::72f1:a1ff:fe7f:9285/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13482 errors:0 dropped:0 overruns:0 frame:0
TX packets:12584 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12190123 (12.1 MB) TX bytes:2188578 (2.1 MB)
-------------------------
* V. querying DHCP...
[sudo] password for hollis:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload
/etc/init.d/smbd: 58: /etc/init.d/smbd: awk: not found
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd
RTNETLINK answers: File exists
-------------------------
* VI. querying nslookup google.com...
Server: 138.47.18.130
Address: 138.47.18.130#53
Non-authoritative answer:
Name: google.com
Address: 173.227.93.123
Name: google.com
Address: 173.227.93.84
Name: google.com
Address: 173.227.93.88
Name: google.com
Address: 173.227.93.89
Name: google.com
Address: 173.227.93.93
Name: google.com
Address: 173.227.93.94
Name: google.com
Address: 173.227.93.98
Name: google.com
Address: 173.227.93.99
Name: google.com
Address: 173.227.93.103
Name: google.com
Address: 173.227.93.104
Name: google.com
Address: 173.227.93.108
Name: google.com
Address: 173.227.93.109
Name: google.com
Address: 173.227.93.113
Name: google.com
Address: 173.227.93.114
Name: google.com
Address: 173.227.93.118
Name: google.com
Address: 173.227.93.119[/code]
I don't know if that does any good since I'm connected to java, but it's
there. Thanks for any help!
Monday, 30 September 2013
WiFi on WPA2: Can't Access Internet, Can Access LAN
WiFi on WPA2: Can't Access Internet, Can Access LAN
The WiFi in my laptop seems to be having a problem with WPA2. I can
connect to my network without issue and everything works fine for up to 5
minutes, but then I can't access the Internet. The network configuration
still thinks all is well, but I can't reach any hosts. I can, however,
reach anything inside my LAN.
Switching to my open guest network allows me full access to the internet
with no interruptions indefinitely.
lspci reports the following about my wireless adapter:
Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron]
Network Connection (rev 61)
Any suggestions?
The WiFi in my laptop seems to be having a problem with WPA2. I can
connect to my network without issue and everything works fine for up to 5
minutes, but then I can't access the Internet. The network configuration
still thinks all is well, but I can't reach any hosts. I can, however,
reach anything inside my LAN.
Switching to my open guest network allows me full access to the internet
with no interruptions indefinitely.
lspci reports the following about my wireless adapter:
Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron]
Network Connection (rev 61)
Any suggestions?
Why was this very low quality flag declined=?iso-8859-1?Q?=3F_=96_meta.stackoverflow.com?=
Why was this very low quality flag declined? – meta.stackoverflow.com
Question: Cyrus beck line algorithm program in c or c++. I know about the
specific meaning of VLQ flags, and I can't fathom why anyone would think
that question wouldn't be a candidate for removal. …
Question: Cyrus beck line algorithm program in c or c++. I know about the
specific meaning of VLQ flags, and I can't fathom why anyone would think
that question wouldn't be a candidate for removal. …
Ball Dropping Simulation Program, simulating a random direction bounce in C? [on hold]
Ball Dropping Simulation Program, simulating a random direction bounce in
C? [on hold]
This is in C only, not C++
The entire program is supposed to ask the user how many balls to drop,
make sure that number is at least one. And then simulate dropping the
balls, and allowing them to "bounce" ten times each, and then keep track
in an array how many balls landed in each array. Each bounce allows the
ball to either go left once or right once. This is all I have so far, any
tips?
When I go to print out the final product it should look something like
this. With each 'o' representing one ball dropped in that place
-10:
-8:
-6: o
-4: ooooooooo
-2: oooooooooooooooooooooo
0: ooooooooooooooooooooooooo
2: oooooooooooooooooooooo
4: ooooooooooooo
6: ooooooo
8:
10: o
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int drop_balls(int); /* Prototype for drop_Balls, int parameter is number
of balls being dropped */
int get_num_balls(int); /* Gets the number of balls that need to be
dropped by the user */
int main()
{
get_num_balls();
drop_balls(num_balls);
}
int get_num_balls()
{
printf("How many balls should be dropped? ");
scanf("%d", num_balls);
while(num_balls <= 0)
{
printf("You have to drop at least one ball! \n ")
printf("How many balls should be dropped? ");
scanf("%d", num_balls);
}
return num_balls; /* Return the number of balls that will be dropped */
}
int drop_balls(num_balls)
{
int ball_count[21]; /* Keeps track of how many balls landed where */
int ball_num = 0; /* What number ball are we on */
srand(time(NULL)); /* Seed the generator */
for(ball_num; ball_num < num_balls; ball_num++ ) /* Do the correct #
of balls */
{
int starting_point = 10; /* Start at 10 since its the middle of 21 */
for(starting_point; starting_point >=0; starting_point--) /*
Bounce each ball 10 times */
{
int number;
number = rand() % 100;
if(number > 50)
{
starting_point++;
}
else
{
starting_point--;
}
}
ball_count[starting_point] += "o"
}
int j;
for(j = 0; j < 21; j++)
{
if(ball_count[j] != 'null')
{
printf("'%d :'", ball_count[j]);
}
}
}
}
C? [on hold]
This is in C only, not C++
The entire program is supposed to ask the user how many balls to drop,
make sure that number is at least one. And then simulate dropping the
balls, and allowing them to "bounce" ten times each, and then keep track
in an array how many balls landed in each array. Each bounce allows the
ball to either go left once or right once. This is all I have so far, any
tips?
When I go to print out the final product it should look something like
this. With each 'o' representing one ball dropped in that place
-10:
-8:
-6: o
-4: ooooooooo
-2: oooooooooooooooooooooo
0: ooooooooooooooooooooooooo
2: oooooooooooooooooooooo
4: ooooooooooooo
6: ooooooo
8:
10: o
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int drop_balls(int); /* Prototype for drop_Balls, int parameter is number
of balls being dropped */
int get_num_balls(int); /* Gets the number of balls that need to be
dropped by the user */
int main()
{
get_num_balls();
drop_balls(num_balls);
}
int get_num_balls()
{
printf("How many balls should be dropped? ");
scanf("%d", num_balls);
while(num_balls <= 0)
{
printf("You have to drop at least one ball! \n ")
printf("How many balls should be dropped? ");
scanf("%d", num_balls);
}
return num_balls; /* Return the number of balls that will be dropped */
}
int drop_balls(num_balls)
{
int ball_count[21]; /* Keeps track of how many balls landed where */
int ball_num = 0; /* What number ball are we on */
srand(time(NULL)); /* Seed the generator */
for(ball_num; ball_num < num_balls; ball_num++ ) /* Do the correct #
of balls */
{
int starting_point = 10; /* Start at 10 since its the middle of 21 */
for(starting_point; starting_point >=0; starting_point--) /*
Bounce each ball 10 times */
{
int number;
number = rand() % 100;
if(number > 50)
{
starting_point++;
}
else
{
starting_point--;
}
}
ball_count[starting_point] += "o"
}
int j;
for(j = 0; j < 21; j++)
{
if(ball_count[j] != 'null')
{
printf("'%d :'", ball_count[j]);
}
}
}
}
getString() method for a class which extends from LinearLayout
getString() method for a class which extends from LinearLayout
I have a class which extends from LinearLayout. I want to use a string
from string.xml . Normally I use the following code:
this.getString(R.string.xxxx);
But since my class extends from LinearLayout I can't call getString()
method. How can i access those strings which are in my string.xml from my
class?
I have a class which extends from LinearLayout. I want to use a string
from string.xml . Normally I use the following code:
this.getString(R.string.xxxx);
But since my class extends from LinearLayout I can't call getString()
method. How can i access those strings which are in my string.xml from my
class?
Sunday, 29 September 2013
How to copy a certain data from multiple excel file with diffrent name into one master excel file
How to copy a certain data from multiple excel file with diffrent name
into one master excel file
I need help to compile a certain data from multiple excel file with a
different name onto one sheets (excel file located at certain location
folder). The data from each file that i want to grap :
1) B69 until E69 & I69
2) B75 until E75 & I75
And compile it into below format (summary) file: each row differentiate by
diffetrent excels file name :
Title Title Title Title Title Title Title Title Title Title B69 C69 D69
E69 I69 B75 C75 D75 E75 I75 B69 C69 D69 E69 I69 B75 C75 D75 E75 I75 B69
C69 D69 E69 I69 B75 C75 D75 E75 I75 B69 C69 D69 E69 I69 B75 C75 D75 E75
I75 B69 C69 D69 E69 I69 B75 C75 D75 E75 I75
I do this by daily basis & the data that i need to compile 100+ excel file
a day. Really hoping if some one could provide me a script to run macro on
this precedure
into one master excel file
I need help to compile a certain data from multiple excel file with a
different name onto one sheets (excel file located at certain location
folder). The data from each file that i want to grap :
1) B69 until E69 & I69
2) B75 until E75 & I75
And compile it into below format (summary) file: each row differentiate by
diffetrent excels file name :
Title Title Title Title Title Title Title Title Title Title B69 C69 D69
E69 I69 B75 C75 D75 E75 I75 B69 C69 D69 E69 I69 B75 C75 D75 E75 I75 B69
C69 D69 E69 I69 B75 C75 D75 E75 I75 B69 C69 D69 E69 I69 B75 C75 D75 E75
I75 B69 C69 D69 E69 I69 B75 C75 D75 E75 I75
I do this by daily basis & the data that i need to compile 100+ excel file
a day. Really hoping if some one could provide me a script to run macro on
this precedure
If total is between two numbers echo statement, else if between different set of numbers echo a different statement, etc
If total is between two numbers echo statement, else if between different
set of numbers echo a different statement, etc
I am terrible with figuring out if/else statements. I have looked at
multiple tutorials and just can't get what I'm trying to do work. I need
this: If total amount of points is less than # state that no title is
achieved If total amount is between # and # state what title that would be
If total amount is between higher # and # state what title that would be
etc.
The adding of total points works just fine but I can't figure out how to
get the correct title for the total points to show. I have included the
code for getting totalpoints as well in case it can be combined with what
I am trying to do. Any help greatly appreciated
This works just fine:
<?php
$query = "SELECT points, SUM(points) AS totalpoints FROM competition WHERE
id = $id";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<b>";
echo $row['totalpoints'];
echo "pts</b>";
}?>
This does not work:
<?php
$query = "SELECT points, SUM(points) AS totalpoints FROM competition WHERE
id = $id";
$result = mysql_query($query) or die(mysql_error());
while($titled = mysql_fetch_array($result)) {
if ($titled <= 999)
{echo ", not titled";}
elseif (($titled == 1000) && ($titled <= 1999))
{$titlename = ", Champion";}
elseif (($titled >= 2000) && ($titled <= 2999))
{$titlename = ", Grand Champion";}
elseif (($titled >= 3000) && ($titled <= 3999))
{$titlename = ", Honor Champion";}
elseif (($titled >= 4000) && ($titled <= 5999))
{$titlename = ", Regional Champion";}
elseif (($titled >= 6000) && ($titled <= 7999))
{$titlename = ", State Champion";}
elseif (($titled >= 8000) && ($titled <= 9999))
{$titlename = ", National Champion";}
elseif (($titled >= 10000) && ($titled <= 19999))
{$titlename = ", World Champion";}
elseif ($titled >= 20000)
{$titlename = ", Hall of Fame";}
}?>
set of numbers echo a different statement, etc
I am terrible with figuring out if/else statements. I have looked at
multiple tutorials and just can't get what I'm trying to do work. I need
this: If total amount of points is less than # state that no title is
achieved If total amount is between # and # state what title that would be
If total amount is between higher # and # state what title that would be
etc.
The adding of total points works just fine but I can't figure out how to
get the correct title for the total points to show. I have included the
code for getting totalpoints as well in case it can be combined with what
I am trying to do. Any help greatly appreciated
This works just fine:
<?php
$query = "SELECT points, SUM(points) AS totalpoints FROM competition WHERE
id = $id";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo "<b>";
echo $row['totalpoints'];
echo "pts</b>";
}?>
This does not work:
<?php
$query = "SELECT points, SUM(points) AS totalpoints FROM competition WHERE
id = $id";
$result = mysql_query($query) or die(mysql_error());
while($titled = mysql_fetch_array($result)) {
if ($titled <= 999)
{echo ", not titled";}
elseif (($titled == 1000) && ($titled <= 1999))
{$titlename = ", Champion";}
elseif (($titled >= 2000) && ($titled <= 2999))
{$titlename = ", Grand Champion";}
elseif (($titled >= 3000) && ($titled <= 3999))
{$titlename = ", Honor Champion";}
elseif (($titled >= 4000) && ($titled <= 5999))
{$titlename = ", Regional Champion";}
elseif (($titled >= 6000) && ($titled <= 7999))
{$titlename = ", State Champion";}
elseif (($titled >= 8000) && ($titled <= 9999))
{$titlename = ", National Champion";}
elseif (($titled >= 10000) && ($titled <= 19999))
{$titlename = ", World Champion";}
elseif ($titled >= 20000)
{$titlename = ", Hall of Fame";}
}?>
Is it good programming pracitce to assign Singleton to variables across multiple classes
Is it good programming pracitce to assign Singleton to variables across
multiple classes
In my app I'm using singleton class (as sharedInstance). Of course I need
to use data that is stored in that singleton in multiple classes (view
controllers). Because writing
[[[SingletonClass sharedInstance] arrayWithData] count] or
[[[SingletonClass sharedIntanse] arrayWithData] objectAtIndex:index] or
some other methods that you use on array is not comfortable I thought to,
in the begining of lifecycle of non-singleton class, assign property
(strong, nonatomic) of that non-singleton class to have the same address
as SingletonClass.
self.arrayPropertyOfOtherClassOne = [[SingletonClass sharedInstance]
arrayWithData] and in some other class
self.arrayPropertyOfOtherClassTwo = [[SingletonClass sharedInstance]
arrayWithData]
Is it good programming practice?
In my opinion there is nothing bad with it. Properties will point to the
same address as property in Singleton and after non-singleton class will
be destroyed also properties that where pointing to singleton so Reference
Count = Refrence count - 1.
Am I correct?
multiple classes
In my app I'm using singleton class (as sharedInstance). Of course I need
to use data that is stored in that singleton in multiple classes (view
controllers). Because writing
[[[SingletonClass sharedInstance] arrayWithData] count] or
[[[SingletonClass sharedIntanse] arrayWithData] objectAtIndex:index] or
some other methods that you use on array is not comfortable I thought to,
in the begining of lifecycle of non-singleton class, assign property
(strong, nonatomic) of that non-singleton class to have the same address
as SingletonClass.
self.arrayPropertyOfOtherClassOne = [[SingletonClass sharedInstance]
arrayWithData] and in some other class
self.arrayPropertyOfOtherClassTwo = [[SingletonClass sharedInstance]
arrayWithData]
Is it good programming practice?
In my opinion there is nothing bad with it. Properties will point to the
same address as property in Singleton and after non-singleton class will
be destroyed also properties that where pointing to singleton so Reference
Count = Refrence count - 1.
Am I correct?
Saturday, 28 September 2013
Osascript keycodes for arrow keys
Osascript keycodes for arrow keys
I'm trying to call osascript in Python to simulate key presses with
something like this:
cmd = """
osascript -e 'tell application "System Events" to keystroke "e"'
"""
os.system(cmd)
How can I send key presses for the up/down/left/right arrow keys?
I'm trying to call osascript in Python to simulate key presses with
something like this:
cmd = """
osascript -e 'tell application "System Events" to keystroke "e"'
"""
os.system(cmd)
How can I send key presses for the up/down/left/right arrow keys?
Turning SQL Distinct data into readable list in php
Turning SQL Distinct data into readable list in php
I have some custom tables in Wordpress that store information about
people, linked to a post, and I want to be able to generate a summary of
the data, specifically, a sentence along the lines of:
"This post mentions 4 surnames: Brown, Jones, Robinson and Smith"
I currently pull out the data as follows:
$surnames = $wpdb->get_results("
SELECT distinct lastname
FROM ".$wpdb->prefix."people
WHERE post_id='$post_id'
ORDER BY lastname asc");
Which returns an array of objects as follows:
Array (
[0] => stdClass Object ([lastname] => Brown )
[1] => stdClass Object ( [lastname] => Jones )
[2] => stdClass Object ( [lastname] => Robinson )
[3] => stdClass Object ( [lastname] => Smith )
)
So at the moment, I just do this:
foreach ($surnames as $surname) {$summary .= $surname->lastname.', ';}
which returns:
Brown, Jones, Robinson, Smith,
Clearly not acceptable.
Is there any standard php function that can do this, AND that will work on
an array of objects? I'd imagine this is a common problem, and I'm trying
to avoid reinventing the wheel if possible.
I have some custom tables in Wordpress that store information about
people, linked to a post, and I want to be able to generate a summary of
the data, specifically, a sentence along the lines of:
"This post mentions 4 surnames: Brown, Jones, Robinson and Smith"
I currently pull out the data as follows:
$surnames = $wpdb->get_results("
SELECT distinct lastname
FROM ".$wpdb->prefix."people
WHERE post_id='$post_id'
ORDER BY lastname asc");
Which returns an array of objects as follows:
Array (
[0] => stdClass Object ([lastname] => Brown )
[1] => stdClass Object ( [lastname] => Jones )
[2] => stdClass Object ( [lastname] => Robinson )
[3] => stdClass Object ( [lastname] => Smith )
)
So at the moment, I just do this:
foreach ($surnames as $surname) {$summary .= $surname->lastname.', ';}
which returns:
Brown, Jones, Robinson, Smith,
Clearly not acceptable.
Is there any standard php function that can do this, AND that will work on
an array of objects? I'd imagine this is a common problem, and I'm trying
to avoid reinventing the wheel if possible.
How to parse XML data into below code instead of JSON
How to parse XML data into below code instead of JSON
I am new to Android and Java. Below code parses JSON data from URL and
populates into ListView. But I have URL that sends XML data, so I want to
Parse XML instead of JSON and populate same in ListView. What changes do i
require into this code. Let me know if you require other classes code.
public class RemoteFetchService extends Service {
private int appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
private AQuery aquery;
private String remoteJsonUrl =
"http://laaptu.files.wordpress.com/2013/07/widgetlist.key";
public static ArrayList<ListItem> listItemList;
private int count = 0;
@Override
public IBinder onBind(Intent arg0) {
return null;
}
/*
* Retrieve appwidget id from intent it is needed to update widget later
* initialize our AQuery class
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent.hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID))
appWidgetId = intent.getIntExtra(
AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);
aquery = new AQuery(getBaseContext());
fetchDataFromWeb();
return super.onStartCommand(intent, flags, startId);
}
/**
* method which fetches data(json) from web aquery takes params
* remoteJsonUrl = from where data to be fetched String.class = return
* format of data once fetched i.e. in which format the fetched data be
* returned AjaxCallback = class to notify with data once it is fetched
*/
private void fetchDataFromWeb() {
aquery.ajax(remoteJsonUrl, String.class, new AjaxCallback<String>() {
@Override
public void callback(String url, String result, AjaxStatus
status) {
processResult(result);
super.callback(url, result, status);
}
});
}
/**
* Json parsing of result and populating ArrayList<ListItem> as per json
* data retrieved from the string
*/
private void processResult(String result) {
Log.i("Resutl", result);
listItemList = new ArrayList<ListItem>();
try {
JSONArray jsonArray = new JSONArray(result);
int length = jsonArray.length();
for (int i = 0; i < length; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
ListItem listItem = new ListItem();
listItem.heading = jsonObject.getString("title");
listItem.content = jsonObject.getString("description");
listItem.imageUrl = jsonObject.getString("imageUrl");
listItemList.add(listItem);
}
storeListItem();
} catch (JSONException e) {
e.printStackTrace();
}
}
/**
* Instead of using static ArrayList as we have used before,no we rely
upon
* data stored on database so saving the fetched json file content into
* database and at same time downloading the image from web as well
*/
private void storeListItem() {
DatabaseManager dbManager = DatabaseManager.INSTANCE;
dbManager.init(getBaseContext());
dbManager.storeListItems(appWidgetId, listItemList);
int length = listItemList.size();
for (int i = 0; i < length; i++) {
ListItem listItem = listItemList.get(i);
final int index = i;
aquery.ajax(listItem.imageUrl, Bitmap.class,
new AjaxCallback<Bitmap>() {
@Override
public void callback(String url, Bitmap bitmap,
AjaxStatus status) {
super.callback(url, bitmap, status);
storeBitmap(index, bitmap);
};
});
}
}
/**
* Saving the downloaded images into file and after all the download of
* images be complete begin to populate widget as done previously
*/
private void storeBitmap(int index, Bitmap bitmap) {
FileManager.INSTANCE.storeBitmap(appWidgetId, bitmap,
listItemList.get(index).heading, getBaseContext());
count++;
Log.i("count",
String.valueOf(count) + "::"
+ Integer.toString(listItemList.size()));
if (count == listItemList.size()) {
count = 0;
populateWidget();
}
}
/**
* Method which sends broadcast to WidgetProvider so that widget is
notified
* to do necessary action and here action == WidgetProvider.DATA_FETCHED
*/
private void populateWidget() {
Intent widgetUpdateIntent = new Intent();
widgetUpdateIntent.setAction(WidgetProvider.DATA_FETCHED);
widgetUpdateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
appWidgetId);
sendBroadcast(widgetUpdateIntent);
this.stopSelf();
}
}
I am new to Android and Java. Below code parses JSON data from URL and
populates into ListView. But I have URL that sends XML data, so I want to
Parse XML instead of JSON and populate same in ListView. What changes do i
require into this code. Let me know if you require other classes code.
public class RemoteFetchService extends Service {
private int appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
private AQuery aquery;
private String remoteJsonUrl =
"http://laaptu.files.wordpress.com/2013/07/widgetlist.key";
public static ArrayList<ListItem> listItemList;
private int count = 0;
@Override
public IBinder onBind(Intent arg0) {
return null;
}
/*
* Retrieve appwidget id from intent it is needed to update widget later
* initialize our AQuery class
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent.hasExtra(AppWidgetManager.EXTRA_APPWIDGET_ID))
appWidgetId = intent.getIntExtra(
AppWidgetManager.EXTRA_APPWIDGET_ID,
AppWidgetManager.INVALID_APPWIDGET_ID);
aquery = new AQuery(getBaseContext());
fetchDataFromWeb();
return super.onStartCommand(intent, flags, startId);
}
/**
* method which fetches data(json) from web aquery takes params
* remoteJsonUrl = from where data to be fetched String.class = return
* format of data once fetched i.e. in which format the fetched data be
* returned AjaxCallback = class to notify with data once it is fetched
*/
private void fetchDataFromWeb() {
aquery.ajax(remoteJsonUrl, String.class, new AjaxCallback<String>() {
@Override
public void callback(String url, String result, AjaxStatus
status) {
processResult(result);
super.callback(url, result, status);
}
});
}
/**
* Json parsing of result and populating ArrayList<ListItem> as per json
* data retrieved from the string
*/
private void processResult(String result) {
Log.i("Resutl", result);
listItemList = new ArrayList<ListItem>();
try {
JSONArray jsonArray = new JSONArray(result);
int length = jsonArray.length();
for (int i = 0; i < length; i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
ListItem listItem = new ListItem();
listItem.heading = jsonObject.getString("title");
listItem.content = jsonObject.getString("description");
listItem.imageUrl = jsonObject.getString("imageUrl");
listItemList.add(listItem);
}
storeListItem();
} catch (JSONException e) {
e.printStackTrace();
}
}
/**
* Instead of using static ArrayList as we have used before,no we rely
upon
* data stored on database so saving the fetched json file content into
* database and at same time downloading the image from web as well
*/
private void storeListItem() {
DatabaseManager dbManager = DatabaseManager.INSTANCE;
dbManager.init(getBaseContext());
dbManager.storeListItems(appWidgetId, listItemList);
int length = listItemList.size();
for (int i = 0; i < length; i++) {
ListItem listItem = listItemList.get(i);
final int index = i;
aquery.ajax(listItem.imageUrl, Bitmap.class,
new AjaxCallback<Bitmap>() {
@Override
public void callback(String url, Bitmap bitmap,
AjaxStatus status) {
super.callback(url, bitmap, status);
storeBitmap(index, bitmap);
};
});
}
}
/**
* Saving the downloaded images into file and after all the download of
* images be complete begin to populate widget as done previously
*/
private void storeBitmap(int index, Bitmap bitmap) {
FileManager.INSTANCE.storeBitmap(appWidgetId, bitmap,
listItemList.get(index).heading, getBaseContext());
count++;
Log.i("count",
String.valueOf(count) + "::"
+ Integer.toString(listItemList.size()));
if (count == listItemList.size()) {
count = 0;
populateWidget();
}
}
/**
* Method which sends broadcast to WidgetProvider so that widget is
notified
* to do necessary action and here action == WidgetProvider.DATA_FETCHED
*/
private void populateWidget() {
Intent widgetUpdateIntent = new Intent();
widgetUpdateIntent.setAction(WidgetProvider.DATA_FETCHED);
widgetUpdateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
appWidgetId);
sendBroadcast(widgetUpdateIntent);
this.stopSelf();
}
}
why coinbase callback url not working?
why coinbase callback url not working?
i have the below code for button creation. public function
createButton($name, $price, $currency, $custom=null,
$options=array(),$callback) { //
$callback=$this->generateReceiveAddress("http://www.tgigo.com");
// print_r($callback);exit;
$params = array(
"name" => $name,
"price_string" => $price,
"price_currency_iso" => $currency,
"callback_url"=>"http://www.tgigo.com"
);
if($custom !== null) {
$params['custom'] = $custom;
}
foreach($options as $option => $value) {
$params[$option] = $value;
}
return $this->createButtonWithOptions($params);
}
public function createButtonWithOptions($options=array())
{
$response = $this->post("buttons", array( "button" => $options ));
if(!$response->success) {
return $response;
}
$returnValue = new stdClass();
$returnValue->button = $response->button;
$returnValue->embedHtml = "<div class=\"coinbase-button\"
data-code=\"" . $response->button->code . "\"></div><script
src=\"https://coinbase.com/assets/button.js\"
type=\"text/javascript\"></script>";
$returnValue->success = true;
return $returnValue;
}
and i have the below response for above code.
{"success":true,"button":{"code":"675cda22e31b314db557f0538f8ad27e","type":"buy_now","style":"buy_now_large","text":"Pay
With Bitcoin","name":"Your Order #1234","description":"1 widget at
$100","custom":"my custom tracking code for this
order","callback_url":"http://www.tgigo.com","price":{"cents":100000,"currency_iso":"BTC"}}}
using this code payment process completed,but not redirected to the call
back url. any one please help me.
Thanks in advance :)
i have the below code for button creation. public function
createButton($name, $price, $currency, $custom=null,
$options=array(),$callback) { //
$callback=$this->generateReceiveAddress("http://www.tgigo.com");
// print_r($callback);exit;
$params = array(
"name" => $name,
"price_string" => $price,
"price_currency_iso" => $currency,
"callback_url"=>"http://www.tgigo.com"
);
if($custom !== null) {
$params['custom'] = $custom;
}
foreach($options as $option => $value) {
$params[$option] = $value;
}
return $this->createButtonWithOptions($params);
}
public function createButtonWithOptions($options=array())
{
$response = $this->post("buttons", array( "button" => $options ));
if(!$response->success) {
return $response;
}
$returnValue = new stdClass();
$returnValue->button = $response->button;
$returnValue->embedHtml = "<div class=\"coinbase-button\"
data-code=\"" . $response->button->code . "\"></div><script
src=\"https://coinbase.com/assets/button.js\"
type=\"text/javascript\"></script>";
$returnValue->success = true;
return $returnValue;
}
and i have the below response for above code.
{"success":true,"button":{"code":"675cda22e31b314db557f0538f8ad27e","type":"buy_now","style":"buy_now_large","text":"Pay
With Bitcoin","name":"Your Order #1234","description":"1 widget at
$100","custom":"my custom tracking code for this
order","callback_url":"http://www.tgigo.com","price":{"cents":100000,"currency_iso":"BTC"}}}
using this code payment process completed,but not redirected to the call
back url. any one please help me.
Thanks in advance :)
Friday, 27 September 2013
How do I allow a user to input strings into an array until they hit enter with no text input?
How do I allow a user to input strings into an array until they hit enter
with no text input?
I'm really hoping someone can help me out here. I'm still fairly new to
Java and I have spent hours trying to figure out how to do this. I have a
loop to prompt the user to input text (string) into an arraylist however,
I cannot figure out how to end the loop and display their input (I want
this to happen when they press 'enter' with a blank text field. Here is
what I have - Thank you in advance!!
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Ex01 {
public static void main(String[] args) throws IOException {
BufferedReader userInput = new BufferedReader(new InputStreamReader(
System.in));
ArrayList<String> myArr = new ArrayList<String>();
myArr.add("Zero");
myArr.add("One");
myArr.add("Two");
myArr.add("Three");
do {
System.out.println("Enter a line of text to add to the array: ");
String textLine = userInput.readLine();
myArr.add(textLine);
} while (userInput!=null);
for (int x = 0; x < myArr.size(); ++x)
System.out.println("position " + x + " contains the text: "
+ myArr.get(x));
}
}
with no text input?
I'm really hoping someone can help me out here. I'm still fairly new to
Java and I have spent hours trying to figure out how to do this. I have a
loop to prompt the user to input text (string) into an arraylist however,
I cannot figure out how to end the loop and display their input (I want
this to happen when they press 'enter' with a blank text field. Here is
what I have - Thank you in advance!!
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Ex01 {
public static void main(String[] args) throws IOException {
BufferedReader userInput = new BufferedReader(new InputStreamReader(
System.in));
ArrayList<String> myArr = new ArrayList<String>();
myArr.add("Zero");
myArr.add("One");
myArr.add("Two");
myArr.add("Three");
do {
System.out.println("Enter a line of text to add to the array: ");
String textLine = userInput.readLine();
myArr.add(textLine);
} while (userInput!=null);
for (int x = 0; x < myArr.size(); ++x)
System.out.println("position " + x + " contains the text: "
+ myArr.get(x));
}
}
Subscribe to:
Posts (Atom)