Intermittent DNS failures depending on user's DNS setings
I manage a VPS which hosts a forum and recently we migrated from one
physical VPS host to another in the same company, with a downtime of about
48h and all configuration was made with cpanel full account backups.
Since then, our users reported intermittent DNS failures. Most of them
report things like normal behaviour from midnight until noon and DNS
failures from noon to midnight. They are also under corporate networks and
are unable to change their DNS server settings. (And I also believe that
solving this kind of problems by suggesting client-side settings changes
isn't an elegant solution for a large-ish website)
One of the moderators is experiencing this kind of error and sent me the
following dig output:
; <<>> DiG 9.7.0-P1 <<>> clubecetico.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4
;; QUESTION SECTION:
;clubecetico.org. IN A
;; ANSWER SECTION:
clubecetico.org. 7246 IN A 193.164.133.22
;; AUTHORITY SECTION:
clubecetico.org. 70536 IN NS ns2.ns-serve.net.
clubecetico.org. 70536 IN NS ns1.ns-serve.net.
clubecetico.org. 70536 IN NS ns2.ns-service.de.
clubecetico.org. 70536 IN NS ns.ns-service.de.
;; ADDITIONAL SECTION:
ns.ns-service.de. 82917 IN A 194.126.239.242
ns1.ns-serve.net. 56831 IN A 193.254.189.162
ns2.ns-serve.net. 56831 IN A 83.243.59.34
ns2.ns-service.de. 82917 IN A 213.203.228.195
;; Query time: 744 msec
;; SERVER: 200.198.34.81#53(200.198.34.81)
;; WHEN: Fri Sep 20 16:20:53 2013
;; MSG SIZE rcvd: 209
Here, using google's 8.8.8.8 and 8.8.4.4 the error never occurs and the
output is
; <<>> DiG 9.9.3-P2 <<>> clubecetico.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8975
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;clubecetico.org. IN A
;; ANSWER SECTION:
clubecetico.org. 11061 IN A 193.164.133.22
;; AUTHORITY SECTION:
clubecetico.org. 34589 IN NS ns1.clubecetico.org.
clubecetico.org. 34589 IN NS ns2.clubecetico.org.
;; ADDITIONAL SECTION:
ns1.clubecetico.org. 19614 IN A 193.164.133.22
ns2.clubecetico.org. 34589 IN A 193.164.133.22
;; Query time: 16 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sat Sep 28 13:56:36 BRT 2013
;; MSG SIZE rcvd: 128
The only DNS configuration I have access to is that the nameservers I
should use are ns1.clubecetico.org and ns2.clubecetico.org. In thecpanel`
DNS setup, I added an A record with the server's IP.
But I really think that there's something missing because I'm not sure if
the DNS client can query ns1.clubecetico.org to obtain the IP of
clubecetico.org.
I also have no idea where these ns-service.net come from and why some DNS
servers reply with them.
Is there any server-side thing I can do about this issue? Why do these
servers reply so differently?
Thanks in advance
Monday, 30 September 2013
Low wireless range on ubuntu 13.04
Low wireless range on ubuntu 13.04
I put ubuntu 13.04 on my Asus S300ca. The issue is with the wireless. The
range is much smaller than on windows. I have 10+ feet range from the
router on wireless, then on ubuntu I have about 3 feet before it becomes
unstable, 5 feet and it doesn't even see the router. Is there any way to
increase power to the card or increase the range of the card? Thank You.
I put ubuntu 13.04 on my Asus S300ca. The issue is with the wireless. The
range is much smaller than on windows. I have 10+ feet range from the
router on wireless, then on ubuntu I have about 3 feet before it becomes
unstable, 5 feet and it doesn't even see the router. Is there any way to
increase power to the card or increase the range of the card? Thank You.
if an oracle datafile gets too big for the directory what does one do
if an oracle datafile gets too big for the directory what does one do
if I have a datafile in a directory and it is getting too big for the
directory what command in Oracle can I use to move that file, or do I make
another datafile into another directory?
ALTER TABLESPACE
users
ADD DATAFILE
'/ora01/oracle/oradata/booktst_users_02.dbf'
size 100m
if I have a datafile in a directory and it is getting too big for the
directory what command in Oracle can I use to move that file, or do I make
another datafile into another directory?
ALTER TABLESPACE
users
ADD DATAFILE
'/ora01/oracle/oradata/booktst_users_02.dbf'
size 100m
Live streaming with Jquery image slider
Live streaming with Jquery image slider
I am having a situation like how can I run a slideshow as live streaming.
Like if I have two screen at a time and both having same page of image
slider opens in the browser and when I click on the next or previous
button slide will change on both the screen simultaneously. Is there any
way to do that, If then please give me any suggestion how to do that.
I am having a situation like how can I run a slideshow as live streaming.
Like if I have two screen at a time and both having same page of image
slider opens in the browser and when I click on the next or previous
button slide will change on both the screen simultaneously. Is there any
way to do that, If then please give me any suggestion how to do that.
Sunday, 29 September 2013
PHP Pear Mail not working
PHP Pear Mail not working
I have been able to use the PEAR package code on a godaddy server that has
PEAR installed and everything works as intended, however when I try to
execute the code on my local machine I receive no emails and no error
messages that gives me any indication of what is going wrong.
From what I have gathered from numerous sources on the web is that once I
have installed PEAR I need to setup the include_path in the "php.ini"
Also in the php.ini file I have added
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = myemail@gmail.com ****[Hidding real email address]****
PHP installation as followed:
php installation path c:\php
pear installation path c:\php\pear
php.ini include_path = ".;c:\php\pear"
Pear packages c:\php\pear - gathered from pear list
mail
mail_Mime
Net_SMTP
Net_Socket
PEAR
Any help on this matter will be greatly appreciated.
I have been able to use the PEAR package code on a godaddy server that has
PEAR installed and everything works as intended, however when I try to
execute the code on my local machine I receive no emails and no error
messages that gives me any indication of what is going wrong.
From what I have gathered from numerous sources on the web is that once I
have installed PEAR I need to setup the include_path in the "php.ini"
Also in the php.ini file I have added
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = myemail@gmail.com ****[Hidding real email address]****
PHP installation as followed:
php installation path c:\php
pear installation path c:\php\pear
php.ini include_path = ".;c:\php\pear"
Pear packages c:\php\pear - gathered from pear list
mail_Mime
Net_SMTP
Net_Socket
PEAR
Any help on this matter will be greatly appreciated.
Binding a VB.net label.text to an object property
Binding a VB.net label.text to an object property
I want to have label in a form who's text value changes depending upon the
value of a instance of a class. It looks like I can bind the text value of
the label to an object dataSource. When I try this it does not seem to
work.
Me.Label4.DataBindings.Add(New System.Windows.Forms.Binding("Text",
Me.ItemInfoBindingSource, "ItemNumber", True,
System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
My itemInfoBindingSource:
Me.ItemInfoBindingSource.DataSource = GetType(CFP.ItemInfo)
and the class definition:
Public Class ItemInfo
Public Property ItemNumber As String = "rename"
Public Property Description As String
Public Property FileLocation As String
Public Property CompileHistory As List(Of CompileHistory)
End Class
I think what I have done is bind to a class not an instance of a class.
Thinking about it what I really want to do is bind an instance of a class
to a label...how? Is this possible?
I want to have label in a form who's text value changes depending upon the
value of a instance of a class. It looks like I can bind the text value of
the label to an object dataSource. When I try this it does not seem to
work.
Me.Label4.DataBindings.Add(New System.Windows.Forms.Binding("Text",
Me.ItemInfoBindingSource, "ItemNumber", True,
System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged))
My itemInfoBindingSource:
Me.ItemInfoBindingSource.DataSource = GetType(CFP.ItemInfo)
and the class definition:
Public Class ItemInfo
Public Property ItemNumber As String = "rename"
Public Property Description As String
Public Property FileLocation As String
Public Property CompileHistory As List(Of CompileHistory)
End Class
I think what I have done is bind to a class not an instance of a class.
Thinking about it what I really want to do is bind an instance of a class
to a label...how? Is this possible?
Sockets ClassCastException HashMap
Sockets ClassCastException HashMap
I've created a serverSocket and accept a client connection. However when I
try to read from the client, it is throwing the following exception. If I
change HashMap to ArrayList, it does not work either.
Exception in thread "Thread-3" java.lang.ClassCastException:
java.awt.Point cannot be cast to java.util.HashMap
at ServerSide.Server.getPoints(Server.java:112)
at ServerSide.Server.run(Server.java:69)
//...
public void getPoints() throws IOException, ClassNotFoundException {
points = (HashMap<Point, Boolean>) objectInputStream.readObject();
Iterator iterator = points.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Point, Boolean> currentPoint = (Map.Entry<Point,
Boolean>) iterator.next();
currentPoint.setValue(firgure.isHit(currentPoint.getKey().x,
currentPoint.getKey().y));
}
objectOutputStream.writeObject(points);
}
P.s. Sorry for my English.
I've created a serverSocket and accept a client connection. However when I
try to read from the client, it is throwing the following exception. If I
change HashMap to ArrayList, it does not work either.
Exception in thread "Thread-3" java.lang.ClassCastException:
java.awt.Point cannot be cast to java.util.HashMap
at ServerSide.Server.getPoints(Server.java:112)
at ServerSide.Server.run(Server.java:69)
//...
public void getPoints() throws IOException, ClassNotFoundException {
points = (HashMap<Point, Boolean>) objectInputStream.readObject();
Iterator iterator = points.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Point, Boolean> currentPoint = (Map.Entry<Point,
Boolean>) iterator.next();
currentPoint.setValue(firgure.isHit(currentPoint.getKey().x,
currentPoint.getKey().y));
}
objectOutputStream.writeObject(points);
}
P.s. Sorry for my English.
Left and Right Panel Navigation
Left and Right Panel Navigation
Im attempting to work on a jquery navigation. the navigation will be fixed
open on desktop but will close on mobile device and opened on request.
My aim.
1) left panel to open and push the body content aside when on mobile device.
2) right panel to do exact same but on right side too.
I have created the html but im cant seem to find a jquery solution.
any ideas?
Cheers
Paul
http://jsfiddle.net/x3Rpk/
<div id="leftnav"> click to close and open on mobile device</div>
<div id="main-content">content her</div>
<div id="rightnav"> click close and open on mobile device</div>
Im attempting to work on a jquery navigation. the navigation will be fixed
open on desktop but will close on mobile device and opened on request.
My aim.
1) left panel to open and push the body content aside when on mobile device.
2) right panel to do exact same but on right side too.
I have created the html but im cant seem to find a jquery solution.
any ideas?
Cheers
Paul
http://jsfiddle.net/x3Rpk/
<div id="leftnav"> click to close and open on mobile device</div>
<div id="main-content">content her</div>
<div id="rightnav"> click close and open on mobile device</div>
Saturday, 28 September 2013
Finish button not responding in Project Creation
Finish button not responding in Project Creation
I have ticket and filled all the necessary fields in the Project Creation
window, I am creating an Android Application Project and when I come to
the last screen of the project creation window, the finish button doesn't
do any thing and I am stuck inside the window, if I exit it, the project
remains empty and blank and when I restart Eclipse and retry nothing
happens yet again! I have even re-installed it several times and also
restarted my computer several times, but yet nothing happens! I don't even
get a bug notification, error message or project change inside the project
window! Nothing happens! Does any body know what my problem is and how I
can fix it ?!
Thank you!
I have ticket and filled all the necessary fields in the Project Creation
window, I am creating an Android Application Project and when I come to
the last screen of the project creation window, the finish button doesn't
do any thing and I am stuck inside the window, if I exit it, the project
remains empty and blank and when I restart Eclipse and retry nothing
happens yet again! I have even re-installed it several times and also
restarted my computer several times, but yet nothing happens! I don't even
get a bug notification, error message or project change inside the project
window! Nothing happens! Does any body know what my problem is and how I
can fix it ?!
Thank you!
Scalatra charset error
Scalatra charset error
I'm facing a charset encoding issue I cannot figure out how to resolve.
Here's what I'm doing:
I have a Scalatra Action calling a Apache Solr instance. The action in
Scalatra just opens a Strem on the Url where Solr responds, it takes the
output and prints it in the response
The response has invalid UTF-8 bytes
What do I miss?
The data in Solr's indexes are UTF-8 encoded: calling Solr directly from
Advanced Rest Client for Google Chrome I see everything is OK (I get a
utf-8 contentType response)
When reading the stream from Solr, I force UTF-8 decoding
val urlCon = url.openConnection()
Some(fromInputStream( urlCon.getInputStream, "utf8" ).getLines.mkString)
The Java options variable is ok (as defined in my project's sbt file)
declare -r default_jvm_opts="-Dfile.encoding=UTF8"
All my Eclipse project files are UTF-8 encoded
I force contentType to UTF-8 in the HTTP response
response.setCharacterEncoding("utf-8")
Here's the configuration of the software stack I'm running on:
Mac OS X Snow Leopard
Java 1.6.0_51
Apache Solr 4.3.0 deployed on Tomcat 7.0.41
Scalatra 2.2.1 using Scala 2.10.2, SBT 0.12.3, running on Jetty
8.1.8.v20121106
I'm quite sure the issue is in one of the software related to Scalatra
(Scalatra, SBT, Jetty, Scala) because as I told earlier, calling Solr
directly I see everything is correctly encoded.
Any idea?
I'm facing a charset encoding issue I cannot figure out how to resolve.
Here's what I'm doing:
I have a Scalatra Action calling a Apache Solr instance. The action in
Scalatra just opens a Strem on the Url where Solr responds, it takes the
output and prints it in the response
The response has invalid UTF-8 bytes
What do I miss?
The data in Solr's indexes are UTF-8 encoded: calling Solr directly from
Advanced Rest Client for Google Chrome I see everything is OK (I get a
utf-8 contentType response)
When reading the stream from Solr, I force UTF-8 decoding
val urlCon = url.openConnection()
Some(fromInputStream( urlCon.getInputStream, "utf8" ).getLines.mkString)
The Java options variable is ok (as defined in my project's sbt file)
declare -r default_jvm_opts="-Dfile.encoding=UTF8"
All my Eclipse project files are UTF-8 encoded
I force contentType to UTF-8 in the HTTP response
response.setCharacterEncoding("utf-8")
Here's the configuration of the software stack I'm running on:
Mac OS X Snow Leopard
Java 1.6.0_51
Apache Solr 4.3.0 deployed on Tomcat 7.0.41
Scalatra 2.2.1 using Scala 2.10.2, SBT 0.12.3, running on Jetty
8.1.8.v20121106
I'm quite sure the issue is in one of the software related to Scalatra
(Scalatra, SBT, Jetty, Scala) because as I told earlier, calling Solr
directly I see everything is correctly encoded.
Any idea?
Play Iteratee throttling
Play Iteratee throttling
I'm writing a streaming web radio framework using scala and Play. I'm
relying on Iteratees for the actual streaming, but I'm running into an
issue trying to prevent a greedy client from downloading data too quickly,
and consuming the stream for all the clients. To do so I've been trying to
create an Enumeratee that will throttle how quickly the Enumerator
produces data. Here's what my Enumeratee looks like
val throttlingIteratee = Iteratee.foldM[Array[Byte], Array[Byte]](new
Array[Byte](0)) {
(result, chunk) =>
val prom = Promise[Array[Byte]]()
timer.schedule(new TimerTask{
def run() = prom.success(result ++ chunk)
},1000)
prom.future
}
private val chunker = Enumeratee.grouped(
Traversable.take[Array[Byte]](31792) &>> throttlingIteratee
)
The idea is that I use the timer task to create a throttlingIteratee and
pair that with the Enumeratee.grouped function. This seems to work fairly
well, but I'm having trouble figuring out what value to use for the chunk
size. I want to have this produce chunks at about the same rate as the
audio plays. My audio file is encoded at 82kpbs, and I've tried to
calculate that in terms of bytes, but the values I come up with seem to be
too small, and the audio plays faster than the data is streamed.
My question is two fold. Is the basic approach I have in place a good one?
And if it is, how do I go about setting the chunk size in terms of the
audio file's bit rate.
I'm writing a streaming web radio framework using scala and Play. I'm
relying on Iteratees for the actual streaming, but I'm running into an
issue trying to prevent a greedy client from downloading data too quickly,
and consuming the stream for all the clients. To do so I've been trying to
create an Enumeratee that will throttle how quickly the Enumerator
produces data. Here's what my Enumeratee looks like
val throttlingIteratee = Iteratee.foldM[Array[Byte], Array[Byte]](new
Array[Byte](0)) {
(result, chunk) =>
val prom = Promise[Array[Byte]]()
timer.schedule(new TimerTask{
def run() = prom.success(result ++ chunk)
},1000)
prom.future
}
private val chunker = Enumeratee.grouped(
Traversable.take[Array[Byte]](31792) &>> throttlingIteratee
)
The idea is that I use the timer task to create a throttlingIteratee and
pair that with the Enumeratee.grouped function. This seems to work fairly
well, but I'm having trouble figuring out what value to use for the chunk
size. I want to have this produce chunks at about the same rate as the
audio plays. My audio file is encoded at 82kpbs, and I've tried to
calculate that in terms of bytes, but the values I come up with seem to be
too small, and the audio plays faster than the data is streamed.
My question is two fold. Is the basic approach I have in place a good one?
And if it is, how do I go about setting the chunk size in terms of the
audio file's bit rate.
Fastest way to store values in database in c#?
Fastest way to store values in database in c#?
Before evry thing i should say i read this : Fastest way Store data in
database using c# and really it was not help full .
I Have 3 table with too many fields,they are about currency s(SO YOU KNOW
THE ARE LOT OF VALUES FOR SELL AND BUY)
i have my values in Textboxes in my web page.Now i want to save the
textbox values in my data base(BUT REMEMBER PLEASE THEY ARE ABOUT 128
VALUES WHICH SHOULD STORE IN 128 FIELD in my table)
SO the quistion is which way is the fastest way? 1.using DB Entity?
2.using stored proc and do them in my C# behind code? 3.using formview or
somthing like that?
Before evry thing i should say i read this : Fastest way Store data in
database using c# and really it was not help full .
I Have 3 table with too many fields,they are about currency s(SO YOU KNOW
THE ARE LOT OF VALUES FOR SELL AND BUY)
i have my values in Textboxes in my web page.Now i want to save the
textbox values in my data base(BUT REMEMBER PLEASE THEY ARE ABOUT 128
VALUES WHICH SHOULD STORE IN 128 FIELD in my table)
SO the quistion is which way is the fastest way? 1.using DB Entity?
2.using stored proc and do them in my C# behind code? 3.using formview or
somthing like that?
Friday, 27 September 2013
QT compile error: endl will always evaluate to true
QT compile error: endl will always evaluate to true
I have the following code snippet that compiles
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
for (QStringList::Iterator it = commandList.begin(); it !=
commandList.end(); ++it) {
out << "Command: " << *it << endl;
}
but always gives me this warning:
test.cpp:87: warning: the address of 'QTextStream& endl(QTextStream&)'
will always evaluate as 'true' [-Waddress]
What does it mean and how do I fix it? Since a newline character is
printing I assume this is not a namespace issue...
I have the following code snippet that compiles
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
for (QStringList::Iterator it = commandList.begin(); it !=
commandList.end(); ++it) {
out << "Command: " << *it << endl;
}
but always gives me this warning:
test.cpp:87: warning: the address of 'QTextStream& endl(QTextStream&)'
will always evaluate as 'true' [-Waddress]
What does it mean and how do I fix it? Since a newline character is
printing I assume this is not a namespace issue...
JavaScript - Run code when user confirms leaving page
JavaScript - Run code when user confirms leaving page
I want the user to confirm that he wants to leave the page. I do that this
way with jQuery:
$(window).bind('beforeunload', function(){
return "Are you sure?";
});
If the user says "yes", I want to run a function before the browser tab
closes. Is this possible? And how, in that case?
I want the user to confirm that he wants to leave the page. I do that this
way with jQuery:
$(window).bind('beforeunload', function(){
return "Are you sure?";
});
If the user says "yes", I want to run a function before the browser tab
closes. Is this possible? And how, in that case?
Convert date variable, in the form "JA11" to date in STATA
Convert date variable, in the form "JA11" to date in STATA
I have a data set that that has a date variable that is now in the form of
a two digit alphabetic abbreviation for the month followed by the two
digit numerical year, such as JA11 for January 2011. How can I convert
this to something STATA can recognize as a month/year date?
Thank you for your help.
I have a data set that that has a date variable that is now in the form of
a two digit alphabetic abbreviation for the month followed by the two
digit numerical year, such as JA11 for January 2011. How can I convert
this to something STATA can recognize as a month/year date?
Thank you for your help.
Selenium::WebDriver::Error::UnhandledAlertError) after dismissing the alert
Selenium::WebDriver::Error::UnhandledAlertError) after dismissing the alert
We have a Cucumber scenario that looks like this:
@selenium
Scenario: I can be told that geolocation is unavailable
# features/home_page.feature:57
Given I am a visitor
#
features/step_definitions/authentication_steps.rb:5
When I visit the homepage
#
features/step_definitions/home_page_steps.rb:1
And I have declined geolocation permissions
#
features/step_definitions/home_page_steps.rb:14
And I click the geolocate button
#
features/step_definitions/home_page_steps.rb:18
Then I see an alert "Unable to determine your current location. Please
type an address instead." # features/step_definitions/web_steps.rb:104
The step I see an alert "(.+?)" is defined as:
Then(/^I see an alert "(.+?)"$/) do |content|
page.driver.browser.switch_to.alert.text.should == content
page.driver.browser.switch_to.alert.dismiss
end
For some reason, dismissing this alert doesn't suffice. The next scenario
in line always fails with:
Modal dialog present (Selenium::WebDriver::Error::UnhandledAlertError)
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/command_processor.js:10521:in
`nsCommandProcessor.execute'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7510:in
`Dispatcher.executeAs/<'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7668:in
`Resource.handle'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7615:in
`Dispatcher.dispatch'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:10336:in
`WebDriverServer/<.handle'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1935:in
`unknown'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:2261:in
`ServerHandler.handleResponse'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1168:in
`Connection.process'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1616:in
`RequestReader._handleResponse'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1464:in
`RequestReader._processBody'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1333:in
`RequestReader.onInputStreamReady'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:51:in
`assert_ok'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`new'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`create_response'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:66:in
`request'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in
`call'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in
`raw_execute'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:607:in
`execute'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:356:in
`deleteAllCookies'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/options.rb:67:in
`delete_all_cookies'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/selenium/driver.rb:67:in
`reset!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/session.rb:75:in
`reset!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`block in reset_sessions!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`each'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`reset_sessions!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/cucumber.rb:10:in
`Before'
We've tried upgrading selenium-webdriver and capybara to no avail. The
only thing that has worked so far is to duplicate the dismiss line, which
feels gross but always gets rid of the dialog. There's definitely only one
dialog, so what gives?
We have a Cucumber scenario that looks like this:
@selenium
Scenario: I can be told that geolocation is unavailable
# features/home_page.feature:57
Given I am a visitor
#
features/step_definitions/authentication_steps.rb:5
When I visit the homepage
#
features/step_definitions/home_page_steps.rb:1
And I have declined geolocation permissions
#
features/step_definitions/home_page_steps.rb:14
And I click the geolocate button
#
features/step_definitions/home_page_steps.rb:18
Then I see an alert "Unable to determine your current location. Please
type an address instead." # features/step_definitions/web_steps.rb:104
The step I see an alert "(.+?)" is defined as:
Then(/^I see an alert "(.+?)"$/) do |content|
page.driver.browser.switch_to.alert.text.should == content
page.driver.browser.switch_to.alert.dismiss
end
For some reason, dismissing this alert doesn't suffice. The next scenario
in line always fails with:
Modal dialog present (Selenium::WebDriver::Error::UnhandledAlertError)
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/command_processor.js:10521:in
`nsCommandProcessor.execute'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7510:in
`Dispatcher.executeAs/<'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7668:in
`Resource.handle'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:7615:in
`Dispatcher.dispatch'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/driver_component.js:10336:in
`WebDriverServer/<.handle'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1935:in
`unknown'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:2261:in
`ServerHandler.handleResponse'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1168:in
`Connection.process'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1616:in
`RequestReader._handleResponse'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1464:in
`RequestReader._processBody'
[remote server]
file:///var/folders/x6/4vcz8vmj5ls2dbc9b3x2qxvh0000gp/T/webdriver-profile20130927-61014-emm2oz/extensions/fxdriver@googlecode.com/components/httpd.js:1333:in
`RequestReader.onInputStreamReady'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:51:in
`assert_ok'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`new'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:59:in
`create_response'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/default.rb:66:in
`request'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/http/common.rb:40:in
`call'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:629:in
`raw_execute'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:607:in
`execute'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/remote/bridge.rb:356:in
`deleteAllCookies'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/selenium-webdriver-2.33.0/lib/selenium/webdriver/common/options.rb:67:in
`delete_all_cookies'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/selenium/driver.rb:67:in
`reset!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/session.rb:75:in
`reset!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`block in reset_sessions!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`each'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara.rb:253:in
`reset_sessions!'
/Users/ccashwell/.rvm/gems/ruby-1.9.3-p194@geostellar/gems/capybara-2.0.3/lib/capybara/cucumber.rb:10:in
`Before'
We've tried upgrading selenium-webdriver and capybara to no avail. The
only thing that has worked so far is to duplicate the dismiss line, which
feels gross but always gets rid of the dialog. There's definitely only one
dialog, so what gives?
Resharper solution settings
Resharper solution settings
I have Visual Studio with Resharper 7.1 configured in it. I opened a
solution and added a word say QWERTY in the abbreviation list. I could
find this entry in GlobalSettingsStorage.DotSettings file and everything
is working as expected.
Now I deleted this abbreviation entry from
GlobalSettingsStorage.DotSettings file. Now also I am able to see the
abbreviation word in the solution as valid through Resharper. Then I
checked my mySolution1.DotSettings in my solution's folder and could not
find this entry here as well. Can any one help me to understand where this
abbreviation is actually stored? Also what are the places where resharper
settings are actually stored?
I have Visual Studio with Resharper 7.1 configured in it. I opened a
solution and added a word say QWERTY in the abbreviation list. I could
find this entry in GlobalSettingsStorage.DotSettings file and everything
is working as expected.
Now I deleted this abbreviation entry from
GlobalSettingsStorage.DotSettings file. Now also I am able to see the
abbreviation word in the solution as valid through Resharper. Then I
checked my mySolution1.DotSettings in my solution's folder and could not
find this entry here as well. Can any one help me to understand where this
abbreviation is actually stored? Also what are the places where resharper
settings are actually stored?
how to send the contact form details to your mail id using wordpress
how to send the contact form details to your mail id using wordpress
Help me out friends i have been working form 14 days on the word press and
could not able to send the contact form details to the mail id from the
contact form to the mail
Help me out friends i have been working form 14 days on the word press and
could not able to send the contact form details to the mail id from the
contact form to the mail
Thursday, 19 September 2013
Qt PushButton exec widgets
Qt PushButton exec widgets
I have a checkable pushbutton set to exec/close a dialog widget that I
have created.
My idea is when the pushbutton is checked, it will close the dialog
widget. If it's not checked, it should open the dialog widget. But I am
unable to get it to work. It keeps on opening instances of the dialog
widget. I wanted to open one instance of the dialog widget only. Could
anyone please help?
MainDlg::MainDlg()
{
connect(dialogButton, SIGNAL(clicked()), this, SLOT(setDialog()));
}
void MainDlg::setDialog()
{
SetDialogDlg setDlg;
if(dialogButton->isChecked())
{
setDlg.close();
}
else
{
setDlg.exec();
}
}
I have a checkable pushbutton set to exec/close a dialog widget that I
have created.
My idea is when the pushbutton is checked, it will close the dialog
widget. If it's not checked, it should open the dialog widget. But I am
unable to get it to work. It keeps on opening instances of the dialog
widget. I wanted to open one instance of the dialog widget only. Could
anyone please help?
MainDlg::MainDlg()
{
connect(dialogButton, SIGNAL(clicked()), this, SLOT(setDialog()));
}
void MainDlg::setDialog()
{
SetDialogDlg setDlg;
if(dialogButton->isChecked())
{
setDlg.close();
}
else
{
setDlg.exec();
}
}
phonegap android datepicker plugin cancel button doesnt hide dialog
phonegap android datepicker plugin cancel button doesnt hide dialog
I have been able to port an old phonegap datepicker plugin to work with
phonegap 3.0.0 and its new command line feature. However after datepicker
is triggered and the cancel button is tapped the datepicker disappears and
reappear. The datepicker only disappears if a date is set. Am not really
good with java, so i dont where to begin to fix this issue
The java class can be found here at this repo Thanks for the help
I have been able to port an old phonegap datepicker plugin to work with
phonegap 3.0.0 and its new command line feature. However after datepicker
is triggered and the cancel button is tapped the datepicker disappears and
reappear. The datepicker only disappears if a date is set. Am not really
good with java, so i dont where to begin to fix this issue
The java class can be found here at this repo Thanks for the help
Using Java processbuilder to turn of HDMI tv
Using Java processbuilder to turn of HDMI tv
I would like to send the following command below from a java program, but
not overly bothered about reading the response. any idea how I can do this
the command below turns of the TV through CEC cammand
echo "standby 0000" | cec-client -d 1 -s "standby 0" RPI
I am lloking at something like the following code below, but not sure how
I can fit the above comand to it
ProcessBuilder builder = new ProcessBuilder("ls", "-l"); // or whatever
your command is
builder.redirectErrorStream(true);
Process proc = builder.start();
I would like to send the following command below from a java program, but
not overly bothered about reading the response. any idea how I can do this
the command below turns of the TV through CEC cammand
echo "standby 0000" | cec-client -d 1 -s "standby 0" RPI
I am lloking at something like the following code below, but not sure how
I can fit the above comand to it
ProcessBuilder builder = new ProcessBuilder("ls", "-l"); // or whatever
your command is
builder.redirectErrorStream(true);
Process proc = builder.start();
Make 2D Array by Splitting a text with a delimiter C++
Make 2D Array by Splitting a text with a delimiter C++
Well I have that code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::string s = "0,0,0,1,1,1,0,0,1";
std::string delimiter = ",";
int x = 0;
std::string mapa[9];
size_t pos = 0;
std::string token;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
std::cout << token << std::endl;
s.erase(0, pos + delimiter.length());
mapa[x] = token;
x++;
}
std::cout << s << std::endl;
cin.get();
}
Parse (split) a string in C++ using string delimiter (standard C++)
I have x array, but I need a second dimension the Y... I get the content
from a text file called map.txt:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
And I need to split it by commas (for the x) and later by newlines (for y)...
But Idk how to do the Y array... What Can I do?
Thanks!
Well I have that code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
std::string s = "0,0,0,1,1,1,0,0,1";
std::string delimiter = ",";
int x = 0;
std::string mapa[9];
size_t pos = 0;
std::string token;
while ((pos = s.find(delimiter)) != std::string::npos) {
token = s.substr(0, pos);
std::cout << token << std::endl;
s.erase(0, pos + delimiter.length());
mapa[x] = token;
x++;
}
std::cout << s << std::endl;
cin.get();
}
Parse (split) a string in C++ using string delimiter (standard C++)
I have x array, but I need a second dimension the Y... I get the content
from a text file called map.txt:
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
And I need to split it by commas (for the x) and later by newlines (for y)...
But Idk how to do the Y array... What Can I do?
Thanks!
sql Find data that does NOT exist in a subquery
sql Find data that does NOT exist in a subquery
I'm trying to find all records that do not match my criteria.
I have a one-to-many table where for each key combo (wbs1, wbs2, wbs3)
there may be many records. I'm trying to query this table for each combo,
and return the combo (wbs1, wbs2, wbs3) only when the table has no records
that match my "in" criteria.
But at the moment, my query seems to be returning all or nothing.
select distinct wbs1, wbs2, wbs3
from dbo.Registry
where not exists ( select wbs1, wbs2, wbs3, InspType
from Registry
where ISNULL(InspType,'') IN ('Test 1','Test 2')
)
What I'd like in the return is a list of wbs1,wbs2,wbs3 where in the table
"Registry" there are no entries that match the Test (InspType) criteria.
Thanks!
I'm trying to find all records that do not match my criteria.
I have a one-to-many table where for each key combo (wbs1, wbs2, wbs3)
there may be many records. I'm trying to query this table for each combo,
and return the combo (wbs1, wbs2, wbs3) only when the table has no records
that match my "in" criteria.
But at the moment, my query seems to be returning all or nothing.
select distinct wbs1, wbs2, wbs3
from dbo.Registry
where not exists ( select wbs1, wbs2, wbs3, InspType
from Registry
where ISNULL(InspType,'') IN ('Test 1','Test 2')
)
What I'd like in the return is a list of wbs1,wbs2,wbs3 where in the table
"Registry" there are no entries that match the Test (InspType) criteria.
Thanks!
How to access mailer log in godaddy using putty
How to access mailer log in godaddy using putty
I am able to connect to godaddy server using putty ssh being new to putty,
don't know much about it... and need to check my mailer logs .. what
command line should i use to access the error log file..
Loged in successfully -bash-3.2$
I am able to connect to godaddy server using putty ssh being new to putty,
don't know much about it... and need to check my mailer logs .. what
command line should i use to access the error log file..
Loged in successfully -bash-3.2$
Hidden Information in .txt/.csv File
Hidden Information in .txt/.csv File
I have been given a .csv/.ssv/.txt file (a semi-colon delimited text
file). If I open this file with a text editor (Notepad++, Notepad,
010Editor et al.) I see data similar to the following subset:
IK; Aufnahmedatum;...;Entlassungsdatum
123456789;2.01201E+11;...;2.01201E+11
where the ellipsis indicates other data.
Now, the formatting is not important; what is important is the 2.01201E+11
scientific formatting. If I attempt to read this .csv file as text I get
2.01201E+11. However, if I first convert my .csv to .txt and then open it
with Excel and use the formatting wizard, I again get cell values with
2.01201E+11 here comes the wired part - if I now edit the cell value, I
see what I want; namely 201111010811. This is a data-time with formatting
'yyyymmddhhmm'.
How does Excel get this information when it does not appear to be in the
underlying .csv/.txt file? How can I get this information without first
converting the file via Excel?
Thanks for your time.
I have been given a .csv/.ssv/.txt file (a semi-colon delimited text
file). If I open this file with a text editor (Notepad++, Notepad,
010Editor et al.) I see data similar to the following subset:
IK; Aufnahmedatum;...;Entlassungsdatum
123456789;2.01201E+11;...;2.01201E+11
where the ellipsis indicates other data.
Now, the formatting is not important; what is important is the 2.01201E+11
scientific formatting. If I attempt to read this .csv file as text I get
2.01201E+11. However, if I first convert my .csv to .txt and then open it
with Excel and use the formatting wizard, I again get cell values with
2.01201E+11 here comes the wired part - if I now edit the cell value, I
see what I want; namely 201111010811. This is a data-time with formatting
'yyyymmddhhmm'.
How does Excel get this information when it does not appear to be in the
underlying .csv/.txt file? How can I get this information without first
converting the file via Excel?
Thanks for your time.
PHP not updating records in a row
PHP not updating records in a row
this program not able me to update record in a row, anyone can solve this
please, i need answers, i must understand...
this is the code: i'm using dreamweaver for this
PHP code: needs more answer
<?php require_once('Connections/tlsc_conn.php');
mysql_select_db($database_tlsc_conn, $tlsc_conn);
$query_Recordset1 = "SELECT * FROM tbl_name";
$Recordset1 = mysql_query($query_Recordset1, $tlsc_conn) or
die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
if(isset($_POST['submit'])) {
// $count = count($_POST['id']);
// $count=mysql_num_rows($Recordset1);
$submit = $_GET['submit'];
$i = ($_POST['count']);
$name = ($_POST['name']);
$lastname = ($_POST['lastname']);
$email = ($_POST['email']);
$id = ($_POST['id']);
for($i=0;$i<$count;$i++){
$sql1="UPDATE $tbl_name SET name='$name[$i]',
lastname='$lastname[$i]', email='$email[$i]' WHERE id='$id[$i]'";
$row_Recordset1=mysql_query($sql1);
}
if($row_Recordset1){
header("location:lulu.php");
exit;
}
}
?>
HTML code: i don't think if it is fixed, but i think it is...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form name="form2" method="post" action="">
<table width="634" border="1">
<tr>
<td>id</td>
<td>name</td>
<td>lastname</td>
<td>email</td>
</tr>
<?php while($row_Recordset1 = mysql_fetch_assoc($Recordset1)){ ?>
<tr>
<td><?php $id[]=$row_Recordset1['id']; ?><?php echo
$row_Recordset1['id']; ?>
<input name="id[]" type="hidden" value="<?php echo
$row_Recordset1['id']; ?>" />
</td>
<td>
<input name="name[]" type="text" value="<?php echo
$row_Recordset1['name']; ?>">
</td>
<td>
<input name="lastname[]" type="text" value="<?php echo
$row_Recordset1['lastname']; ?>">
</td>
<td>
<input name="email[]" type="text" value="<?php echo
$row_Recordset1['email']; ?>"> </td>
</tr>
<?php } ?>
</table>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
<p>
</body>
</html>
this program not able me to update record in a row, anyone can solve this
please, i need answers, i must understand...
this is the code: i'm using dreamweaver for this
PHP code: needs more answer
<?php require_once('Connections/tlsc_conn.php');
mysql_select_db($database_tlsc_conn, $tlsc_conn);
$query_Recordset1 = "SELECT * FROM tbl_name";
$Recordset1 = mysql_query($query_Recordset1, $tlsc_conn) or
die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
if(isset($_POST['submit'])) {
// $count = count($_POST['id']);
// $count=mysql_num_rows($Recordset1);
$submit = $_GET['submit'];
$i = ($_POST['count']);
$name = ($_POST['name']);
$lastname = ($_POST['lastname']);
$email = ($_POST['email']);
$id = ($_POST['id']);
for($i=0;$i<$count;$i++){
$sql1="UPDATE $tbl_name SET name='$name[$i]',
lastname='$lastname[$i]', email='$email[$i]' WHERE id='$id[$i]'";
$row_Recordset1=mysql_query($sql1);
}
if($row_Recordset1){
header("location:lulu.php");
exit;
}
}
?>
HTML code: i don't think if it is fixed, but i think it is...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form name="form2" method="post" action="">
<table width="634" border="1">
<tr>
<td>id</td>
<td>name</td>
<td>lastname</td>
<td>email</td>
</tr>
<?php while($row_Recordset1 = mysql_fetch_assoc($Recordset1)){ ?>
<tr>
<td><?php $id[]=$row_Recordset1['id']; ?><?php echo
$row_Recordset1['id']; ?>
<input name="id[]" type="hidden" value="<?php echo
$row_Recordset1['id']; ?>" />
</td>
<td>
<input name="name[]" type="text" value="<?php echo
$row_Recordset1['name']; ?>">
</td>
<td>
<input name="lastname[]" type="text" value="<?php echo
$row_Recordset1['lastname']; ?>">
</td>
<td>
<input name="email[]" type="text" value="<?php echo
$row_Recordset1['email']; ?>"> </td>
</tr>
<?php } ?>
</table>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
<p>
</body>
</html>
Wednesday, 18 September 2013
In android always execute catch block it doesent call method from the zend
In android always execute catch block it doesent call method from the zend
Hello all i am trying to accees zend xmlrpc method in to android but it
always execute catch block is there any help... follwing is my code.
Android code Following is my android code for calling zend xmlapi.
below code pass url and call the method from the zend framework to the
test method of below activity it set the text value return from the zend
framework test method.
public class ClientActivity extends Activity {
private XMLRPCClient client;
private URI uri;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_client);
System.out.println("Hello world");
uri = URI.create("http://10.0.2.2/tz/Examp2.php/api/?wsdl");
client = new XMLRPCClient(uri);
TextView textView = (TextView) findViewById(R.id.text_view);
textView.setText(testMethod());
}
private String testMethod() {
String text = "";
try {
text = (String) client.call("cmd.test");
} catch (XMLRPCException e) {
Log.w("XMLRPC Test", "Error", e);
text="Some error";
}
return text;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.client, menu);
return true;
}
}
and at zend side code my code is following which contain xml rpc server
it will return string value to the android device.
<?php
class Examp2Controller extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
$server = new Zend_XmlRpc_Server();
$server->setClass('Application_Model_Students', 'cmd');
echo $server->handle();
}
}
// This is a model code.
which contain one test method that i am trying to call
<?php
class Application_Model_Students
{
/**
* Test method
*
* @return string
*/
public function test()
{
return 'Hello XMLRPC!';
}
}
Hello all i am trying to accees zend xmlrpc method in to android but it
always execute catch block is there any help... follwing is my code.
Android code Following is my android code for calling zend xmlapi.
below code pass url and call the method from the zend framework to the
test method of below activity it set the text value return from the zend
framework test method.
public class ClientActivity extends Activity {
private XMLRPCClient client;
private URI uri;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_client);
System.out.println("Hello world");
uri = URI.create("http://10.0.2.2/tz/Examp2.php/api/?wsdl");
client = new XMLRPCClient(uri);
TextView textView = (TextView) findViewById(R.id.text_view);
textView.setText(testMethod());
}
private String testMethod() {
String text = "";
try {
text = (String) client.call("cmd.test");
} catch (XMLRPCException e) {
Log.w("XMLRPC Test", "Error", e);
text="Some error";
}
return text;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is
present.
getMenuInflater().inflate(R.menu.client, menu);
return true;
}
}
and at zend side code my code is following which contain xml rpc server
it will return string value to the android device.
<?php
class Examp2Controller extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
$server = new Zend_XmlRpc_Server();
$server->setClass('Application_Model_Students', 'cmd');
echo $server->handle();
}
}
// This is a model code.
which contain one test method that i am trying to call
<?php
class Application_Model_Students
{
/**
* Test method
*
* @return string
*/
public function test()
{
return 'Hello XMLRPC!';
}
}
Adding a new array element to a JSON object
Adding a new array element to a JSON object
I have a JSON format object I read from a JSON file that I have in a
variable called teamJSON, that looks like this:
{"theTeam":[{"teamId":"1","status":"pending"},{"teamId":"2","status":"member"},{"teamId":"3","status":"member"}]}
I want to add a new item to the array, such as
{"teamId":"4","status":"pending"}
to end up with
{"theTeam":[{"teamId":"1","status":"pending"},{"teamId":"2","status":"member"},{"teamId":"3","status":"member"},{"teamId":"4","status":"pending"}]}
before writing back to the file. What is a good way to add to the new
element? I got close but all the double quotes were escaped. I have looked
for a good answer on SO but none quite cover this case. Any help is
appreciated.
I have a JSON format object I read from a JSON file that I have in a
variable called teamJSON, that looks like this:
{"theTeam":[{"teamId":"1","status":"pending"},{"teamId":"2","status":"member"},{"teamId":"3","status":"member"}]}
I want to add a new item to the array, such as
{"teamId":"4","status":"pending"}
to end up with
{"theTeam":[{"teamId":"1","status":"pending"},{"teamId":"2","status":"member"},{"teamId":"3","status":"member"},{"teamId":"4","status":"pending"}]}
before writing back to the file. What is a good way to add to the new
element? I got close but all the double quotes were escaped. I have looked
for a good answer on SO but none quite cover this case. Any help is
appreciated.
Java code not reading arguments
Java code not reading arguments
For a class that I have, I have to take arguments, which will be files
with different urls on each line, and run through the lines to count the
amount of times each url has different schemes and different domains. If
there is no argument, than I have to scan in directly what is typed. I
have gotten the following code, which includes everything except the
printlns at the end.
import java.util.Scanner;
public class P1 {
public static void main(String[] args){
int fileLinesCt=0, totalLinesCt=0;
int httpCt=0, httpsCt=0, ftpCt=0, otherSchemeCt=0;
int eduCt=0, orgCt=0, comCt=0, otherDomainCt=0;
String url, scheme, schemeSP, domain = null;
Scanner scan = null;
if(!args.equals(null)){
for (int j=0; j<args.length; j++){
scan = new Scanner(args[j]);
fileLinesCt = 0;
while (!"end".equals(scan.nextLine())){
url = scan.nextLine();
String[] parts = url.split("//://");
scheme = parts[0];
schemeSP = parts[1];
if ("http".equals(scheme))
httpCt++;
if ("https".equals(scheme))
httpsCt++;
if ("ftp".equals(scheme))
ftpCt++;
else otherSchemeCt++;
for (int i=0; i<schemeSP.length(); i++){
if (schemeSP.charAt(j) == '.')
domain = schemeSP.substring(j,'/');
if (schemeSP.charAt(j) == '/')
break;
}
if ("edu".equals(domain))
eduCt++;
if ("org".equals(domain))
orgCt++;
if ("com".equals(domain))
comCt++;
else otherDomainCt++;
fileLinesCt++;
totalLinesCt++;
if (fileLinesCt == 1)
System.out.println(">> Got " + fileLinesCt + " line from "
+ scan);
else System.out.println(">> Got " + fileLinesCt + " lines from
" + scan);
}
}
}
else {
Scanner scanner = new Scanner(System.in);
fileLinesCt = 0;
while (!scanner.next().equals("end")){
url = scanner.next();
String[] parts = url.split("//://");
scheme = parts[0];
schemeSP = parts[1];
if ("http".equals(scheme))
httpCt++;
if ("https".equals(scheme))
httpsCt++;
if ("ftp".equals(scheme))
ftpCt++;
else otherSchemeCt++;
for (int j=0; j<schemeSP.length(); j++){
if (schemeSP.charAt(j) == '.')
domain = schemeSP.substring(j,'/');
if (schemeSP.charAt(j) == '/')
break;
}
if ("edu".equals(domain))
eduCt++;
if ("org".equals(domain))
orgCt++;
if ("com".equals(domain))
comCt++;
else otherDomainCt++;
fileLinesCt++;
totalLinesCt++;
if (fileLinesCt == 1)
System.out.println(">> Got " + fileLinesCt + " line from "
+ scan);
else System.out.println(">> Got " + fileLinesCt + " lines from
" + scan);
}
}
When running the code, I get an error that says
"Program failed when listing file(s) on command line.
Exception in thread "main" java.util.NoSuchElementException: No line
found" This occurs at line 15 when it tries to scan the next line.
What am I doing wrong that would stop it from scanning the next line?
For a class that I have, I have to take arguments, which will be files
with different urls on each line, and run through the lines to count the
amount of times each url has different schemes and different domains. If
there is no argument, than I have to scan in directly what is typed. I
have gotten the following code, which includes everything except the
printlns at the end.
import java.util.Scanner;
public class P1 {
public static void main(String[] args){
int fileLinesCt=0, totalLinesCt=0;
int httpCt=0, httpsCt=0, ftpCt=0, otherSchemeCt=0;
int eduCt=0, orgCt=0, comCt=0, otherDomainCt=0;
String url, scheme, schemeSP, domain = null;
Scanner scan = null;
if(!args.equals(null)){
for (int j=0; j<args.length; j++){
scan = new Scanner(args[j]);
fileLinesCt = 0;
while (!"end".equals(scan.nextLine())){
url = scan.nextLine();
String[] parts = url.split("//://");
scheme = parts[0];
schemeSP = parts[1];
if ("http".equals(scheme))
httpCt++;
if ("https".equals(scheme))
httpsCt++;
if ("ftp".equals(scheme))
ftpCt++;
else otherSchemeCt++;
for (int i=0; i<schemeSP.length(); i++){
if (schemeSP.charAt(j) == '.')
domain = schemeSP.substring(j,'/');
if (schemeSP.charAt(j) == '/')
break;
}
if ("edu".equals(domain))
eduCt++;
if ("org".equals(domain))
orgCt++;
if ("com".equals(domain))
comCt++;
else otherDomainCt++;
fileLinesCt++;
totalLinesCt++;
if (fileLinesCt == 1)
System.out.println(">> Got " + fileLinesCt + " line from "
+ scan);
else System.out.println(">> Got " + fileLinesCt + " lines from
" + scan);
}
}
}
else {
Scanner scanner = new Scanner(System.in);
fileLinesCt = 0;
while (!scanner.next().equals("end")){
url = scanner.next();
String[] parts = url.split("//://");
scheme = parts[0];
schemeSP = parts[1];
if ("http".equals(scheme))
httpCt++;
if ("https".equals(scheme))
httpsCt++;
if ("ftp".equals(scheme))
ftpCt++;
else otherSchemeCt++;
for (int j=0; j<schemeSP.length(); j++){
if (schemeSP.charAt(j) == '.')
domain = schemeSP.substring(j,'/');
if (schemeSP.charAt(j) == '/')
break;
}
if ("edu".equals(domain))
eduCt++;
if ("org".equals(domain))
orgCt++;
if ("com".equals(domain))
comCt++;
else otherDomainCt++;
fileLinesCt++;
totalLinesCt++;
if (fileLinesCt == 1)
System.out.println(">> Got " + fileLinesCt + " line from "
+ scan);
else System.out.println(">> Got " + fileLinesCt + " lines from
" + scan);
}
}
When running the code, I get an error that says
"Program failed when listing file(s) on command line.
Exception in thread "main" java.util.NoSuchElementException: No line
found" This occurs at line 15 when it tries to scan the next line.
What am I doing wrong that would stop it from scanning the next line?
Multiple buttons on an html page to reveal text step by step rather than simultaneously?
Multiple buttons on an html page to reveal text step by step rather than
simultaneously?
trying to create a list of about 7 questions with a click to reveal answer
button next to each question. only problem is when i click one button, it
runs the entire js code and shows ALL the answers not just that particular
one.
here is my code
Question 1 $("form").submit(function() { $("#reveal-space").text("Answer
1").show(); return true; }); Question 2 $("form").submit(function() {
$("#reveal-space1").text("Answer 2").show(); return true; }); Question 3
$("form").submit(function() { $("#reveal-space2").text("Answer 3").show();
return true; }); Question 4 $("form").submit(function() {
$("#reveal-space3").text("Answer 4").show(); return true; });
how do i fix it to make it so that when the "1" button is clicked it
doesn't reveal the texts to the other buttons ? i may need to take an
entirely different approach
thanks for the help in advance
simultaneously?
trying to create a list of about 7 questions with a click to reveal answer
button next to each question. only problem is when i click one button, it
runs the entire js code and shows ALL the answers not just that particular
one.
here is my code
Question 1 $("form").submit(function() { $("#reveal-space").text("Answer
1").show(); return true; }); Question 2 $("form").submit(function() {
$("#reveal-space1").text("Answer 2").show(); return true; }); Question 3
$("form").submit(function() { $("#reveal-space2").text("Answer 3").show();
return true; }); Question 4 $("form").submit(function() {
$("#reveal-space3").text("Answer 4").show(); return true; });
how do i fix it to make it so that when the "1" button is clicked it
doesn't reveal the texts to the other buttons ? i may need to take an
entirely different approach
thanks for the help in advance
Imaginary units of complex numbers dropped by 'knitr'
Imaginary units of complex numbers dropped by 'knitr'
I came across a strange issue in 'knitr' with R code containing complex
numbers entered directly using the "x + yi" notation. For an illustration
see the minimal example: http://goo.gl/Yj77kI
The sample code evaluates correctly, both in R console and as a code chunk
when compiled with Sweave, resulting in:
> 1i^2
[1] -1+0i
However, when trying to use 'knitr' on the same document, the imaginary
unit seems to get lost and what I get is:
1^2
## [1] 1
Any ideas?
Cheers, Andrzej
I came across a strange issue in 'knitr' with R code containing complex
numbers entered directly using the "x + yi" notation. For an illustration
see the minimal example: http://goo.gl/Yj77kI
The sample code evaluates correctly, both in R console and as a code chunk
when compiled with Sweave, resulting in:
> 1i^2
[1] -1+0i
However, when trying to use 'knitr' on the same document, the imaginary
unit seems to get lost and what I get is:
1^2
## [1] 1
Any ideas?
Cheers, Andrzej
importing multiple text files into multiple tables using ssis
importing multiple text files into multiple tables using ssis
Q: I have multiple text files in a folder named xyz, and i have created a
new database in sqlserver which does not having any tables .Here my
problem is to import all those text files into new database according to
the text file named tables using ssis package .can anyone knows please
tell me the steps.
A: Step 1: Use foraech loop iterator to pick all files in the specific
folder. Step 2: By using script task get the column name from text file
and create the tables in you database. Keep the table name in the SSIS
variable. Step 3: Choose any destination task and insert the data into the
newly created tables.
I used foreach loop container and selected the path of text files .in step
2 am unable to write the script for the column import .i have couple of
text files named employee having columns id ,name and another one
department having deptno ,location . Actually am a beginner to sql server
and ssis too.can anyone knows please help me
Q: I have multiple text files in a folder named xyz, and i have created a
new database in sqlserver which does not having any tables .Here my
problem is to import all those text files into new database according to
the text file named tables using ssis package .can anyone knows please
tell me the steps.
A: Step 1: Use foraech loop iterator to pick all files in the specific
folder. Step 2: By using script task get the column name from text file
and create the tables in you database. Keep the table name in the SSIS
variable. Step 3: Choose any destination task and insert the data into the
newly created tables.
I used foreach loop container and selected the path of text files .in step
2 am unable to write the script for the column import .i have couple of
text files named employee having columns id ,name and another one
department having deptno ,location . Actually am a beginner to sql server
and ssis too.can anyone knows please help me
source folders not visible in Netbeans project after installing jRebel plugin?
source folders not visible in Netbeans project after installing jRebel
plugin?
I installed jRebel on Netbeans and this made all my source folders an
libraries to disappear from my projects - except Maven ones. Like this:
The source folders are still present on my drive:
I just need to restore their visibility in my opened Netbeans projects.
When I try to add source packages from the "Properties" menu of the
project, I do get the source back but as folders, not packages.
Help would be much appreciated!
plugin?
I installed jRebel on Netbeans and this made all my source folders an
libraries to disappear from my projects - except Maven ones. Like this:
The source folders are still present on my drive:
I just need to restore their visibility in my opened Netbeans projects.
When I try to add source packages from the "Properties" menu of the
project, I do get the source back but as folders, not packages.
Help would be much appreciated!
node.js module or require.js
node.js module or require.js
i wonna programming web app and using express.js as webframework. As
testing framework i will use mocha and chai.
Node.js support modular programming, i can load module with require like
require("mocha"). On frontend i use require.js for organize my codes in
module, but this can be use in node.js to. It it better to use require.js
in node.js or better to use node.js standard module.
I know that require.js support AMD and testing codes with mocha it can
comlicated, because the codes will be load asynchronously.
Node.js require or require.js for module loading?
i wonna programming web app and using express.js as webframework. As
testing framework i will use mocha and chai.
Node.js support modular programming, i can load module with require like
require("mocha"). On frontend i use require.js for organize my codes in
module, but this can be use in node.js to. It it better to use require.js
in node.js or better to use node.js standard module.
I know that require.js support AMD and testing codes with mocha it can
comlicated, because the codes will be load asynchronously.
Node.js require or require.js for module loading?
Tuesday, 17 September 2013
How to make navPreNext button visible in layer slider responsive?
How to make navPreNext button visible in layer slider responsive?
I am trying to using layer slider responsive provide by js . IN short I am
using layer slider and unable to show next and prev button on the slider.
Below is my code
<script type="text/javascript">
// jQuery $('document').ready(); function
// Calling LayerSlider on your selected element after the document loaded
$('document').ready(function(){
$('#layerslider').layerSlider({
responsive: false,
autoStart : true,
navPrevNext: true,
skin : 'default'
});
});
</script>
HTML
<div id="layerslider" style="width: 1404px; height: 404px;">
<div class="ls-layer">
<img class="ls-bg" src="../img/image-slider-1(small).png"
alt="layer1-background">
</div>
</div>
I am trying to using layer slider responsive provide by js . IN short I am
using layer slider and unable to show next and prev button on the slider.
Below is my code
<script type="text/javascript">
// jQuery $('document').ready(); function
// Calling LayerSlider on your selected element after the document loaded
$('document').ready(function(){
$('#layerslider').layerSlider({
responsive: false,
autoStart : true,
navPrevNext: true,
skin : 'default'
});
});
</script>
HTML
<div id="layerslider" style="width: 1404px; height: 404px;">
<div class="ls-layer">
<img class="ls-bg" src="../img/image-slider-1(small).png"
alt="layer1-background">
</div>
</div>
SQLite (and Android, sorry to be a cleche) is `in` a valid column name?
SQLite (and Android, sorry to be a cleche) is `in` a valid column name?
it's a short one, I've spent 10 minutes checking spellings and such but I
cannot find an error!
So I am wondering is "in" a valid column name in SQLite? I usually use
MariaDB (MySQL but with that old spirit and no Oracle) and provided one
escapes/uses statements properly all is usually well.
09-18 03:15:27.892: E/SQLiteLog(30043): (1) near "in": syntax error
09-18 03:15:27.892: E/SQLiteDatabase(30043): Error inserting state=1
time=1378810407
reading=13964 in=0
09-18 03:15:27.892: E/SQLiteDatabase(30043):
android.database.sqlite.SQLiteException:
near "in": syntax error (code 1): , while compiling: INSERT INTO
Readings(state,time,reading,in) VALUES (?,?,?,?)
Helpful right?
-- Describe READINGS
CREATE TABLE "Readings" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"reading" INTEGER,
"in" INTEGER,
"time" INTEGER,
"state" INTEGER
)
Use:
ContentValues values = new ContentValues();
values.put("reading", reading.asInt());
values.put("in", in.asInt());
values.put("state",State.OKAY.ordinal());
values.put("time", time.getTimestamp());
return (int) db.insert("Readings", null, values);
In is actually 0 btw, I have a whole heap of errors, some with different
in values. There are no type errors or silenced exceptions.
I did want to put "just a short one" but then I thought "No, they'll want
more" so sorry "it's a short one" turned out to be a lie.
Please do help, I didn't expect any errors, and I am not even sure what's
wrong.
it's a short one, I've spent 10 minutes checking spellings and such but I
cannot find an error!
So I am wondering is "in" a valid column name in SQLite? I usually use
MariaDB (MySQL but with that old spirit and no Oracle) and provided one
escapes/uses statements properly all is usually well.
09-18 03:15:27.892: E/SQLiteLog(30043): (1) near "in": syntax error
09-18 03:15:27.892: E/SQLiteDatabase(30043): Error inserting state=1
time=1378810407
reading=13964 in=0
09-18 03:15:27.892: E/SQLiteDatabase(30043):
android.database.sqlite.SQLiteException:
near "in": syntax error (code 1): , while compiling: INSERT INTO
Readings(state,time,reading,in) VALUES (?,?,?,?)
Helpful right?
-- Describe READINGS
CREATE TABLE "Readings" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"reading" INTEGER,
"in" INTEGER,
"time" INTEGER,
"state" INTEGER
)
Use:
ContentValues values = new ContentValues();
values.put("reading", reading.asInt());
values.put("in", in.asInt());
values.put("state",State.OKAY.ordinal());
values.put("time", time.getTimestamp());
return (int) db.insert("Readings", null, values);
In is actually 0 btw, I have a whole heap of errors, some with different
in values. There are no type errors or silenced exceptions.
I did want to put "just a short one" but then I thought "No, they'll want
more" so sorry "it's a short one" turned out to be a lie.
Please do help, I didn't expect any errors, and I am not even sure what's
wrong.
Load content over ajax by click and onload?
Load content over ajax by click and onload?
I have a page where I have a menu that makes an ajax call when clicking
and it loads content in a div with a little animation with the footer. (as
can be seen here: http://perishablepress.com/slide-fade-content/ I'm
wondering if there is a way to have the first menu item to be loaded
already when opening the page. My code:
<ul>
<li><a class="blog" href="#blog">Blog</a></li>
<li><a class="contact" href="#contact">Contact</a></li>
</ul>
and the script:
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>jQuery(document).ready(function($) {
$('.blog').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'200px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('blog.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' }); }); }); }); });
jQuery(document).ready(function($) {
$('.contact').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'600px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('contact.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' });
});
});
});
});
So now I have to click "blog" or "contact" to have the content load, but
I'd like to have "blog" loaded as default when opening the page!
And also: Is there a way to have not only the content, but also another
version of jquery loaded, let's say when I click "contact" and my contact
form works with another jquery version.
I hope somebody can help a super-noob like me! Thanks lot in advance!
I have a page where I have a menu that makes an ajax call when clicking
and it loads content in a div with a little animation with the footer. (as
can be seen here: http://perishablepress.com/slide-fade-content/ I'm
wondering if there is a way to have the first menu item to be loaded
already when opening the page. My code:
<ul>
<li><a class="blog" href="#blog">Blog</a></li>
<li><a class="contact" href="#contact">Contact</a></li>
</ul>
and the script:
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>jQuery(document).ready(function($) {
$('.blog').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'200px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('blog.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' }); }); }); }); });
jQuery(document).ready(function($) {
$('.contact').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'600px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('contact.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' });
});
});
});
});
So now I have to click "blog" or "contact" to have the content load, but
I'd like to have "blog" loaded as default when opening the page!
And also: Is there a way to have not only the content, but also another
version of jquery loaded, let's say when I click "contact" and my contact
form works with another jquery version.
I hope somebody can help a super-noob like me! Thanks lot in advance!
Need to download a very large amount of data from a database through a web service
Need to download a very large amount of data from a database through a web
service
I need to create an action that downloads certain records from my database
as a text file. The code below works fine for a toy example (few records).
When this code is pushed to production it turns out I run out of memory.
Amount of data I deal with is in order of Gbs
public FileResult Streammer()
{
MemoryStream file = new MemoryStream();
using (var db = new DbMapper())
{
while (true)
{
List<Record> records = db.GetNext(10000);
if (records == null)
break;
foreach (Record r in records)
{
byte[] data = r.GetBytes();
file.Write(data, 0, data.Length);
}
}
}
file.Position = 0;
return new FileStreamResult(file, "text") { FileDownloadName =
"junk.txt" };
}
Ideally, I would like to read chunks of records from the DB on the server.
As a single chunk is read it is immediately converted and streamed to a
client. The client would should a standard download indicator without
actually indicating the remaining time/size.
Any recommendations would be greatly appreciated.
service
I need to create an action that downloads certain records from my database
as a text file. The code below works fine for a toy example (few records).
When this code is pushed to production it turns out I run out of memory.
Amount of data I deal with is in order of Gbs
public FileResult Streammer()
{
MemoryStream file = new MemoryStream();
using (var db = new DbMapper())
{
while (true)
{
List<Record> records = db.GetNext(10000);
if (records == null)
break;
foreach (Record r in records)
{
byte[] data = r.GetBytes();
file.Write(data, 0, data.Length);
}
}
}
file.Position = 0;
return new FileStreamResult(file, "text") { FileDownloadName =
"junk.txt" };
}
Ideally, I would like to read chunks of records from the DB on the server.
As a single chunk is read it is immediately converted and streamed to a
client. The client would should a standard download indicator without
actually indicating the remaining time/size.
Any recommendations would be greatly appreciated.
Kendo UI grid popup edit custom template - calling function from input checkbox - chrome issue
Kendo UI grid popup edit custom template - calling function from input
checkbox - chrome issue
I'm using a custom edit popup template:
editable: { mode: "popup",
template: $("#popup_editor").html()
},
i have a checkbox that in the template that is not part of the grid fields:
<!-- popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
<input type="checkbox" name="MakeTemplate" onclick="checkMakeTemplate()"/>
</script>
the checkMakeTemplate() fires fine in ie but in Chrome it gives me a
"Uncaught ReferenceError: MakeTemplate is not defined"
Any help would be appreciated.
checkbox - chrome issue
I'm using a custom edit popup template:
editable: { mode: "popup",
template: $("#popup_editor").html()
},
i have a checkbox that in the template that is not part of the grid fields:
<!-- popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
<input type="checkbox" name="MakeTemplate" onclick="checkMakeTemplate()"/>
</script>
the checkMakeTemplate() fires fine in ie but in Chrome it gives me a
"Uncaught ReferenceError: MakeTemplate is not defined"
Any help would be appreciated.
get a value with a jquery for loop
get a value with a jquery for loop
I am trying to get a attr from a href which is in a PHP while loop. So I
did a for loop to do it but it seems to only get the first href attr.
for (var i = 0; i < check; i++)
{
var id = $(".id").attr('href');
console.log(id);
}
Check is equal to the number of columns in the database depends a special
id. In this case check = 3
The link is: echo '<a id="dislike" class="btn-primary btn pull-right id"
href="'.$items['id'].'">Dislike</a>';
Any idea of why it doesn't work ?
I am trying to get a attr from a href which is in a PHP while loop. So I
did a for loop to do it but it seems to only get the first href attr.
for (var i = 0; i < check; i++)
{
var id = $(".id").attr('href');
console.log(id);
}
Check is equal to the number of columns in the database depends a special
id. In this case check = 3
The link is: echo '<a id="dislike" class="btn-primary btn pull-right id"
href="'.$items['id'].'">Dislike</a>';
Any idea of why it doesn't work ?
Sunday, 15 September 2013
entity class not found: mappings.EmployeeMaster (Jasper + Hibernate)
entity class not found: mappings.EmployeeMaster (Jasper + Hibernate)
i'm trying to create a jasper with hibernate connection as demonstrated in
the tutorial
http://www.tutorialcenters.com/index.php/how-to-design-report-using-jasperreport-hibernate-connection/,
i did exactly as specified in the tutorial but when i'm getting entity
class not found: mappings.EmployeeMaster
can anyone please tell me some solution for this....
my samplehiber project structure in netbeans IDE
Setting Classpath
Connection setup with MySQL Database using hibernate Configuration
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property
name="hibernate.connection.url">jdbc:mysql://localhost:3306/hse</property>
<property name="hibernate.connection.username">root</property>
<mapping resource="mappings/EmployeeMaster.hbm.xml"/>
</session-factory>
</hibernate-configuration>
hibernate.reveng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate
Reverse Engineering DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<schema-selection match-catalog="hse"/>
<table-filter match-name="employee_master"/>
</hibernate-reverse-engineering>
EmployeeMaster.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 15, 2013 11:07:05 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping >
<class name="mappings.EmployeeMaster" table="employee_master"
catalog="hse">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="userCode" type="string">
<column name="user_code" length="60" not-null="true"
unique="true" />
</property>
<property name="firstName" type="string">
<column name="first_name" length="60" />
</property>
<property name="lastName" type="string">
<column name="last_name" length="60" />
</property>
<property name="deptId" type="java.lang.Integer">
<column name="dept_id" />
</property>
<property name="designationId" type="java.lang.Integer">
<column name="designation_id" />
</property>
<property name="empEmail" type="string">
<column name="emp_email" length="60" />
</property>
<property name="status" type="string">
<column name="status" length="20" />
</property>
<property name="createdDate" type="timestamp">
<column name="created_date" length="19" />
</property>
<property name="modifiedDate" type="timestamp">
<column name="modified_date" length="19" />
</property>
</class>
</hibernate-mapping>
IDE Log
org.hibernate.MappingException: entity class not found:
mappings.EmployeeMaster
at
org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:122)
at
org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191)
at
org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:147)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
at
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at
com.jaspersoft.ireport.designer.connection.JRHibernateConnection.getSessionFactory(JRHibernateConnection.java:130)
at
com.jaspersoft.ireport.designer.connection.JRHibernateConnection$1.run(JRHibernateConnection.java:157)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1013)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.jButtonNewParameterActionPerformed(ConnectionsDialog.java:578)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.access$400(ConnectionsDialog.java:47)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog$7.actionPerformed(ConnectionsDialog.java:221)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1013)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.setVisible(ConnectionsDialog.java:651)
at
com.jaspersoft.ireport.designer.menu.DatasourcesAction.performAction(DatasourcesAction.java:46)
at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118)
at
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at
org.openide.awt.ToolbarButton.processMouseEvent(ToolbarButton.java:61)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: mappings.EmployeeMaster
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
at
org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:119)
... 123 more
i'm trying to create a jasper with hibernate connection as demonstrated in
the tutorial
http://www.tutorialcenters.com/index.php/how-to-design-report-using-jasperreport-hibernate-connection/,
i did exactly as specified in the tutorial but when i'm getting entity
class not found: mappings.EmployeeMaster
can anyone please tell me some solution for this....
my samplehiber project structure in netbeans IDE
Setting Classpath
Connection setup with MySQL Database using hibernate Configuration
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property
name="hibernate.connection.url">jdbc:mysql://localhost:3306/hse</property>
<property name="hibernate.connection.username">root</property>
<mapping resource="mappings/EmployeeMaster.hbm.xml"/>
</session-factory>
</hibernate-configuration>
hibernate.reveng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate
Reverse Engineering DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<schema-selection match-catalog="hse"/>
<table-filter match-name="employee_master"/>
</hibernate-reverse-engineering>
EmployeeMaster.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 15, 2013 11:07:05 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping >
<class name="mappings.EmployeeMaster" table="employee_master"
catalog="hse">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="identity" />
</id>
<property name="userCode" type="string">
<column name="user_code" length="60" not-null="true"
unique="true" />
</property>
<property name="firstName" type="string">
<column name="first_name" length="60" />
</property>
<property name="lastName" type="string">
<column name="last_name" length="60" />
</property>
<property name="deptId" type="java.lang.Integer">
<column name="dept_id" />
</property>
<property name="designationId" type="java.lang.Integer">
<column name="designation_id" />
</property>
<property name="empEmail" type="string">
<column name="emp_email" length="60" />
</property>
<property name="status" type="string">
<column name="status" length="20" />
</property>
<property name="createdDate" type="timestamp">
<column name="created_date" length="19" />
</property>
<property name="modifiedDate" type="timestamp">
<column name="modified_date" length="19" />
</property>
</class>
</hibernate-mapping>
IDE Log
org.hibernate.MappingException: entity class not found:
mappings.EmployeeMaster
at
org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:122)
at
org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191)
at
org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:147)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:457)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
at
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at
com.jaspersoft.ireport.designer.connection.JRHibernateConnection.getSessionFactory(JRHibernateConnection.java:130)
at
com.jaspersoft.ireport.designer.connection.JRHibernateConnection$1.run(JRHibernateConnection.java:157)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1013)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.jButtonNewParameterActionPerformed(ConnectionsDialog.java:578)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.access$400(ConnectionsDialog.java:47)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog$7.actionPerformed(ConnectionsDialog.java:221)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1013)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at
com.jaspersoft.ireport.designer.connection.gui.ConnectionsDialog.setVisible(ConnectionsDialog.java:651)
at
com.jaspersoft.ireport.designer.menu.DatasourcesAction.performAction(DatasourcesAction.java:46)
at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118)
at
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at
org.openide.awt.ToolbarButton.processMouseEvent(ToolbarButton.java:61)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: mappings.EmployeeMaster
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:252)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at
org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
at
org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:119)
... 123 more
some features to my website
some features to my website
I'm trying to add some features into the site I am building. Does anyone
know how I create something that looks like this: (attached file)
Many thanks for the helpers.
I'm trying to add some features into the site I am building. Does anyone
know how I create something that looks like this: (attached file)
Many thanks for the helpers.
What type is a function name in C?
What type is a function name in C?
I always understood that in C, func and &func were equivalent. I assume
they should both be of type pointer, which is 8 bytes on my Win64 system.
However, I just tried this:
#include <stdio.h>
int func(int x, int y)
{
printf("hello\n");
}
int main()
{
printf("%d, %d\n", sizeof(&func), sizeof(func));
return 0;
}
And expecting to get the output 8, 8 was surprised to get 8, 1 instead.
Why is this? What type exactly is func? It seems to be of type char or
some equivalent.
What is going on here?
I compiled this with gcc -std=c99 if it makes a difference.
I always understood that in C, func and &func were equivalent. I assume
they should both be of type pointer, which is 8 bytes on my Win64 system.
However, I just tried this:
#include <stdio.h>
int func(int x, int y)
{
printf("hello\n");
}
int main()
{
printf("%d, %d\n", sizeof(&func), sizeof(func));
return 0;
}
And expecting to get the output 8, 8 was surprised to get 8, 1 instead.
Why is this? What type exactly is func? It seems to be of type char or
some equivalent.
What is going on here?
I compiled this with gcc -std=c99 if it makes a difference.
Can i Use $.Post inside Document.READY() function in jquery
Can i Use $.Post inside Document.READY() function in jquery
i am trying to implement Jquery AJAX in my asp.net page. Where should i
place my $.post or $.ajax in my script.
i am trying to implement Jquery AJAX in my asp.net page. Where should i
place my $.post or $.ajax in my script.
Align image and text within same cell vertically?
Align image and text within same cell vertically?
I have a small 2x2 HTML table. Each cell contains one image and one piece
of text.
Example image:
As you can see, the text is vertically below the vertically middle level
of the image. How can I make the text vertically in the center, relative
to the image on the left ?
I have tried a several different display values, which I can't fix this.
JSFiddle: http://jsfiddle.net/ahmadka/rbJNQ/
I have a small 2x2 HTML table. Each cell contains one image and one piece
of text.
Example image:
As you can see, the text is vertically below the vertically middle level
of the image. How can I make the text vertically in the center, relative
to the image on the left ?
I have tried a several different display values, which I can't fix this.
JSFiddle: http://jsfiddle.net/ahmadka/rbJNQ/
i got an error when click search button
i got an error when click search button
when click search button it gives me this error (incorrect syntax near
'43') 43 is the area id, i make sure that the area id is the same in all
tables and gov id is the same too, here is the code i use
protected void Button1_Click(object sender, EventArgs e) {
//Page.RegisterStartupScript("open", "<script
language=javascript>alert('dd')</script>");
// Session["conection"] = "Data Source=MEDICONSULT;Initial
Catalog=test;Integrated Security=True";
Session["conection"] = "Data Source=MEDICONSULT;Initial
Catalog=test1;Integrated Security=True";
SqlConnection connection = new
SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString);
connection.Open();
SqlCommand command = new SqlCommand();
connection = new SqlConnection((string)Session["conection"]);
connection.Open();
SqlDataAdapter da_1 = new SqlDataAdapter(command);
da_1 = new SqlDataAdapter();
command = new SqlCommand();
command.Connection = connection;
string sql1 = "select Address1,provname from sites where cat_id=2";
if (addressTextBox.Text != "")
{
sql1 = "SELECT provname,address1,LAT,LONG FROM site where cat_id=2
and provname like '%'+@provname+'%'";
SqlParameter search = new SqlParameter();
search.ParameterName = "@provname";
search.Value = addressTextBox.Text.Trim();
command.Parameters.Add(search);
}
if (DropDownList1.SelectedValue != "0")
{
sql1 = " SELECT area, address1, provname FROM sites WHERE cat_id=2
and gov_id='" + DropDownList1.SelectedValue + "'";
}
if (DropDownList2.SelectedValue != "0" && DropDownList1.SelectedValue
!= "0")
{
sql1 = "SELECT area, address1,provname FROM sites WHERE cat_id=2
and gov_id='" + DropDownList1.SelectedValue + "and area_id='" +
DropDownList2.SelectedValue;
}
command.CommandText = sql1;
da_1.SelectCommand = command;
ds_1 = new DataSet();
da_1.Fill(ds_1, "sites");
searchResults.DataSource = ds_1;
searchResults.DataBind();
Label1.Text = ds_1.Tables[0].Rows.Count > 0 ?
ds_1.Tables[0].Rows.Count.ToString() : "áÇ íæÌÏ äÊÇÆÌ ãä ÇáÈÍË ÇáÐí
ÇÏÎáÊå";
when click search button it gives me this error (incorrect syntax near
'43') 43 is the area id, i make sure that the area id is the same in all
tables and gov id is the same too, here is the code i use
protected void Button1_Click(object sender, EventArgs e) {
//Page.RegisterStartupScript("open", "<script
language=javascript>alert('dd')</script>");
// Session["conection"] = "Data Source=MEDICONSULT;Initial
Catalog=test;Integrated Security=True";
Session["conection"] = "Data Source=MEDICONSULT;Initial
Catalog=test1;Integrated Security=True";
SqlConnection connection = new
SqlConnection(ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString);
connection.Open();
SqlCommand command = new SqlCommand();
connection = new SqlConnection((string)Session["conection"]);
connection.Open();
SqlDataAdapter da_1 = new SqlDataAdapter(command);
da_1 = new SqlDataAdapter();
command = new SqlCommand();
command.Connection = connection;
string sql1 = "select Address1,provname from sites where cat_id=2";
if (addressTextBox.Text != "")
{
sql1 = "SELECT provname,address1,LAT,LONG FROM site where cat_id=2
and provname like '%'+@provname+'%'";
SqlParameter search = new SqlParameter();
search.ParameterName = "@provname";
search.Value = addressTextBox.Text.Trim();
command.Parameters.Add(search);
}
if (DropDownList1.SelectedValue != "0")
{
sql1 = " SELECT area, address1, provname FROM sites WHERE cat_id=2
and gov_id='" + DropDownList1.SelectedValue + "'";
}
if (DropDownList2.SelectedValue != "0" && DropDownList1.SelectedValue
!= "0")
{
sql1 = "SELECT area, address1,provname FROM sites WHERE cat_id=2
and gov_id='" + DropDownList1.SelectedValue + "and area_id='" +
DropDownList2.SelectedValue;
}
command.CommandText = sql1;
da_1.SelectCommand = command;
ds_1 = new DataSet();
da_1.Fill(ds_1, "sites");
searchResults.DataSource = ds_1;
searchResults.DataBind();
Label1.Text = ds_1.Tables[0].Rows.Count > 0 ?
ds_1.Tables[0].Rows.Count.ToString() : "áÇ íæÌÏ äÊÇÆÌ ãä ÇáÈÍË ÇáÐí
ÇÏÎáÊå";
Run .NET 2.0 application in Windows 8 x64
Run .NET 2.0 application in Windows 8 x64
i make program in visual studio 2005 and NeFramWork 2.0 . this program run
in windows 7 64 bit ,but not in windows 8 64 bit although i run the as
administrator so please help me
i make program in visual studio 2005 and NeFramWork 2.0 . this program run
in windows 7 64 bit ,but not in windows 8 64 bit although i run the as
administrator so please help me
Saturday, 14 September 2013
C# - How to get/set an object's property value without using Reflection
C# - How to get/set an object's property value without using Reflection
I need to be able to store a reference to an object's property in order to
read/write it later, ideally without using reflection. I'm also open to a
design pattern that works too, but performance is paramount as my
application will be making millions of calls to "run" on various "Parent"
classes. The code template below should explain what I'm trying to do.
Also, one more requirement, I'd like to keep it such that the variables I
am "requiring" are object properties of the Child class, and not data
structures stored in some list, for example.
Thank you.
class requiredAttribute : Attribute
{
}
abstract class Parent
{
abstract protected void _run();
public Parent() {
// This can do whatever set-up is necessary in order to make the
below run() call
// not need reflection.
/* What code goes here? */
}
public void run() {
// This code should reset all 'required' properties to null.
/* What goes here? */
_run();
// This code needs to ensure any required property is now not null.
// If it finds a null one, it should throw.
/* What goes here? */
}
}
class Child : Parent
{
[required]
protected object value1;
[required]
protected object value2;
// not required..
protected object value3;
protected void _run() {
// This must set all 'required' properties' values, otherwise the
Parent should throw.
value1 = "some value";
value2 = "some other value";
}
}
I need to be able to store a reference to an object's property in order to
read/write it later, ideally without using reflection. I'm also open to a
design pattern that works too, but performance is paramount as my
application will be making millions of calls to "run" on various "Parent"
classes. The code template below should explain what I'm trying to do.
Also, one more requirement, I'd like to keep it such that the variables I
am "requiring" are object properties of the Child class, and not data
structures stored in some list, for example.
Thank you.
class requiredAttribute : Attribute
{
}
abstract class Parent
{
abstract protected void _run();
public Parent() {
// This can do whatever set-up is necessary in order to make the
below run() call
// not need reflection.
/* What code goes here? */
}
public void run() {
// This code should reset all 'required' properties to null.
/* What goes here? */
_run();
// This code needs to ensure any required property is now not null.
// If it finds a null one, it should throw.
/* What goes here? */
}
}
class Child : Parent
{
[required]
protected object value1;
[required]
protected object value2;
// not required..
protected object value3;
protected void _run() {
// This must set all 'required' properties' values, otherwise the
Parent should throw.
value1 = "some value";
value2 = "some other value";
}
}
Parsing .csv file into 2d array
Parsing .csv file into 2d array
I'm trying to parse a csv file into a 2d array in C#. I'm having a very
strang issue, here is my code:
string filePath = @"C:\Users\Matt\Desktop\Eve Spread
Sheet\Auto-Manufacture.csv";
StreamReader sr = new StreamReader(filePath);
data = null;
int Row = 0;
while (!sr.EndOfStream)
{
string[] Line = sr.ReadLine().Split(',');
if (Row == 0)
{
data = new string[Line.Length, Line.Length];
}
for (int column = 0; column < Line.Length; column++)
{
data[Row, column] = Line[column];
}
Row++;
Console.WriteLine(Row);
}
My .csv file has 87 rows, but there is a strange issue in the execution
where it will read the first 15 rows into the data array exactly as
expected but when it gets down to the data[Row, column] = Line[column];
line for the 16th time it seems to just break out of the entire
loop(without meeting the sr.EndOfStream condition) and not read any more
data into the data array. Can anyone explain what might be happeneing?
I'm trying to parse a csv file into a 2d array in C#. I'm having a very
strang issue, here is my code:
string filePath = @"C:\Users\Matt\Desktop\Eve Spread
Sheet\Auto-Manufacture.csv";
StreamReader sr = new StreamReader(filePath);
data = null;
int Row = 0;
while (!sr.EndOfStream)
{
string[] Line = sr.ReadLine().Split(',');
if (Row == 0)
{
data = new string[Line.Length, Line.Length];
}
for (int column = 0; column < Line.Length; column++)
{
data[Row, column] = Line[column];
}
Row++;
Console.WriteLine(Row);
}
My .csv file has 87 rows, but there is a strange issue in the execution
where it will read the first 15 rows into the data array exactly as
expected but when it gets down to the data[Row, column] = Line[column];
line for the 16th time it seems to just break out of the entire
loop(without meeting the sr.EndOfStream condition) and not read any more
data into the data array. Can anyone explain what might be happeneing?
Facebook Open Graph publish custom story only visible on "activity log"
Facebook Open Graph publish custom story only visible on "activity log"
I use Facebook Open Graph to publish custom story in my android app. I'v
created the story in the Facebook application console, with the custom
object and action, submitted it of review with "Explicit share" and got
approved. My problem is that I'm able to create the object, and create an
action using this object, but I only see the story on my activity log (and
also under "recent activities" on timeline) but no one else sees the story
and it does not look as I've created it. I use the "Explicitly Shared"
fled in the action, but nothing is shown. can someone help
I use Facebook Open Graph to publish custom story in my android app. I'v
created the story in the Facebook application console, with the custom
object and action, submitted it of review with "Explicit share" and got
approved. My problem is that I'm able to create the object, and create an
action using this object, but I only see the story on my activity log (and
also under "recent activities" on timeline) but no one else sees the story
and it does not look as I've created it. I use the "Explicitly Shared"
fled in the action, but nothing is shown. can someone help
Getting the value from MySQL to check radio buttons generates a notice
Getting the value from MySQL to check radio buttons generates a notice
I'm trying to set the "checked" status of a radio button based on the
value from the MySQL database. The main purpose of the code is to be a
"edit user profile data" script. I managed to get all information from the
database and everything gets edited as it should if the user choses to but
I can't seem to make the radio buttons work. I get the following message:
Notice: Use of undefined constant Male - assumed 'Male' in
C:\xampp\htdocs\Signup\user_panel.php on line 57
I checked SO for this notice but I couldn't find anything related to radio
buttons AND the notice.
This is the code:
<form action="includes/user_panel.php" method="POST">
<table>
<tr>
<td><label for="email"> E-mail </label></td>
<td><input type="email" name="email" id="email"
value="<?php echo "{$fetch['email']}"; ?>"></td>
</tr>
<tr>
<td><label for="first_name"> First name </label></td>
<td><input type="text" name="first_name"
id="first_name" value="<?php echo
"{$fetch['first_name']}"; ?>"></td>
</tr>
<tr>
<td><label for="last_name"> Last name </label></td>
<td><input type="text" name="last_name"
id="last_name" value="<?php echo
"{$fetch['last_name']}"; ?>"></td>
</tr>
<tr>
<td><label for="birthday"> Birthday </label></td>
<td><input type="date" name="birthday"
id="birthday" value="<?php echo
"{$fetch['birthday']}"; ?>"></td>
</tr>
<tr>
<td><label for="sex"> Sex </label></td>
<?php
if ($fetch['birthday'] = Male)
{
echo "<td><input type='radio' name='sex'
value='male' id='sex' checked> Male <input
type='radio' name='sex' value='female'
id='sex'> Female </td>";
}
else
{
echo "<td><input type='radio' name='sex'
value='male' id='sex'> Male <input
type='radio' name='sex' value='female'
id='sex' checked> Female </td>";
}
?>
</tr>
</table>
</br>
<input type="submit" name="edit_user" value="Edit"
class="button_1">
<input type="hidden" name="edit_user_data">
</form>
Additional information:
$initial_email = $_SESSION['email'];
$username = $_SESSION['username'];
$query_user_panel="SELECT * FROM users WHERE email = '$initial_email' OR
username= '$username'";
$result_user_panel=mysql_query($query_user_panel) or die (mysql_error());
$fetch = mysql_fetch_assoc($result_user_panel)
Line 57 is the one with the "if".
Scroll down the code and you'll see where the sex should get checked. I
tried with a "if" but that generates me the notice that I wrote.
I know that MySQL is depreciated and I should use MySQLi. If you have the
time please check this question as well: Simplest MySQL to MySQLi
transition
Thank you very much and please let me know if I need to edit my post or
provide with additional data.
I'm trying to set the "checked" status of a radio button based on the
value from the MySQL database. The main purpose of the code is to be a
"edit user profile data" script. I managed to get all information from the
database and everything gets edited as it should if the user choses to but
I can't seem to make the radio buttons work. I get the following message:
Notice: Use of undefined constant Male - assumed 'Male' in
C:\xampp\htdocs\Signup\user_panel.php on line 57
I checked SO for this notice but I couldn't find anything related to radio
buttons AND the notice.
This is the code:
<form action="includes/user_panel.php" method="POST">
<table>
<tr>
<td><label for="email"> E-mail </label></td>
<td><input type="email" name="email" id="email"
value="<?php echo "{$fetch['email']}"; ?>"></td>
</tr>
<tr>
<td><label for="first_name"> First name </label></td>
<td><input type="text" name="first_name"
id="first_name" value="<?php echo
"{$fetch['first_name']}"; ?>"></td>
</tr>
<tr>
<td><label for="last_name"> Last name </label></td>
<td><input type="text" name="last_name"
id="last_name" value="<?php echo
"{$fetch['last_name']}"; ?>"></td>
</tr>
<tr>
<td><label for="birthday"> Birthday </label></td>
<td><input type="date" name="birthday"
id="birthday" value="<?php echo
"{$fetch['birthday']}"; ?>"></td>
</tr>
<tr>
<td><label for="sex"> Sex </label></td>
<?php
if ($fetch['birthday'] = Male)
{
echo "<td><input type='radio' name='sex'
value='male' id='sex' checked> Male <input
type='radio' name='sex' value='female'
id='sex'> Female </td>";
}
else
{
echo "<td><input type='radio' name='sex'
value='male' id='sex'> Male <input
type='radio' name='sex' value='female'
id='sex' checked> Female </td>";
}
?>
</tr>
</table>
</br>
<input type="submit" name="edit_user" value="Edit"
class="button_1">
<input type="hidden" name="edit_user_data">
</form>
Additional information:
$initial_email = $_SESSION['email'];
$username = $_SESSION['username'];
$query_user_panel="SELECT * FROM users WHERE email = '$initial_email' OR
username= '$username'";
$result_user_panel=mysql_query($query_user_panel) or die (mysql_error());
$fetch = mysql_fetch_assoc($result_user_panel)
Line 57 is the one with the "if".
Scroll down the code and you'll see where the sex should get checked. I
tried with a "if" but that generates me the notice that I wrote.
I know that MySQL is depreciated and I should use MySQLi. If you have the
time please check this question as well: Simplest MySQL to MySQLi
transition
Thank you very much and please let me know if I need to edit my post or
provide with additional data.
What are the performance considerations if using $_SESSION in cakephp inspite of $this->Session
What are the performance considerations if using $_SESSION in cakephp
inspite of $this->Session
What are the performance considerations in CakePHP of directly accessing
$_SESSION['variableName'] instead of calling
$this->Session->read('variableName') to access session variables?
inspite of $this->Session
What are the performance considerations in CakePHP of directly accessing
$_SESSION['variableName'] instead of calling
$this->Session->read('variableName') to access session variables?
i ssue in avoiding user from entering empty string in ajax post
i ssue in avoiding user from entering empty string in ajax post
I have a jquery ajax post and when a user wirte and press enter in a
textbox this ajax triggers and show the value of text box in a <pre> html
element. http://jsfiddle.net/LQg7W/2133/ obviuosly this jsfiddledoes not
show anything because I sis not put the ajax post inside it. but when the
user writes Nothing and press enter this ajax is triggered and return
something. but how can I catch the empty strings from user?
This is located in my view:
if(e.keyCode == 13) {
var currentLine = $('#terminal').text();
var inputData = $(e.currentTarget).val();
$('#terminal').text(currentLine + "\r\n" + inputData +
"\r\n"); //show the current and previous value
$("#textInput").val(" $> ");
AjaxPost(inputData);
}
and this ajax post is in model:
AjaxPost : function(dataAttribute, view, cacheId) {
console.log(cacheId);
var that = this;
if(dataAttribute === ""){
view.showMessage( " " , true);
}
$.ajax({
type : "POST",
url : "/api/user" ,
datatype : "application/json",
contentType: " text/plain",
data : dataAttribute,
success : function(data) {
console.log(data);
},
error : function(error) {
},
my problem is that my input data has default value of "$>" so I cannot
check this condition if (inputdata === "" ) because it is always full!!
Have any idea?
I have a jquery ajax post and when a user wirte and press enter in a
textbox this ajax triggers and show the value of text box in a <pre> html
element. http://jsfiddle.net/LQg7W/2133/ obviuosly this jsfiddledoes not
show anything because I sis not put the ajax post inside it. but when the
user writes Nothing and press enter this ajax is triggered and return
something. but how can I catch the empty strings from user?
This is located in my view:
if(e.keyCode == 13) {
var currentLine = $('#terminal').text();
var inputData = $(e.currentTarget).val();
$('#terminal').text(currentLine + "\r\n" + inputData +
"\r\n"); //show the current and previous value
$("#textInput").val(" $> ");
AjaxPost(inputData);
}
and this ajax post is in model:
AjaxPost : function(dataAttribute, view, cacheId) {
console.log(cacheId);
var that = this;
if(dataAttribute === ""){
view.showMessage( " " , true);
}
$.ajax({
type : "POST",
url : "/api/user" ,
datatype : "application/json",
contentType: " text/plain",
data : dataAttribute,
success : function(data) {
console.log(data);
},
error : function(error) {
},
my problem is that my input data has default value of "$>" so I cannot
check this condition if (inputdata === "" ) because it is always full!!
Have any idea?
Friday, 13 September 2013
Best way to plan a database before designing
Best way to plan a database before designing
What are the disadvantages to have more number of columns in a table and
more number of rows in a table? in My sql...
I am talking about 292 columns in a single table. and 36 more like them in
a single database.
My website's front end is PHP and Back End is Mysql.
`id` int(11) NOT NULL AUTO_INCREMENT,
username varchar(55) NOT NULL, rollno varchar(15) NOT NULL, jan_tc_s1
varchar(5) DEFAULT NULL, jan_ac_s1 varchar(5) DEFAULT NULL, jan_s1_perce
varchar(5) DEFAULT NULL, feb_tc_s1 varchar(5) DEFAULT NULL, feb_ac_s1
varchar(5) DEFAULT NULL, feb_s1_perce varchar(5) DEFAULT NULL, mar_tc_s1
varchar(5) DEFAULT NULL, mar_ac_s1 varchar(5) DEFAULT NULL, mar_s1_perce
varchar(5) DEFAULT NULL, apr_tc_s1 varchar(5) DEFAULT NULL, apr_ac_s1
varchar(5) DEFAULT NULL, apr_s1_perce varchar(5) DEFAULT NULL, may_tc_s1
varchar(5) DEFAULT NULL, may_ac_s1 varchar(5) DEFAULT NULL, may_s1_perce
varchar(5) DEFAULT NULL, jun_tc_s1 varchar(5) DEFAULT NULL, jun_ac_s1
varchar(5) DEFAULT NULL, jun_s1_perce varchar(5) DEFAULT NULL, dec_tc_s1
varchar(5) DEFAULT NULL, dec_ac_s1 varchar(5) DEFAULT NULL, dec_s1_perce
varchar(5) DEFAULT NULL, s1_ia_att varchar(5) DEFAULT NULL, s1_t1
varchar(5) DEFAULT NULL, s1_t2 varchar(5) DEFAULT NULL, s1_t3 varchar(5)
DEFAULT NULL, s1_ia_tot varchar(5) DEFAULT NULL, jan_tc_s2 varchar(5)
DEFAULT NULL, jan_ac_s2 varchar(5) DEFAULT NULL, jan_s2_perce varchar(5)
DEFAULT NULL, feb_tc_s2 varchar(5) DEFAULT NULL, feb_ac_s2 varchar(5)
DEFAULT NULL, feb_s2_perce varchar(5) DEFAULT NULL, mar_tc_s2 varchar(5)
DEFAULT NULL, mar_ac_s2 varchar(5) DEFAULT NULL, mar_s2_perce varchar(5)
DEFAULT NULL, apr_tc_s2 varchar(5) DEFAULT NULL, apr_ac_s2 varchar(5)
DEFAULT NULL, apr_s2_perce varchar(5) DEFAULT NULL, may_tc_s2 varchar(5)
DEFAULT NULL, may_ac_s2 varchar(5) DEFAULT NULL, may_s2_perce varchar(5)
DEFAULT NULL, jun_tc_s2 varchar(5) DEFAULT NULL, jun_ac_s2 varchar(5)
DEFAULT NULL, jun_s2_perce varchar(5) DEFAULT NULL, dec_tc_s2 varchar(5)
DEFAULT NULL, dec_ac_s2 varchar(5) DEFAULT NULL, dec_s2_perce varchar(5)
DEFAULT NULL, s2_ia_att varchar(5) DEFAULT NULL, s2_t1 varchar(5) DEFAULT
NULL, s2_t2 varchar(5) DEFAULT NULL, s2_t3 varchar(5) DEFAULT NULL,
s2_ia_tot varchar(5) DEFAULT NULL, jan_tc_s3 varchar(5) DEFAULT NULL,
jan_ac_s3 varchar(5) DEFAULT NULL, jan_s3_perce varchar(5) DEFAULT NULL,
feb_tc_s3 varchar(5) DEFAULT NULL, feb_ac_s3 varchar(5) DEFAULT NULL,
feb_s3_perce varchar(5) DEFAULT NULL, mar_tc_s3 varchar(5) DEFAULT NULL,
mar_ac_s3 varchar(5) DEFAULT NULL, mar_s3_perce varchar(5) DEFAULT NULL,
apr_tc_s3 varchar(5) DEFAULT NULL, apr_ac_s3 varchar(5) DEFAULT NULL,
apr_s3_perce varchar(5) DEFAULT NULL, may_tc_s3 varchar(5) DEFAULT NULL,
may_ac_s3 varchar(5) DEFAULT NULL, may_s3_perce varchar(5) DEFAULT NULL,
jun_tc_s3 varchar(5) DEFAULT NULL, jun_ac_s3 varchar(5) DEFAULT NULL,
jun_s3_perce varchar(5) DEFAULT NULL, dec_tc_s3 varchar(5) DEFAULT NULL,
dec_ac_s3 varchar(5) DEFAULT NULL, dec_s3_perce varchar(5) DEFAULT NULL,
s3_ia_att varchar(5) DEFAULT NULL, s3_t1 varchar(5) DEFAULT NULL, s3_t2
varchar(5) DEFAULT NULL, s3_t3 varchar(5) DEFAULT NULL, s3_ia_tot
varchar(5) DEFAULT NULL, jan_tc_s4 varchar(5) DEFAULT NULL, jan_ac_s4
varchar(5) DEFAULT NULL, jan_s4_perce varchar(5) DEFAULT NULL, feb_tc_s4
varchar(5) DEFAULT NULL, feb_ac_s4 varchar(5) DEFAULT NULL, feb_s4_perce
varchar(5) DEFAULT NULL, mar_tc_s4 varchar(5) DEFAULT NULL, mar_ac_s4
varchar(5) DEFAULT NULL, mar_s4_perce varchar(5) DEFAULT NULL, apr_tc_s4
varchar(5) DEFAULT NULL, apr_ac_s4 varchar(5) DEFAULT NULL, apr_s4_perce
varchar(5) DEFAULT NULL, may_tc_s4 varchar(5) DEFAULT NULL, may_ac_s4
varchar(5) DEFAULT NULL, may_s4_perce varchar(5) DEFAULT NULL, jun_tc_s4
varchar(5) DEFAULT NULL, jun_ac_s4 varchar(5) DEFAULT NULL, jun_s4_perce
varchar(5) DEFAULT NULL, dec_tc_s4 varchar(5) DEFAULT NULL, dec_ac_s4
varchar(5) DEFAULT NULL, dec_s4_perce varchar(5) DEFAULT NULL, s4_ia_att
varchar(5) DEFAULT NULL, s4_t1 varchar(5) DEFAULT NULL, s4_t2 varchar(5)
DEFAULT NULL, s4_t3 varchar(5) DEFAULT NULL, s4_ia_tot varchar(5) DEFAULT
NULL, jan_tc_s5 varchar(5) DEFAULT NULL, jan_ac_s5 varchar(5) DEFAULT
NULL, jan_s5_perce varchar(5) DEFAULT NULL, feb_tc_s5 varchar(5) DEFAULT
NULL, feb_ac_s5 varchar(5) DEFAULT NULL, feb_s5_perce varchar(5) DEFAULT
NULL, mar_tc_s5 varchar(5) DEFAULT NULL, mar_ac_s5 varchar(5) DEFAULT
NULL, mar_s5_perce varchar(5) DEFAULT NULL, apr_tc_s5 varchar(5) DEFAULT
NULL, apr_ac_s5 varchar(5) DEFAULT NULL, apr_s5_perce varchar(5) DEFAULT
NULL, may_tc_s5 varchar(5) DEFAULT NULL, may_ac_s5 varchar(5) DEFAULT
NULL, may_s5_perce varchar(5) DEFAULT NULL, jun_tc_s5 varchar(5) DEFAULT
NULL, jun_ac_s5 varchar(5) DEFAULT NULL, jun_s5_perce varchar(5) DEFAULT
NULL, dec_tc_s5 varchar(5) DEFAULT NULL, dec_ac_s5 varchar(5) DEFAULT
NULL, dec_s5_perce varchar(5) DEFAULT NULL, s5_ia_att varchar(5) DEFAULT
NULL, s5_t1 varchar(5) DEFAULT NULL, s5_t2 varchar(5) DEFAULT NULL,
s5_ia_tot varchar(5) DEFAULT NULL, jan_tc_s6 varchar(5) DEFAULT NULL,
jan_ac_s6 varchar(5) DEFAULT NULL, jan_s6_perce varchar(5) DEFAULT NULL,
feb_tc_s6 varchar(5) DEFAULT NULL, feb_ac_s6 varchar(5) DEFAULT NULL,
feb_s6_perce varchar(5) DEFAULT NULL, mar_tc_s6 varchar(5) DEFAULT NULL,
mar_ac_s6 varchar(5) DEFAULT NULL, mar_s6_perce varchar(5) DEFAULT NULL,
apr_tc_s6 varchar(5) DEFAULT NULL, apr_ac_s6 varchar(5) DEFAULT NULL,
apr_s6_perce varchar(5) DEFAULT NULL, may_tc_s6 varchar(5) DEFAULT NULL,
may_ac_s6 varchar(5) DEFAULT NULL, may_s6_perce varchar(5) DEFAULT NULL,
jun_tc_s6 varchar(5) DEFAULT NULL, jun_ac_s6 varchar(5) DEFAULT NULL,
jun_s6_perce varchar(5) DEFAULT NULL, dec_tc_s6 varchar(5) DEFAULT NULL,
dec_ac_s6 varchar(5) DEFAULT NULL, dec_s6_perce varchar(5) DEFAULT NULL,
s6_ia_att varchar(5) DEFAULT NULL, s6_t1 varchar(5) DEFAULT NULL, s6_t2
varchar(5) DEFAULT NULL, s6_ia_tot varchar(5) DEFAULT NULL, jan_tc_s7
varchar(5) DEFAULT NULL, jan_ac_s7 varchar(5) DEFAULT NULL, jan_s7_perce
varchar(5) DEFAULT NULL, feb_tc_s7 varchar(5) DEFAULT NULL, feb_ac_s7
varchar(5) DEFAULT NULL, feb_s7_perce varchar(5) DEFAULT NULL, mar_tc_s7
varchar(5) DEFAULT NULL, mar_ac_s7 varchar(5) DEFAULT NULL, mar_s7_perce
varchar(5) DEFAULT NULL, apr_tc_s7 varchar(5) DEFAULT NULL, apr_ac_s7
varchar(5) DEFAULT NULL, apr_s7_perce varchar(5) DEFAULT NULL, may_tc_s7
varchar(5) DEFAULT NULL, may_ac_s7 varchar(5) DEFAULT NULL, may_s7_perce
varchar(5) DEFAULT NULL, jun_tc_s7 varchar(5) DEFAULT NULL, jun_ac_s7
varchar(5) DEFAULT NULL, jun_s7_perce varchar(5) DEFAULT NULL, dec_tc_s7
varchar(5) DEFAULT NULL, dec_ac_s7 varchar(5) DEFAULT NULL, dec_s7_perce
varchar(5) DEFAULT NULL, s7_ia_att varchar(5) DEFAULT NULL, s7_t1
varchar(5) DEFAULT NULL, s7_t2 varchar(5) DEFAULT NULL, s7_ia_tot
varchar(5) DEFAULT NULL,
What are the disadvantages to have more number of columns in a table and
more number of rows in a table? in My sql...
I am talking about 292 columns in a single table. and 36 more like them in
a single database.
My website's front end is PHP and Back End is Mysql.
`id` int(11) NOT NULL AUTO_INCREMENT,
username varchar(55) NOT NULL, rollno varchar(15) NOT NULL, jan_tc_s1
varchar(5) DEFAULT NULL, jan_ac_s1 varchar(5) DEFAULT NULL, jan_s1_perce
varchar(5) DEFAULT NULL, feb_tc_s1 varchar(5) DEFAULT NULL, feb_ac_s1
varchar(5) DEFAULT NULL, feb_s1_perce varchar(5) DEFAULT NULL, mar_tc_s1
varchar(5) DEFAULT NULL, mar_ac_s1 varchar(5) DEFAULT NULL, mar_s1_perce
varchar(5) DEFAULT NULL, apr_tc_s1 varchar(5) DEFAULT NULL, apr_ac_s1
varchar(5) DEFAULT NULL, apr_s1_perce varchar(5) DEFAULT NULL, may_tc_s1
varchar(5) DEFAULT NULL, may_ac_s1 varchar(5) DEFAULT NULL, may_s1_perce
varchar(5) DEFAULT NULL, jun_tc_s1 varchar(5) DEFAULT NULL, jun_ac_s1
varchar(5) DEFAULT NULL, jun_s1_perce varchar(5) DEFAULT NULL, dec_tc_s1
varchar(5) DEFAULT NULL, dec_ac_s1 varchar(5) DEFAULT NULL, dec_s1_perce
varchar(5) DEFAULT NULL, s1_ia_att varchar(5) DEFAULT NULL, s1_t1
varchar(5) DEFAULT NULL, s1_t2 varchar(5) DEFAULT NULL, s1_t3 varchar(5)
DEFAULT NULL, s1_ia_tot varchar(5) DEFAULT NULL, jan_tc_s2 varchar(5)
DEFAULT NULL, jan_ac_s2 varchar(5) DEFAULT NULL, jan_s2_perce varchar(5)
DEFAULT NULL, feb_tc_s2 varchar(5) DEFAULT NULL, feb_ac_s2 varchar(5)
DEFAULT NULL, feb_s2_perce varchar(5) DEFAULT NULL, mar_tc_s2 varchar(5)
DEFAULT NULL, mar_ac_s2 varchar(5) DEFAULT NULL, mar_s2_perce varchar(5)
DEFAULT NULL, apr_tc_s2 varchar(5) DEFAULT NULL, apr_ac_s2 varchar(5)
DEFAULT NULL, apr_s2_perce varchar(5) DEFAULT NULL, may_tc_s2 varchar(5)
DEFAULT NULL, may_ac_s2 varchar(5) DEFAULT NULL, may_s2_perce varchar(5)
DEFAULT NULL, jun_tc_s2 varchar(5) DEFAULT NULL, jun_ac_s2 varchar(5)
DEFAULT NULL, jun_s2_perce varchar(5) DEFAULT NULL, dec_tc_s2 varchar(5)
DEFAULT NULL, dec_ac_s2 varchar(5) DEFAULT NULL, dec_s2_perce varchar(5)
DEFAULT NULL, s2_ia_att varchar(5) DEFAULT NULL, s2_t1 varchar(5) DEFAULT
NULL, s2_t2 varchar(5) DEFAULT NULL, s2_t3 varchar(5) DEFAULT NULL,
s2_ia_tot varchar(5) DEFAULT NULL, jan_tc_s3 varchar(5) DEFAULT NULL,
jan_ac_s3 varchar(5) DEFAULT NULL, jan_s3_perce varchar(5) DEFAULT NULL,
feb_tc_s3 varchar(5) DEFAULT NULL, feb_ac_s3 varchar(5) DEFAULT NULL,
feb_s3_perce varchar(5) DEFAULT NULL, mar_tc_s3 varchar(5) DEFAULT NULL,
mar_ac_s3 varchar(5) DEFAULT NULL, mar_s3_perce varchar(5) DEFAULT NULL,
apr_tc_s3 varchar(5) DEFAULT NULL, apr_ac_s3 varchar(5) DEFAULT NULL,
apr_s3_perce varchar(5) DEFAULT NULL, may_tc_s3 varchar(5) DEFAULT NULL,
may_ac_s3 varchar(5) DEFAULT NULL, may_s3_perce varchar(5) DEFAULT NULL,
jun_tc_s3 varchar(5) DEFAULT NULL, jun_ac_s3 varchar(5) DEFAULT NULL,
jun_s3_perce varchar(5) DEFAULT NULL, dec_tc_s3 varchar(5) DEFAULT NULL,
dec_ac_s3 varchar(5) DEFAULT NULL, dec_s3_perce varchar(5) DEFAULT NULL,
s3_ia_att varchar(5) DEFAULT NULL, s3_t1 varchar(5) DEFAULT NULL, s3_t2
varchar(5) DEFAULT NULL, s3_t3 varchar(5) DEFAULT NULL, s3_ia_tot
varchar(5) DEFAULT NULL, jan_tc_s4 varchar(5) DEFAULT NULL, jan_ac_s4
varchar(5) DEFAULT NULL, jan_s4_perce varchar(5) DEFAULT NULL, feb_tc_s4
varchar(5) DEFAULT NULL, feb_ac_s4 varchar(5) DEFAULT NULL, feb_s4_perce
varchar(5) DEFAULT NULL, mar_tc_s4 varchar(5) DEFAULT NULL, mar_ac_s4
varchar(5) DEFAULT NULL, mar_s4_perce varchar(5) DEFAULT NULL, apr_tc_s4
varchar(5) DEFAULT NULL, apr_ac_s4 varchar(5) DEFAULT NULL, apr_s4_perce
varchar(5) DEFAULT NULL, may_tc_s4 varchar(5) DEFAULT NULL, may_ac_s4
varchar(5) DEFAULT NULL, may_s4_perce varchar(5) DEFAULT NULL, jun_tc_s4
varchar(5) DEFAULT NULL, jun_ac_s4 varchar(5) DEFAULT NULL, jun_s4_perce
varchar(5) DEFAULT NULL, dec_tc_s4 varchar(5) DEFAULT NULL, dec_ac_s4
varchar(5) DEFAULT NULL, dec_s4_perce varchar(5) DEFAULT NULL, s4_ia_att
varchar(5) DEFAULT NULL, s4_t1 varchar(5) DEFAULT NULL, s4_t2 varchar(5)
DEFAULT NULL, s4_t3 varchar(5) DEFAULT NULL, s4_ia_tot varchar(5) DEFAULT
NULL, jan_tc_s5 varchar(5) DEFAULT NULL, jan_ac_s5 varchar(5) DEFAULT
NULL, jan_s5_perce varchar(5) DEFAULT NULL, feb_tc_s5 varchar(5) DEFAULT
NULL, feb_ac_s5 varchar(5) DEFAULT NULL, feb_s5_perce varchar(5) DEFAULT
NULL, mar_tc_s5 varchar(5) DEFAULT NULL, mar_ac_s5 varchar(5) DEFAULT
NULL, mar_s5_perce varchar(5) DEFAULT NULL, apr_tc_s5 varchar(5) DEFAULT
NULL, apr_ac_s5 varchar(5) DEFAULT NULL, apr_s5_perce varchar(5) DEFAULT
NULL, may_tc_s5 varchar(5) DEFAULT NULL, may_ac_s5 varchar(5) DEFAULT
NULL, may_s5_perce varchar(5) DEFAULT NULL, jun_tc_s5 varchar(5) DEFAULT
NULL, jun_ac_s5 varchar(5) DEFAULT NULL, jun_s5_perce varchar(5) DEFAULT
NULL, dec_tc_s5 varchar(5) DEFAULT NULL, dec_ac_s5 varchar(5) DEFAULT
NULL, dec_s5_perce varchar(5) DEFAULT NULL, s5_ia_att varchar(5) DEFAULT
NULL, s5_t1 varchar(5) DEFAULT NULL, s5_t2 varchar(5) DEFAULT NULL,
s5_ia_tot varchar(5) DEFAULT NULL, jan_tc_s6 varchar(5) DEFAULT NULL,
jan_ac_s6 varchar(5) DEFAULT NULL, jan_s6_perce varchar(5) DEFAULT NULL,
feb_tc_s6 varchar(5) DEFAULT NULL, feb_ac_s6 varchar(5) DEFAULT NULL,
feb_s6_perce varchar(5) DEFAULT NULL, mar_tc_s6 varchar(5) DEFAULT NULL,
mar_ac_s6 varchar(5) DEFAULT NULL, mar_s6_perce varchar(5) DEFAULT NULL,
apr_tc_s6 varchar(5) DEFAULT NULL, apr_ac_s6 varchar(5) DEFAULT NULL,
apr_s6_perce varchar(5) DEFAULT NULL, may_tc_s6 varchar(5) DEFAULT NULL,
may_ac_s6 varchar(5) DEFAULT NULL, may_s6_perce varchar(5) DEFAULT NULL,
jun_tc_s6 varchar(5) DEFAULT NULL, jun_ac_s6 varchar(5) DEFAULT NULL,
jun_s6_perce varchar(5) DEFAULT NULL, dec_tc_s6 varchar(5) DEFAULT NULL,
dec_ac_s6 varchar(5) DEFAULT NULL, dec_s6_perce varchar(5) DEFAULT NULL,
s6_ia_att varchar(5) DEFAULT NULL, s6_t1 varchar(5) DEFAULT NULL, s6_t2
varchar(5) DEFAULT NULL, s6_ia_tot varchar(5) DEFAULT NULL, jan_tc_s7
varchar(5) DEFAULT NULL, jan_ac_s7 varchar(5) DEFAULT NULL, jan_s7_perce
varchar(5) DEFAULT NULL, feb_tc_s7 varchar(5) DEFAULT NULL, feb_ac_s7
varchar(5) DEFAULT NULL, feb_s7_perce varchar(5) DEFAULT NULL, mar_tc_s7
varchar(5) DEFAULT NULL, mar_ac_s7 varchar(5) DEFAULT NULL, mar_s7_perce
varchar(5) DEFAULT NULL, apr_tc_s7 varchar(5) DEFAULT NULL, apr_ac_s7
varchar(5) DEFAULT NULL, apr_s7_perce varchar(5) DEFAULT NULL, may_tc_s7
varchar(5) DEFAULT NULL, may_ac_s7 varchar(5) DEFAULT NULL, may_s7_perce
varchar(5) DEFAULT NULL, jun_tc_s7 varchar(5) DEFAULT NULL, jun_ac_s7
varchar(5) DEFAULT NULL, jun_s7_perce varchar(5) DEFAULT NULL, dec_tc_s7
varchar(5) DEFAULT NULL, dec_ac_s7 varchar(5) DEFAULT NULL, dec_s7_perce
varchar(5) DEFAULT NULL, s7_ia_att varchar(5) DEFAULT NULL, s7_t1
varchar(5) DEFAULT NULL, s7_t2 varchar(5) DEFAULT NULL, s7_ia_tot
varchar(5) DEFAULT NULL,
Undefined index: myusername in C:\wamp\www\login\login\index.php on line 15 Call Stack
Undefined index: myusername in C:\wamp\www\login\login\index.php on line
15 Call Stack
in my login page it appears error in my log in page how to fix this thanks
Undefined index: myusername in C:\wamp\www\login\login\index.php on line
15 Call Stack
15 Call Stack
in my login page it appears error in my log in page how to fix this thanks
Undefined index: myusername in C:\wamp\www\login\login\index.php on line
15 Call Stack
reformat existing array to group items together
reformat existing array to group items together
I have the following array:
Array
(
[0] => Array
(
[name] => bss2
[label] => front
[text] => just a testing item
)
[1] => Array
(
[name] => bss3
[label] => front top
[text] => front top testing item
)
[2] => Array
(
[name] => J334
[label] => back top
[text] => masking test back top
)
[3] => Array
(
[name] => J3366
[label] => back
[text] => back non mask test
)
)
What i would like to accomplish is to check to see if label = front then
group the ones with front together and same with back all in one big array
to have it looks like so:
[approval] => Array
(
[0] => Array
(
[name] = front
[prev] = Array
(
[0]=>Array
(
[name] => bss2
)
[1]=>Array
(
[name] => bss2
)
)
)
[1] => Array
(
[name] = back
[prev] = Array
(
[0]=>Array
(
[name] => J334
)
[1]=>Array
(
[name] => J3366
)
)
)
)
so far I dont have much and am stuck but this is my code
foreach($info as $data) {
if(strtolower(strpos($data['label'], "front") !==false)) {
} else {
}
}
Any help is greatly appreciated thank you.
I have the following array:
Array
(
[0] => Array
(
[name] => bss2
[label] => front
[text] => just a testing item
)
[1] => Array
(
[name] => bss3
[label] => front top
[text] => front top testing item
)
[2] => Array
(
[name] => J334
[label] => back top
[text] => masking test back top
)
[3] => Array
(
[name] => J3366
[label] => back
[text] => back non mask test
)
)
What i would like to accomplish is to check to see if label = front then
group the ones with front together and same with back all in one big array
to have it looks like so:
[approval] => Array
(
[0] => Array
(
[name] = front
[prev] = Array
(
[0]=>Array
(
[name] => bss2
)
[1]=>Array
(
[name] => bss2
)
)
)
[1] => Array
(
[name] = back
[prev] = Array
(
[0]=>Array
(
[name] => J334
)
[1]=>Array
(
[name] => J3366
)
)
)
)
so far I dont have much and am stuck but this is my code
foreach($info as $data) {
if(strtolower(strpos($data['label'], "front") !==false)) {
} else {
}
}
Any help is greatly appreciated thank you.
How to list the contents of the variable VAR
How to list the contents of the variable VAR
How to list the contents of the variable VAR
(
VAR="foo";
) &
echo $VAR; # I need to get "foo" ?
thank you very much
How to list the contents of the variable VAR
(
VAR="foo";
) &
echo $VAR; # I need to get "foo" ?
thank you very much
Push Messaging with Amazon SNS, SQS and PHP
Push Messaging with Amazon SNS, SQS and PHP
I want to use Amazon SNS to send time-critical mobile PUSH notifications
to 20 million devices. Each topic can have up to 10,000 devices, and I can
create up to 3,000 topics. Using the Amazon PHP SDK would mean sending
2000 API calls at 1 second each - 33 minutes in total. This is no good for
time-critical messages.
I have created an SQS queue and subscribed that to the SNS topic. When I
send my PUSH message to the SQS queue, it doesn't get delivered - it
remains in the queue.
How can I use these services to send the messages more quickly?
Thank you!
I want to use Amazon SNS to send time-critical mobile PUSH notifications
to 20 million devices. Each topic can have up to 10,000 devices, and I can
create up to 3,000 topics. Using the Amazon PHP SDK would mean sending
2000 API calls at 1 second each - 33 minutes in total. This is no good for
time-critical messages.
I have created an SQS queue and subscribed that to the SNS topic. When I
send my PUSH message to the SQS queue, it doesn't get delivered - it
remains in the queue.
How can I use these services to send the messages more quickly?
Thank you!
Thursday, 12 September 2013
"Redirect url" error in facebook api
"Redirect url" error in facebook api
I am working on facebook api. I want to get all facebook post of a user. I
have set the app_id, secret and permission in my code.
This code is working on my localhost perfectly. but when I am putting it
on server then during authentication it is giving error :
This webpage has a redirect loop
My code is located at the url :
https://github.com/ucerturohti/facebookapitest.git
and the app is located at
https://statusupdates.herokuapp.com
update
When I am putting redirect url "https://statusupdates.herokuapp.com" then
its authenticating.
but when I put redirect url as
"https://statusupdates.herokuapp.com/getlike.php" then it is giving error.
I am working on facebook api. I want to get all facebook post of a user. I
have set the app_id, secret and permission in my code.
This code is working on my localhost perfectly. but when I am putting it
on server then during authentication it is giving error :
This webpage has a redirect loop
My code is located at the url :
https://github.com/ucerturohti/facebookapitest.git
and the app is located at
https://statusupdates.herokuapp.com
update
When I am putting redirect url "https://statusupdates.herokuapp.com" then
its authenticating.
but when I put redirect url as
"https://statusupdates.herokuapp.com/getlike.php" then it is giving error.
Audio is not playing properly in ffmpeg player
Audio is not playing properly in ffmpeg player
I need to create a player which will decrypt the input on-fly and play the
content. I have choosen ffmpeg libs (libav*) to create player and to start
I have followed this link
but audio is not playing properly,video is playing fine. I am using ubuntu
12.04LTS 64bit OS with the following ffmpeg version,
admin@vz-X401A1:~$ ffmpeg ffmpeg version 2.0 Copyright (c) 2000-2013 the
FFmpeg developers built on Sep 11 2013 13:46:26 with gcc 4.6
(Ubuntu/Linaro 4.6.3-1ubuntu5) configuration:
--prefix=/home/admin/ffmpeg_build
--extra-cflags=-I/home/admin/ffmpeg_build/include
--extra-ldflags=-L/home/admin/ffmpeg_build/lib --bindir=/home/admin/bin
--extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
libavutil 52. 43.100 / 52. 43.100 libavcodec 55. 31.101 / 55. 31.101
libavformat 55. 16.102 / 55. 16.102 libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 84.100 / 3. 84.100 libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile
options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg' admin@vz-X401A1:~$
and downloaded tutorial07.c from this link
still, with this also, sound is not playing properly.
I need help to solve the following issues,
1> How can I fix this audio issue(I have gone through similar question in
StackOverflow and installed old ver. of ffmpeg, but issue still remains).
2> And also suggest some steps or tutorial, how to implement on-fly
decryption process (in C) and integrate this with the player.
Thank You.
I need to create a player which will decrypt the input on-fly and play the
content. I have choosen ffmpeg libs (libav*) to create player and to start
I have followed this link
but audio is not playing properly,video is playing fine. I am using ubuntu
12.04LTS 64bit OS with the following ffmpeg version,
admin@vz-X401A1:~$ ffmpeg ffmpeg version 2.0 Copyright (c) 2000-2013 the
FFmpeg developers built on Sep 11 2013 13:46:26 with gcc 4.6
(Ubuntu/Linaro 4.6.3-1ubuntu5) configuration:
--prefix=/home/admin/ffmpeg_build
--extra-cflags=-I/home/admin/ffmpeg_build/include
--extra-ldflags=-L/home/admin/ffmpeg_build/lib --bindir=/home/admin/bin
--extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
libavutil 52. 43.100 / 52. 43.100 libavcodec 55. 31.101 / 55. 31.101
libavformat 55. 16.102 / 55. 16.102 libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 84.100 / 3. 84.100 libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile
options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg' admin@vz-X401A1:~$
and downloaded tutorial07.c from this link
still, with this also, sound is not playing properly.
I need help to solve the following issues,
1> How can I fix this audio issue(I have gone through similar question in
StackOverflow and installed old ver. of ffmpeg, but issue still remains).
2> And also suggest some steps or tutorial, how to implement on-fly
decryption process (in C) and integrate this with the player.
Thank You.
Subscribe to:
Comments (Atom)