Static IPv6 address in Windows unused for outgoing connections
I'm running a Windows server and trying to get it to use a static IPv6
address for outgoing connections to other IPv6 hosts (such as Gmail). I
need this because Gmail requires a ptr record, and I can't set one for
random addresses.
The static address is configured on the host, but it also has a temporary
privacy address as well as a random address from the router it seems. By
default Windows uses the privacy address; it seems this is the expected
behavior (and it makes perfect sense for people/users that did not set a
static address, but I did!).
I've tried disabling the privacy address with:
netsh int ipv6 set privacy disabled
This indeed gets rid of the privacy address, but I still have the random
address that the router assigned. To disable this, it was said I needed to
disable "router discovery" using this command:
net interface ipv6 set interface 14 routerdiscovery=disabled
Upon doing this, all IPv6 connectivity is lost. If I do this while pinging
Gmail, it will report "Destination host unreachable" as soon as I enter
the command. In the static IPv6 configuration, I did configure the default
gateway and prefix length, so I don't see why it's unable to connect.
Probably has something to do with the lack of ARP in IPv6 and somehow
being unable to resolve the router's MAC, but I wouldn't know how to fix
this.
Finally I've tried disabling the DHCPv6 lease with these commands:
netsh interface ipv6 set interface "IDMZ Team" managedaddress=disabled
netsh interface ipv6 set interface "IDMZ Team" otherstateful=disabled
Which was to no avail; the host continues to obtain and use the
router-assigned IPv6 address.
The router is a FritzBox 7340, which shows me all the IPv4 and IPv6
addresses that the host (identified by MAC) utilizes, but I'm unable to
change the assigned address. Maybe this could be done over the telnet
interface of the router somehow, but again, I wouldn't know how to do this
even if it's the way to go.
In short, any of the following would probably solve my problem:
Change Windows' source address selection behavior.
Have Windows not get an address from the router and not generate a privacy
address;
Have the router hand out a static address and make Windows use that as
source address.
Recover connectivity after disabling router discovery on Windows.
Alternatively I might use some (batch, perl, ...) script to throw away all
IPv6 addresses except the desired one, but this feels rather hacky. If
it's the only way (or less hacky than another hacky solution), it might be
an option though.
Thanks!
Monday, 30 September 2013
Biggest ellipse included in a convex polygon
Biggest ellipse included in a convex polygon
Considering a N edges convex 2D polygon called P. Let's name its vertices
$\{p_1, p_2, ..., p_N\}$ described in a counter-clockwise order, with $p_i
= (x_i, y_i)$
What would be, and how would one compute(preferably without optimization
algorithm) the ellipse of biggest area E included in this polygon?
Considering a N edges convex 2D polygon called P. Let's name its vertices
$\{p_1, p_2, ..., p_N\}$ described in a counter-clockwise order, with $p_i
= (x_i, y_i)$
What would be, and how would one compute(preferably without optimization
algorithm) the ellipse of biggest area E included in this polygon?
Why and when we should use arugment.length in ember.js
Why and when we should use arugment.length in ember.js
Below code is taken from here. But I do not understand, why at the time
that the author use fullName as computed property, he did the check for
setter with argument.length instead of value.length, which may more
related to the value variable that is assigned to the function. I wonder
what is the difference and why he is using arugment.length in this case?
App.Person = Ember.Object.extend({
firstName: null,
lastName: null,
fullName: function(key, value) {
// setter
if (arguments.length > 1) {
var nameParts = value.split(/\s+/);
this.set('firstName', nameParts[0]);
this.set('lastName', nameParts[1]);
}
// getter
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName')
});
var captainAmerica = App.Person.create();
captainAmerica.set('fullName', "William Burnside");
captainAmerica.get('firstName'); // William
captainAmerica.get('lastName'); // Burnside
Below code is taken from here. But I do not understand, why at the time
that the author use fullName as computed property, he did the check for
setter with argument.length instead of value.length, which may more
related to the value variable that is assigned to the function. I wonder
what is the difference and why he is using arugment.length in this case?
App.Person = Ember.Object.extend({
firstName: null,
lastName: null,
fullName: function(key, value) {
// setter
if (arguments.length > 1) {
var nameParts = value.split(/\s+/);
this.set('firstName', nameParts[0]);
this.set('lastName', nameParts[1]);
}
// getter
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName')
});
var captainAmerica = App.Person.create();
captainAmerica.set('fullName', "William Burnside");
captainAmerica.get('firstName'); // William
captainAmerica.get('lastName'); // Burnside
why textchanged and selectedindexchange events don't post correct values in asp.net?
why textchanged and selectedindexchange events don't post correct values
in asp.net?
how to use selected index changed event of drop down list in asp.net??when
I set auto post back ==true, dropdown reload again and select value
changed to first index. i have problems like this problem in text changed
event of textbox that I know only auto post property. but auto post back
not correct solution.
in asp.net?
how to use selected index changed event of drop down list in asp.net??when
I set auto post back ==true, dropdown reload again and select value
changed to first index. i have problems like this problem in text changed
event of textbox that I know only auto post property. but auto post back
not correct solution.
Sunday, 29 September 2013
Stack level too Deep - Rspec
Stack level too Deep - Rspec
I've seen tons of these questions, but none of their solutions are working
for me. I have a single test like so:
describe RolesController do
describe "#delet" do
context "When the user is logged in" do
let(:user) {FactoryGirl.create(:user)}
let(:admin) {FactoryGirl.create(:admin)}
let(:adminRole) {FactoryGirl.create(:adminRole)}
it "Should allow admins to delete roles" do
sign_in admin
put :destroy, :id => adminRole.id
end
end
end
end
Simple, simple, simple. Yet I get the typical error:
1) RolesController#delet When the user is logged in Should allow admins
to delete roles
Failure/Error: Unable to find matching line from backtrace
SystemStackError:
stack level too deep
#
/home/adam/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:23
and I'm all like ... what? Again I have read dozens of questions on this
and it seems to be something with factory girl but I cannot see what the
issue here would be. I have tons of other tests that instantiate factory
girl based object like this with no issue.
I've seen tons of these questions, but none of their solutions are working
for me. I have a single test like so:
describe RolesController do
describe "#delet" do
context "When the user is logged in" do
let(:user) {FactoryGirl.create(:user)}
let(:admin) {FactoryGirl.create(:admin)}
let(:adminRole) {FactoryGirl.create(:adminRole)}
it "Should allow admins to delete roles" do
sign_in admin
put :destroy, :id => adminRole.id
end
end
end
end
Simple, simple, simple. Yet I get the typical error:
1) RolesController#delet When the user is logged in Should allow admins
to delete roles
Failure/Error: Unable to find matching line from backtrace
SystemStackError:
stack level too deep
#
/home/adam/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:23
and I'm all like ... what? Again I have read dozens of questions on this
and it seems to be something with factory girl but I cannot see what the
issue here would be. I have tons of other tests that instantiate factory
girl based object like this with no issue.
Download PDF file android
Download PDF file android
i have An Error while download PDF file From Server and save it on SD i
have permission To Access internet and external storage .. It`s working
fine on android 2.3.6 But on Tab 4.1.1 its create the file with 0 byte
URL url = new URL("https://docs.google.com/"+direct);
//create the new connection
HttpURLConnection urlConnection = (HttpURLConnection)
url.openConnection();
//set up some things on the connection
urlConnection.setRequestMethod("GET");
urlConnection.setRequestProperty("Connection", "Keep-Alive");
urlConnection.setRequestProperty("Content-Type",
"application/xml");
urlConnection.setDoOutput(true);
//and connect!
urlConnection.connect();
//set the path where we want to save the file
//in this case, going to save it on the root directory of the
//sd card.
File SDCardRoot = new
File(Environment.getExternalStorageDirectory().getAbsoluteFile()+"/folder/");
//create a new file, specifying the path, and the filename
//which we want to save the file as.
File file = new File(SDCardRoot,book.getBook_name()+".pdf");
//this will be used to write the downloaded data into the file
we created
FileOutputStream fileOutput = new FileOutputStream(file);
//this will be used in reading the data from the internet
InputStream inputStream = urlConnection.getInputStream();
//this is the total size of the file
totalSize = urlConnection.getContentLength();
//variable to store total downloaded bytes
//create a buffer...
byte[] buffer = new byte[1024];
int bufferLength = 0; //used to store a temporary size of the
buffer
//now, read through the input buffer and write the contents to
the file
while ( (bufferLength = inputStream.read(buffer)) > 0 ) {
//add the data in the buffer to the file in the file
output stream (the file on the sd card
fileOutput.write(buffer, 0, bufferLength);
//add up the size so we know how much is downloaded
downloadedSize += bufferLength;
//this is where you would do something to report the
prgress, like this maybe
publishProgress((downloadedSize*100)/totalSize);
}
//close the output stream when done
fileOutput.close();
//catch some possible errors...
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
i have An Error while download PDF file From Server and save it on SD i
have permission To Access internet and external storage .. It`s working
fine on android 2.3.6 But on Tab 4.1.1 its create the file with 0 byte
URL url = new URL("https://docs.google.com/"+direct);
//create the new connection
HttpURLConnection urlConnection = (HttpURLConnection)
url.openConnection();
//set up some things on the connection
urlConnection.setRequestMethod("GET");
urlConnection.setRequestProperty("Connection", "Keep-Alive");
urlConnection.setRequestProperty("Content-Type",
"application/xml");
urlConnection.setDoOutput(true);
//and connect!
urlConnection.connect();
//set the path where we want to save the file
//in this case, going to save it on the root directory of the
//sd card.
File SDCardRoot = new
File(Environment.getExternalStorageDirectory().getAbsoluteFile()+"/folder/");
//create a new file, specifying the path, and the filename
//which we want to save the file as.
File file = new File(SDCardRoot,book.getBook_name()+".pdf");
//this will be used to write the downloaded data into the file
we created
FileOutputStream fileOutput = new FileOutputStream(file);
//this will be used in reading the data from the internet
InputStream inputStream = urlConnection.getInputStream();
//this is the total size of the file
totalSize = urlConnection.getContentLength();
//variable to store total downloaded bytes
//create a buffer...
byte[] buffer = new byte[1024];
int bufferLength = 0; //used to store a temporary size of the
buffer
//now, read through the input buffer and write the contents to
the file
while ( (bufferLength = inputStream.read(buffer)) > 0 ) {
//add the data in the buffer to the file in the file
output stream (the file on the sd card
fileOutput.write(buffer, 0, bufferLength);
//add up the size so we know how much is downloaded
downloadedSize += bufferLength;
//this is where you would do something to report the
prgress, like this maybe
publishProgress((downloadedSize*100)/totalSize);
}
//close the output stream when done
fileOutput.close();
//catch some possible errors...
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Transition gesture to a modal UIViewController
Transition gesture to a modal UIViewController
I am using a UIPinchGestureRecognizer to trigger the appearance of a modal
UIViewController, that allows zooming and panning around an image. It
essentially lets you isolate one image and explore it in more detail.
The new UIViewController has its own pinch and pan gesture recognizers.
The one downside I have noticed is that once the new UIViewController
appears, the user has to take their fingers off the screen and start
pinching again before the new gesture recognizer identifies the touch
events.
Ideally, I would like the pinching to be seamless, so the user could
continue to pinch and/or pan once the modal UIViewController appears. Is
there any way to transition the touch events from the previous view
controller into the modal one, in such a way the gesture recognizers in
the new UIViewController are triggered?
The code that I use to trigger the modal zoom view controller:
- (IBAction)zoomImage:(UIPinchGestureRecognizer *)sender
{
// if the gesture was released while the scale factor is sufficiently
big, show the modal view
if ( sender.state == UIGestureRecognizerStateEnded && sender.scale >
1.6f ) {
// prepare the modal view controller
ZoomViewController *viewControllerZoom = [[ZoomViewController
alloc] initWithNibName:nil bundle:nil];
[viewControllerZoom setImage:self.imageViewImage.image
andScale:sender.scale];
// present the modal view controller
[self presentViewController:viewControllerZoom animated:YES
completion:nil];
// gracefully transition the image back to its original size
[UIView animateWithDuration:0.5f animations:^{
self.imageViewImage.transform = CGAffineTransformIdentity;
}];
}
else if ( sender.state == UIGestureRecognizerStateEnded ||
sender.state == UIGestureRecognizerStateCancelled ) {
// revert to normal size on end
[UIView animateWithDuration:0.5f animations:^{
self.imageViewImage.transform = CGAffineTransformIdentity;
}];
}
else if ( sender.scale >= 1.0f ) {
// scale in place
CGFloat scale = sender.scale;
self.imageViewImage.transform =
CGAffineTransformScale(CGAffineTransformIdentity, scale, scale);
}
}
I am using a UIPinchGestureRecognizer to trigger the appearance of a modal
UIViewController, that allows zooming and panning around an image. It
essentially lets you isolate one image and explore it in more detail.
The new UIViewController has its own pinch and pan gesture recognizers.
The one downside I have noticed is that once the new UIViewController
appears, the user has to take their fingers off the screen and start
pinching again before the new gesture recognizer identifies the touch
events.
Ideally, I would like the pinching to be seamless, so the user could
continue to pinch and/or pan once the modal UIViewController appears. Is
there any way to transition the touch events from the previous view
controller into the modal one, in such a way the gesture recognizers in
the new UIViewController are triggered?
The code that I use to trigger the modal zoom view controller:
- (IBAction)zoomImage:(UIPinchGestureRecognizer *)sender
{
// if the gesture was released while the scale factor is sufficiently
big, show the modal view
if ( sender.state == UIGestureRecognizerStateEnded && sender.scale >
1.6f ) {
// prepare the modal view controller
ZoomViewController *viewControllerZoom = [[ZoomViewController
alloc] initWithNibName:nil bundle:nil];
[viewControllerZoom setImage:self.imageViewImage.image
andScale:sender.scale];
// present the modal view controller
[self presentViewController:viewControllerZoom animated:YES
completion:nil];
// gracefully transition the image back to its original size
[UIView animateWithDuration:0.5f animations:^{
self.imageViewImage.transform = CGAffineTransformIdentity;
}];
}
else if ( sender.state == UIGestureRecognizerStateEnded ||
sender.state == UIGestureRecognizerStateCancelled ) {
// revert to normal size on end
[UIView animateWithDuration:0.5f animations:^{
self.imageViewImage.transform = CGAffineTransformIdentity;
}];
}
else if ( sender.scale >= 1.0f ) {
// scale in place
CGFloat scale = sender.scale;
self.imageViewImage.transform =
CGAffineTransformScale(CGAffineTransformIdentity, scale, scale);
}
}
andEngine alertdialog error
andEngine alertdialog error
error java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare() =(
if I call showDialog (id) into GameActivity - works If the calling
activity.showDialog from another class - a mistake
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 1:
Log.d("Dialog", "Dialog 1");
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Help");
alert.setMessage("Help");
WebView wv = new WebView(this);
wv.loadUrl("http:\\www.google.com");
wv.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String
url)
{
view.loadUrl(url);
return true;
}
});
alert.setView(wv);
AlertDialog ALERT = alert.create();
return ALERT;
default:
return null;
}
}
I want to call a dialog with any other class
error java.lang.RuntimeException: Can't create handler inside thread that
has not called Looper.prepare() =(
if I call showDialog (id) into GameActivity - works If the calling
activity.showDialog from another class - a mistake
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 1:
Log.d("Dialog", "Dialog 1");
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Help");
alert.setMessage("Help");
WebView wv = new WebView(this);
wv.loadUrl("http:\\www.google.com");
wv.setWebViewClient(new WebViewClient()
{
@Override
public boolean shouldOverrideUrlLoading(WebView view, String
url)
{
view.loadUrl(url);
return true;
}
});
alert.setView(wv);
AlertDialog ALERT = alert.create();
return ALERT;
default:
return null;
}
}
I want to call a dialog with any other class
Saturday, 28 September 2013
How to make Online iPhone "Card Game" with HTML5
How to make Online iPhone "Card Game" with HTML5
What are the necessary things for creating card game on iPhone??
The purpose of this app is to share the ideas by using cards. Each player
will draw a card and do what the cards order to do such as write the
comments on those topics and so on.
I'm quite new for the programing. I don't want to learn Objective-C. It is
quite hard for me. I have searched on google that PhoneGab can port
HTML5,CSS&JavaScript to be an iPhone app. So the things that I must learn
are HTML5,CSS & JavaScript only?
This app must have many players to play for sharing the ideas. Therefore,
must I learn other programing languages? such as, php.. to manage each
player data (profile).
Moreover, I would like to use points, badges, leader board in this app, too
How about and SDK or any software to help me write code easier?
(p.s. Sorry for my bad English)
What are the necessary things for creating card game on iPhone??
The purpose of this app is to share the ideas by using cards. Each player
will draw a card and do what the cards order to do such as write the
comments on those topics and so on.
I'm quite new for the programing. I don't want to learn Objective-C. It is
quite hard for me. I have searched on google that PhoneGab can port
HTML5,CSS&JavaScript to be an iPhone app. So the things that I must learn
are HTML5,CSS & JavaScript only?
This app must have many players to play for sharing the ideas. Therefore,
must I learn other programing languages? such as, php.. to manage each
player data (profile).
Moreover, I would like to use points, badges, leader board in this app, too
How about and SDK or any software to help me write code easier?
(p.s. Sorry for my bad English)
Regex issue - asterisk after \d
Regex issue - asterisk after \d
I'm using http://gskinner.com/RegExr/ to test my regex:
[+-]?\d+\.?\d*(e[+-]?\d+)?. It's supposed to match floating point numbers.
Currently it doesn't match .x, but I want to make it do that.
I tried changing it to [+-]?\d*\.?\d*(e[+-]?\d+)? (changed + to *) but
that's an error. What's going wrong here?
Update: is it because everything is optional?
I'm using http://gskinner.com/RegExr/ to test my regex:
[+-]?\d+\.?\d*(e[+-]?\d+)?. It's supposed to match floating point numbers.
Currently it doesn't match .x, but I want to make it do that.
I tried changing it to [+-]?\d*\.?\d*(e[+-]?\d+)? (changed + to *) but
that's an error. What's going wrong here?
Update: is it because everything is optional?
playback time between mediaplayers
playback time between mediaplayers
I'm using several mediaplayers in my code that is played in sequence. I
wonder if it is possible to reduce the time between a reproduction and
other. audios use no space at the beginning or end.
I've searched but have not found any answers.
appreciate any help
thanks and regards
I'm using several mediaplayers in my code that is played in sequence. I
wonder if it is possible to reduce the time between a reproduction and
other. audios use no space at the beginning or end.
I've searched but have not found any answers.
appreciate any help
thanks and regards
why does JSONDeserializer exclude xml tag from json input string
why does JSONDeserializer exclude xml tag from json input string
I've below json string
{"metadata":"<xml><item><name>Memory</name><Fullname>NULL</Fullname></item></xml>"}
when I deserialize this using flexjson it is excluding all xml tags from
above json and give this value "Memory NULL"
I've below json string
{"metadata":"<xml><item><name>Memory</name><Fullname>NULL</Fullname></item></xml>"}
when I deserialize this using flexjson it is excluding all xml tags from
above json and give this value "Memory NULL"
Friday, 27 September 2013
Usage Marionette.module with AMD
Usage Marionette.module with AMD
I want to use in my new project Coffee + Marionette + Require.js, but i
have a problem with module loadings query. Module will started after main
app starting callback;
# main.coffee
require.config
paths:
# ...
app: '/js/app/app'
marionette: '/js/vendors/backbone.marionette'
shim:
# ...
'marionette':
deps: ['backbone']
exports: 'Marionette'
'app':
deps: ['marionette']
exports: 'App'
require ['app'], (App) ->
App.start()
# module.coffee
define ['app'], (App) ->
MyModule = App.module('MyModule');
MyModule.foo = ->
console.log 'bar'
return MyModule
# app.coffee
define (require) ->
App = new Marionette.Application
App.addInitializer ->
require 'modules/test'
console.log 'App inited'
App.on
'start': ->
console.log 'App started'
return App
# Output
App inited
App started
Module inited
How must i define the module, if i want to use him in initializers ?
I want to use in my new project Coffee + Marionette + Require.js, but i
have a problem with module loadings query. Module will started after main
app starting callback;
# main.coffee
require.config
paths:
# ...
app: '/js/app/app'
marionette: '/js/vendors/backbone.marionette'
shim:
# ...
'marionette':
deps: ['backbone']
exports: 'Marionette'
'app':
deps: ['marionette']
exports: 'App'
require ['app'], (App) ->
App.start()
# module.coffee
define ['app'], (App) ->
MyModule = App.module('MyModule');
MyModule.foo = ->
console.log 'bar'
return MyModule
# app.coffee
define (require) ->
App = new Marionette.Application
App.addInitializer ->
require 'modules/test'
console.log 'App inited'
App.on
'start': ->
console.log 'App started'
return App
# Output
App inited
App started
Module inited
How must i define the module, if i want to use him in initializers ?
PHP Variables in SQL Statement not working
PHP Variables in SQL Statement not working
I'm trying to create a SQL query with a PHP variable, which is a username.
For some reason, nothing happens when it is executed. Any help would be
much appreciated!
mysqli_query($dbcon, "ALTER TABLE ipList");
mysqli_query($dbcon, "ADD ".$userName." VARCHAR(30)");
Thanks!
~Carpetfizz
I'm trying to create a SQL query with a PHP variable, which is a username.
For some reason, nothing happens when it is executed. Any help would be
much appreciated!
mysqli_query($dbcon, "ALTER TABLE ipList");
mysqli_query($dbcon, "ADD ".$userName." VARCHAR(30)");
Thanks!
~Carpetfizz
Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
Unable to locate Spring NamespaceHandler for XML schema namespace
[http://www.springframework.org/schema/osgi]
I have following exception during Spring initialization:
Caused by:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://www.springframework.org/schema/osgi]
Offending resource: OSGi
resource[bundleentry://104.fwk32582392/META-INF/varaza/extender/extender-context.xml|bnd.id=103|bnd.sym=com.pearlox.varaza]
How can I determine which JAR (which Maven artifact contains definition of
proper NamespaceHandler for [http://www.springframework.org/schema/osgi] ?
What my strategy of fixing this should look like?
What else have I to include into my question to help you understand the
situation? (please comment)
P.S.: I see lots of similar questions here on StackOverflow related to
other libraries but answer depends on particular namespace.
[http://www.springframework.org/schema/osgi]
I have following exception during Spring initialization:
Caused by:
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML
schema namespace [http://www.springframework.org/schema/osgi]
Offending resource: OSGi
resource[bundleentry://104.fwk32582392/META-INF/varaza/extender/extender-context.xml|bnd.id=103|bnd.sym=com.pearlox.varaza]
How can I determine which JAR (which Maven artifact contains definition of
proper NamespaceHandler for [http://www.springframework.org/schema/osgi] ?
What my strategy of fixing this should look like?
What else have I to include into my question to help you understand the
situation? (please comment)
P.S.: I see lots of similar questions here on StackOverflow related to
other libraries but answer depends on particular namespace.
RAILS: outputting to file is formatting differently on staging when compared to local
RAILS: outputting to file is formatting differently on staging when
compared to local
I am printing some data to a custom log file. It works well. However, when
I pushed the application to the staging server from my local dev
environment, the way it printed the data to file changed. Locally, each
print would go on a new line like so:
log
log
log
However, when pushing to the staging dev server the log started printing
like this:
logloglog
This is the code I am currently using:
print eco_logger.info("Date: " + Time.now.strftime("%I:%M:%S") + " | " +
"User: " + current_user.email.to_s() + " | " + "Action: Edited User |
User: " + @user.first_name.to_s + " " + @user.last_name.to_s + " | Email:
" + @user.email.to_s)
I also tried the \n, to see if that would work; like so:
print eco_logger.info("\nDate: " + Time.now.strftime("%I:%M:%S") + " | " +
"User: " + current_user.email.to_s() + " | " + "Action: Edited User |
User: " + @user.first_name.to_s + " " + @user.last_name.to_s + " | Email:
" + @user.email.to_s)
Locally, it added another space so things were like this:
log
log
log
However, at staging things remained the same....tis a grim day.
Would anyone be able to shed some light on this issue? Thanks!
compared to local
I am printing some data to a custom log file. It works well. However, when
I pushed the application to the staging server from my local dev
environment, the way it printed the data to file changed. Locally, each
print would go on a new line like so:
log
log
log
However, when pushing to the staging dev server the log started printing
like this:
logloglog
This is the code I am currently using:
print eco_logger.info("Date: " + Time.now.strftime("%I:%M:%S") + " | " +
"User: " + current_user.email.to_s() + " | " + "Action: Edited User |
User: " + @user.first_name.to_s + " " + @user.last_name.to_s + " | Email:
" + @user.email.to_s)
I also tried the \n, to see if that would work; like so:
print eco_logger.info("\nDate: " + Time.now.strftime("%I:%M:%S") + " | " +
"User: " + current_user.email.to_s() + " | " + "Action: Edited User |
User: " + @user.first_name.to_s + " " + @user.last_name.to_s + " | Email:
" + @user.email.to_s)
Locally, it added another space so things were like this:
log
log
log
However, at staging things remained the same....tis a grim day.
Would anyone be able to shed some light on this issue? Thanks!
PHP: get a result from a chaining method from extended classes?
PHP: get a result from a chaining method from extended classes?
I am trying to get a result from a chaining method from extended classes
below,
class Base
{
protected $id;
public function setId($input) {
$this->id = $input;
return $this;
}
}
class PageChildren extends Base
{
public function getID()
{
return $this->id;
}
}
class Page extends Base
{
public $hasChidren;
public function __construct()
{
$this->hasChidren = new PageChildren();
}
}
$page = new Page();
var_dump($page->setId(10)->hasChidren->getID());
But I get null instead of 10. What shall I do to get it right?
I am trying to get a result from a chaining method from extended classes
below,
class Base
{
protected $id;
public function setId($input) {
$this->id = $input;
return $this;
}
}
class PageChildren extends Base
{
public function getID()
{
return $this->id;
}
}
class Page extends Base
{
public $hasChidren;
public function __construct()
{
$this->hasChidren = new PageChildren();
}
}
$page = new Page();
var_dump($page->setId(10)->hasChidren->getID());
But I get null instead of 10. What shall I do to get it right?
Thursday, 26 September 2013
Allow users to upload backgrounds
Allow users to upload backgrounds
H guys,
How can I enable users to upload backgrounds? I have a social networking
site using "phpdolphin" and It's pretty easy to work around, and making
certain modifications shouldn't be hard but I can't seem to get
"background" uploads enabled.
The database has a field for backgrounds but it's not available when
you're logged in, how can I enable backgrounds?
anyone who can help me out? I'll provide you with the information you need
H guys,
How can I enable users to upload backgrounds? I have a social networking
site using "phpdolphin" and It's pretty easy to work around, and making
certain modifications shouldn't be hard but I can't seem to get
"background" uploads enabled.
The database has a field for backgrounds but it's not available when
you're logged in, how can I enable backgrounds?
anyone who can help me out? I'll provide you with the information you need
Wednesday, 25 September 2013
Class not found: javac1.8
Class not found: javac1.8
/home/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:887: The
following error occurred while executing this line:
/home/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:309: Class
not found: javac1.8 BUILD FAILED (total time: 0 seconds) i clean and built
the project.i have istalled netbeans 7.3.1 on ubuntu..how to solve this
error
/home/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:887: The
following error occurred while executing this line:
/home/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:309: Class
not found: javac1.8 BUILD FAILED (total time: 0 seconds) i clean and built
the project.i have istalled netbeans 7.3.1 on ubuntu..how to solve this
error
Thursday, 19 September 2013
Error in dyn.load(statnet.so)
Error in dyn.load(statnet.so)
I wanted to work on statnet package in R. But this error keeps popping up.
I Solutions I found were to reinstall the package. But reinstalling did
not solve the issue. I am not sure if its a package issue or ubuntu issue.
The code stops when libraries are included.
library("ergm")
library("networkDynamic")
library("network")
library("sna")`
I wanted to work on statnet package in R. But this error keeps popping up.
I Solutions I found were to reinstall the package. But reinstalling did
not solve the issue. I am not sure if its a package issue or ubuntu issue.
The code stops when libraries are included.
library("ergm")
library("networkDynamic")
library("network")
library("sna")`
jqGrid client-side searching with filterToolbar
jqGrid client-side searching with filterToolbar
I am trying to enable the client-side searching feature of the jqGrid
through the filterToolbar method, yet I am unable to make it work. The
grid is loading data correctly through JSON that is being returned from an
asmx service on page load (document.ready), yet when I try to search
through any of the columns using the search toolbar, the grid only
refreshes without searching.
I have already checked other similar questions and their answers, but none
of them helped me solve my issue. Maybe someone can check my jqGrid script
below and tell me what is wrong with it or what is there missing. For the
reference, I am using the version "4.5.2" of jqGrid.
$('#tblTargetDetails').jqGrid({
url: 'PostHandlers/CommonHandler.asmx/GetTargetDetails',
datatype: 'json',
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
ajaxRowOptions: { contentType: "application/json; charset=utf-8",
dataType: "json" },
postData: "{'TargetID': '" + TargetID + "'}",
mtype: 'POST',
colNames: ['Team ID', 'Member UserID', 'Measure', 'Product', 'Month1',
'Month2'],
colModel: [
{ name: 'TeamID', index: 'TeamID', width: 55, search: true,
sorttype: 'int' },
{ name: 'MemberUserID', index: 'MemberUserID', width: 90, search:
true, stype: 'text' },
{ name: 'Measure', index: 'Measure', width: 90, search: true,
searchoptions: {} },
{ name: 'Product', index: 'Product', width: 90, search: true },
{ name: 'Month1', index: 'Month1', width: 80, editable: true,
search: true },
{ name: 'Month2', index: 'Month2', width: 80, editable: true,
search: false }],
jsonReader: {
root: "d.TargetDetails",
records: "d.RecordsCount",
id: "ID",
cell: "",
page: function () { return 1; },
total: function () { return 1; },
},
pager: '#pnlTargetDetails',
rowNum: 50,
rowTotal: 2000,
rowList: [20, 30, 50],
loadonce: true,
viewrecords: true,
gridview: true,
ignoreCase: true,
rownumbers: true,
caption: 'Target Details',
editurl: 'PostHandlers/CommonHandler.asmx/EditTargetDetail',
serializeRowData: function (postData) {
return JSON.stringify({ 'content': JSON.stringify(postData),
'UserID': UserID });
},
onSelectRow: function (id) {
if (id && id !== lastSel) {
$('#tblTargetDetails').restoreRow(lastSel);
lastSel = id;
}
$('#tblTargetDetails').jqGrid('editRow', id, true);
}
});
$('#tblTargetDetails').jqGrid('navGrid', '#pnlTargetDetails', { search:
true, edit: false, add: false, del: false });
$('#tblTargetDetails').jqGrid('filterToolbar', { stringResult: true,
searchOnEnter: false });
Appreciate your kind help in advance.
Thanks.
I am trying to enable the client-side searching feature of the jqGrid
through the filterToolbar method, yet I am unable to make it work. The
grid is loading data correctly through JSON that is being returned from an
asmx service on page load (document.ready), yet when I try to search
through any of the columns using the search toolbar, the grid only
refreshes without searching.
I have already checked other similar questions and their answers, but none
of them helped me solve my issue. Maybe someone can check my jqGrid script
below and tell me what is wrong with it or what is there missing. For the
reference, I am using the version "4.5.2" of jqGrid.
$('#tblTargetDetails').jqGrid({
url: 'PostHandlers/CommonHandler.asmx/GetTargetDetails',
datatype: 'json',
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
ajaxRowOptions: { contentType: "application/json; charset=utf-8",
dataType: "json" },
postData: "{'TargetID': '" + TargetID + "'}",
mtype: 'POST',
colNames: ['Team ID', 'Member UserID', 'Measure', 'Product', 'Month1',
'Month2'],
colModel: [
{ name: 'TeamID', index: 'TeamID', width: 55, search: true,
sorttype: 'int' },
{ name: 'MemberUserID', index: 'MemberUserID', width: 90, search:
true, stype: 'text' },
{ name: 'Measure', index: 'Measure', width: 90, search: true,
searchoptions: {} },
{ name: 'Product', index: 'Product', width: 90, search: true },
{ name: 'Month1', index: 'Month1', width: 80, editable: true,
search: true },
{ name: 'Month2', index: 'Month2', width: 80, editable: true,
search: false }],
jsonReader: {
root: "d.TargetDetails",
records: "d.RecordsCount",
id: "ID",
cell: "",
page: function () { return 1; },
total: function () { return 1; },
},
pager: '#pnlTargetDetails',
rowNum: 50,
rowTotal: 2000,
rowList: [20, 30, 50],
loadonce: true,
viewrecords: true,
gridview: true,
ignoreCase: true,
rownumbers: true,
caption: 'Target Details',
editurl: 'PostHandlers/CommonHandler.asmx/EditTargetDetail',
serializeRowData: function (postData) {
return JSON.stringify({ 'content': JSON.stringify(postData),
'UserID': UserID });
},
onSelectRow: function (id) {
if (id && id !== lastSel) {
$('#tblTargetDetails').restoreRow(lastSel);
lastSel = id;
}
$('#tblTargetDetails').jqGrid('editRow', id, true);
}
});
$('#tblTargetDetails').jqGrid('navGrid', '#pnlTargetDetails', { search:
true, edit: false, add: false, del: false });
$('#tblTargetDetails').jqGrid('filterToolbar', { stringResult: true,
searchOnEnter: false });
Appreciate your kind help in advance.
Thanks.
Create PDF File using C# without using Third Party API
Create PDF File using C# without using Third Party API
I want to create PDF file with data from stored procedure.
I do not want to use any third party component or dll.
please advice me a simple c#.net code to make this possible.
Thanks in advance.
Regards, AGM Raja
I want to create PDF file with data from stored procedure.
I do not want to use any third party component or dll.
please advice me a simple c#.net code to make this possible.
Thanks in advance.
Regards, AGM Raja
Suppress successes in Play! framework test runner
Suppress successes in Play! framework test runner
Running play test is spammy.
How can I configure it to, by default, only show when tests fail, and then
give a summary of a number of passed.
In Build.scala I've tried various permutations of...
testOptions in Test += Tests.Argument("-oq", "junitxml", "console")
// or
testOptions in Test += Tests.Argument("-oS", "junitxml", "console")
but none of them seem to work. How can this be accomplished?
Running play test is spammy.
How can I configure it to, by default, only show when tests fail, and then
give a summary of a number of passed.
In Build.scala I've tried various permutations of...
testOptions in Test += Tests.Argument("-oq", "junitxml", "console")
// or
testOptions in Test += Tests.Argument("-oS", "junitxml", "console")
but none of them seem to work. How can this be accomplished?
Paging partialview with PagdList
Paging partialview with PagdList
i have a partialview that has tabular data.. i am using PagedList for paging.
it works good with a normal view, but when I tried to put it on a partial
view, when I click next or any other pages, it just refreshes the whole
page and my view breaks :(
I want to refresh the partialview only meaning when I perform pagination,
i just want to change the partialview not the whole view.
this is the code for pagination i my partialview...
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of
@Model.PageCount
@Html.PagedListPager( Model, page => Url.Action("StudentList", new { page,
sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter }) )
i tried to put Ajax.ActionLink instead of Url.Action with no success...
any help??
i have a partialview that has tabular data.. i am using PagedList for paging.
it works good with a normal view, but when I tried to put it on a partial
view, when I click next or any other pages, it just refreshes the whole
page and my view breaks :(
I want to refresh the partialview only meaning when I perform pagination,
i just want to change the partialview not the whole view.
this is the code for pagination i my partialview...
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of
@Model.PageCount
@Html.PagedListPager( Model, page => Url.Action("StudentList", new { page,
sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter }) )
i tried to put Ajax.ActionLink instead of Url.Action with no success...
any help??
Checking multiple conditions in If statement in crystal report
Checking multiple conditions in If statement in crystal report
I am new to Crystal reports. In programming (Ex. in c), I can check two
conditions in one single if statement. ex. if(A && B) How this can be done
in CR?
I am new to Crystal reports. In programming (Ex. in c), I can check two
conditions in one single if statement. ex. if(A && B) How this can be done
in CR?
Update a progressbar when steps are arbitrary
Update a progressbar when steps are arbitrary
I am writing a C# application where I process lines in a file. The file
may have 2 lines, 30, 80, maybe over a hundred lines.
The lines are stored in a list, so I can get the line count from
myFileList.Count. The progressbar only takes int as arguments to the
value, so if I have line number of say 50, I could easily do
int steps = 100/myFileList.Count
progress += steps;
updateProgressBar ( progress );
But what if my file has say 61 lines: 100/61 = 1,64, hence int steps will
be equal to 1 and my progress bar will stop at 61 percent. How can I do
this correctly?
I am writing a C# application where I process lines in a file. The file
may have 2 lines, 30, 80, maybe over a hundred lines.
The lines are stored in a list, so I can get the line count from
myFileList.Count. The progressbar only takes int as arguments to the
value, so if I have line number of say 50, I could easily do
int steps = 100/myFileList.Count
progress += steps;
updateProgressBar ( progress );
But what if my file has say 61 lines: 100/61 = 1,64, hence int steps will
be equal to 1 and my progress bar will stop at 61 percent. How can I do
this correctly?
Wednesday, 18 September 2013
Undefined index in file while uploading image
Undefined index in file while uploading image
I am trying to create a form where a user can upload images. I'm using php
for validation of this file to see whether it is an image file or not but
I am getting an error
"Undefined index file.."
I can't understand what's wrong.. Please help
HTML code..
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="photo" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
PHP code...
<?php
if ((($_FILES["photo"]["type"] == "image/gif")
|| ($_FILES["photo"]["type"] == "image/jpeg")
|| ($_FILES["photo"]["type"] == "image/png"))
&& ($_FILES["photo"]["size"] < 1000000))
{
if ($_FILES["photo"]["error"] > 0)
{
echo "Return Code: " . $_FILES["photo"]["error"] . " ";
}
else
{
echo "Upload: " . $_FILES["photo"]["name"] . "";
echo "Type: " . $_FILES["photo"]["type"] . "";
echo "Size: " . ($_FILES["photo"]["size"] / 1024) . " Kb";
echo "Temp file: " . $_FILES["photo"]["tmp_name"] . "";
if (file_exists("users/" . $_FILES["photo"]["name"]))
{
echo $_FILES["photo"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["photo"]["tmp… "users/" .
$_FILES["photo"]["name"]);
echo "Stored in: " . "users/" . $_FILES["photo"]["name"];
}
}
else
{
echo "Invalid file";
}
?>
I am trying to create a form where a user can upload images. I'm using php
for validation of this file to see whether it is an image file or not but
I am getting an error
"Undefined index file.."
I can't understand what's wrong.. Please help
HTML code..
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="photo" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
PHP code...
<?php
if ((($_FILES["photo"]["type"] == "image/gif")
|| ($_FILES["photo"]["type"] == "image/jpeg")
|| ($_FILES["photo"]["type"] == "image/png"))
&& ($_FILES["photo"]["size"] < 1000000))
{
if ($_FILES["photo"]["error"] > 0)
{
echo "Return Code: " . $_FILES["photo"]["error"] . " ";
}
else
{
echo "Upload: " . $_FILES["photo"]["name"] . "";
echo "Type: " . $_FILES["photo"]["type"] . "";
echo "Size: " . ($_FILES["photo"]["size"] / 1024) . " Kb";
echo "Temp file: " . $_FILES["photo"]["tmp_name"] . "";
if (file_exists("users/" . $_FILES["photo"]["name"]))
{
echo $_FILES["photo"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["photo"]["tmp… "users/" .
$_FILES["photo"]["name"]);
echo "Stored in: " . "users/" . $_FILES["photo"]["name"];
}
}
else
{
echo "Invalid file";
}
?>
echo quey result with single field
echo quey result with single field
Please help. I need to print result of this query but nothing appears
$fetch_a = "SELECT programs.Program_Description FROM programs WHERE
programs.Programid = ('SELECT memberprogram.Programid FROM memberprogram
WHERE memberprogram.Memberid = $Memberid && memberprogram.Option_No =
'Option A'')";
$result_a = mysqli_query($dbc, $fetch_a);
echo $result_a;
Please help. I need to print result of this query but nothing appears
$fetch_a = "SELECT programs.Program_Description FROM programs WHERE
programs.Programid = ('SELECT memberprogram.Programid FROM memberprogram
WHERE memberprogram.Memberid = $Memberid && memberprogram.Option_No =
'Option A'')";
$result_a = mysqli_query($dbc, $fetch_a);
echo $result_a;
Updating status of a growing file without close/reopen
Updating status of a growing file without close/reopen
Suppose I open() a file on a *nix machine and I hit eof. But when I
open()ed it, it was still being written.
Is there a way to detect if the file has grown since open()-time? Or do I
need to close() and re-open() to check?
Suppose I open() a file on a *nix machine and I hit eof. But when I
open()ed it, it was still being written.
Is there a way to detect if the file has grown since open()-time? Or do I
need to close() and re-open() to check?
Python - Getting the word between two tags
Python - Getting the word between two tags
I have this string:
História do RFID A tecnologia de <EM ID="hub-30518" CATEG="PESSOA">RFID
</EM>tem suas raízes nos sistemas de radares
And I want to get what is between CATEG="(what I want to get)", and
between ">(what I want to get), in this case the result would be PESSOA
and RFID.
How can I do it?
Thanks
I have this string:
História do RFID A tecnologia de <EM ID="hub-30518" CATEG="PESSOA">RFID
</EM>tem suas raízes nos sistemas de radares
And I want to get what is between CATEG="(what I want to get)", and
between ">(what I want to get), in this case the result would be PESSOA
and RFID.
How can I do it?
Thanks
Paperclip Ralis 4 Reprocess attr_accessor
Paperclip Ralis 4 Reprocess attr_accessor
My rails 4 application is having some issues with the paperclip reprocess
method. I have a custom Cropper module:
module Paperclip
class Cropper < Thumbnail
def transformation_command
if crop_command
crop_command + super.sub(/ -crop \S+/, '')
else
super
end
end
def crop_command
target = @attachment.instance
if target.cropping?
ratio = target.avatar_geometry(:original).width /
target.avatar_geometry(:large).width
["-crop",
"#{(target.crop_w.to_i*ratio).round}x#{(target.crop_h.to_i*ratio).round}+#{(target.crop_x.to_i*ratio).round}+#{(target.crop_y.to_i*ratio).round}"]
end
end
end
end
And I have a few attr_accessors for the crop_x, crop_y, crop_w, crop_h.
I'm running into an issue with having crop_x, y, w, and h available when
it hits the cropper class. Those elements are always nil even if in the
controler (during the update method) that these aren't nil.
I believe this has to do with them be attr_accessors, so I'm looking for
some advice as to how to handle this.
My rails 4 application is having some issues with the paperclip reprocess
method. I have a custom Cropper module:
module Paperclip
class Cropper < Thumbnail
def transformation_command
if crop_command
crop_command + super.sub(/ -crop \S+/, '')
else
super
end
end
def crop_command
target = @attachment.instance
if target.cropping?
ratio = target.avatar_geometry(:original).width /
target.avatar_geometry(:large).width
["-crop",
"#{(target.crop_w.to_i*ratio).round}x#{(target.crop_h.to_i*ratio).round}+#{(target.crop_x.to_i*ratio).round}+#{(target.crop_y.to_i*ratio).round}"]
end
end
end
end
And I have a few attr_accessors for the crop_x, crop_y, crop_w, crop_h.
I'm running into an issue with having crop_x, y, w, and h available when
it hits the cropper class. Those elements are always nil even if in the
controler (during the update method) that these aren't nil.
I believe this has to do with them be attr_accessors, so I'm looking for
some advice as to how to handle this.
Amazon SNS dynamic topics case scenario
Amazon SNS dynamic topics case scenario
In my case scenario I need to send push notifications every time a user
posts a new message into a thread. It's like a mobile app forum. You can
post messages into threads and then you can reply messages. I'm trying to
migrate from custom APNS code to Amazon SNS in order to simplify and get
rid of code manteinance. But as far as I know, I need topics to publish
push notifications in order to deliver a push to all the people inside a
discussion thread.
In my custom approach, I send the device tokens to an async task and
deliver that bulk of messages in one APNS connection. Thus, this is like a
"dynamic topic" I'm generating each time a new message is posted into a
thread (I notify all the participants of a thread, and that number should
be able to scale from a few to thousands).
How can this approach be done with Amazon SNS? Do I have to create a topic
for each thread? Instead of connecting and writing all the push messages
into APNS, can I mantain this approach with Amazon SNS only knowing the
device token of the receivers?
In my case scenario I need to send push notifications every time a user
posts a new message into a thread. It's like a mobile app forum. You can
post messages into threads and then you can reply messages. I'm trying to
migrate from custom APNS code to Amazon SNS in order to simplify and get
rid of code manteinance. But as far as I know, I need topics to publish
push notifications in order to deliver a push to all the people inside a
discussion thread.
In my custom approach, I send the device tokens to an async task and
deliver that bulk of messages in one APNS connection. Thus, this is like a
"dynamic topic" I'm generating each time a new message is posted into a
thread (I notify all the participants of a thread, and that number should
be able to scale from a few to thousands).
How can this approach be done with Amazon SNS? Do I have to create a topic
for each thread? Instead of connecting and writing all the push messages
into APNS, can I mantain this approach with Amazon SNS only knowing the
device token of the receivers?
Multiuser XDebug with DBGp proxy
Multiuser XDebug with DBGp proxy
In my office there are two programmers, working on the same project. We
want to use the debugger, but in the php.ini I can only set one
remote_port (9000)
This is why dbgp proxy borned. I worked based on this tutorial:
http://matthardy.net/blog/configuring-phpstorm-xdebug-dbgp-proxy-settings-remote-debugging-multiple-users/
I installed it on the server, and started the proxy with this command:
./pydbgpproxy -i 0.0.0.0:8999 -d 9000
The IDE settings:
PHPStorm 1:
XDebug port: 9001
DBGp proxy IDE key: PHPSTORM
DBGp proxy Port: 8999
PHPStorm 2:
XDebug port: 9002
DBGp proxy IDE key: PHPSTORM2
DBGp proxy Port: 8999
I registered both of the IDE, and I've got message: successful
The result of the debugging test: PHPStorm 2 is working (this is
registered first), but PHPStorm 1 is not
Port 9001 and 9002 are forwarded to the computers in the router.
So this is my problem, I hope you can help me.
In my office there are two programmers, working on the same project. We
want to use the debugger, but in the php.ini I can only set one
remote_port (9000)
This is why dbgp proxy borned. I worked based on this tutorial:
http://matthardy.net/blog/configuring-phpstorm-xdebug-dbgp-proxy-settings-remote-debugging-multiple-users/
I installed it on the server, and started the proxy with this command:
./pydbgpproxy -i 0.0.0.0:8999 -d 9000
The IDE settings:
PHPStorm 1:
XDebug port: 9001
DBGp proxy IDE key: PHPSTORM
DBGp proxy Port: 8999
PHPStorm 2:
XDebug port: 9002
DBGp proxy IDE key: PHPSTORM2
DBGp proxy Port: 8999
I registered both of the IDE, and I've got message: successful
The result of the debugging test: PHPStorm 2 is working (this is
registered first), but PHPStorm 1 is not
Port 9001 and 9002 are forwarded to the computers in the router.
So this is my problem, I hope you can help me.
Tuesday, 17 September 2013
Adding dynamic value to select option - trac
Adding dynamic value to select option - trac
I started using Trac as ticketing system recently. I have few
requirements. I need to add list of some users using a select option. But
according to Trac CustomFields, I can add only static values.
Is there any way so that I could add values dynamically? So that I can
access my db and list all users from my db.
I started using Trac as ticketing system recently. I have few
requirements. I need to add list of some users using a select option. But
according to Trac CustomFields, I can add only static values.
Is there any way so that I could add values dynamically? So that I can
access my db and list all users from my db.
The constructor Intent(FragmentTab1, Class) is undefined
The constructor Intent(FragmentTab1, Class) is undefined
i'm working on a app that has swipe tabs inside the tabs there is buttons
so for example fragmenttab1 has Algabra button i want it when the user
clicks this button it takes them to AlgabraHome.class
AlgabraHome.class
package com.androidbegin.absviewpagertutorial;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.content.Intent;
import com.actionbarsherlock.app.SherlockFragment;
public class FragmentTab1 extends SherlockFragment {
private Button btn;
private Button btn2;
private Button btn3;
private Button btn4;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Get the view from fragmenttab1.xml
View view = inflater.inflate(R.layout.fragmenttab1, container,
false);
btn = (Button) view.findViewById(R.id.algabra);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(FragmentTab1.this, AlgbraHome.class);
startActivity(intent);
}
return view;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
setUserVisibleHint(true);
}
}
I keep getting the flowing errors:
Description Resource Path Location Type
Syntax error, insert "}" to complete ClassBody FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 35 Java Problem
The constructor Intent(FragmentTab1, Class<AlgbraHome>) is undefined
FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 32 Java Problem
Syntax error, insert ")" to complete MethodInvocation FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 35 Java
Problem
ive tried goggling it and no luck
please help if you can
Thanks way in advance
Regards Rapsong11
i'm working on a app that has swipe tabs inside the tabs there is buttons
so for example fragmenttab1 has Algabra button i want it when the user
clicks this button it takes them to AlgabraHome.class
AlgabraHome.class
package com.androidbegin.absviewpagertutorial;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.content.Intent;
import com.actionbarsherlock.app.SherlockFragment;
public class FragmentTab1 extends SherlockFragment {
private Button btn;
private Button btn2;
private Button btn3;
private Button btn4;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Get the view from fragmenttab1.xml
View view = inflater.inflate(R.layout.fragmenttab1, container,
false);
btn = (Button) view.findViewById(R.id.algabra);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(FragmentTab1.this, AlgbraHome.class);
startActivity(intent);
}
return view;
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
setUserVisibleHint(true);
}
}
I keep getting the flowing errors:
Description Resource Path Location Type
Syntax error, insert "}" to complete ClassBody FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 35 Java Problem
The constructor Intent(FragmentTab1, Class<AlgbraHome>) is undefined
FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 32 Java Problem
Syntax error, insert ")" to complete MethodInvocation FragmentTab1.java
/School Tools/src/com/androidbegin/absviewpagertutorial line 35 Java
Problem
ive tried goggling it and no luck
please help if you can
Thanks way in advance
Regards Rapsong11
IOS / Android: Can I retrieve clickthrough data from inside an app?
IOS / Android: Can I retrieve clickthrough data from inside an app?
I'm trying to find a way to figure out how to retrieve clickthrough
information to figure out which ad / link was clicked to direct a person
to download it.
Say we have the following situation:
User sees an ad for the app.
They click it
It directs them to the app store, and they download it from there.
They run the app
Is there any way at all to figure out the source of the click in step 2?
This is for advertising analytics - we want to know where our clicks are
coming from.
I know that the site visited in step 1 can theoretically retrieve device
data and link it up to device data retrieved by the app. However, we're
looking for a more direct approach.
I've had a great deal of difficulty locating information on this, so any
assistance would be appreciated.
We're using the Flurry API on IOS and Android.
Thanks!
I'm trying to find a way to figure out how to retrieve clickthrough
information to figure out which ad / link was clicked to direct a person
to download it.
Say we have the following situation:
User sees an ad for the app.
They click it
It directs them to the app store, and they download it from there.
They run the app
Is there any way at all to figure out the source of the click in step 2?
This is for advertising analytics - we want to know where our clicks are
coming from.
I know that the site visited in step 1 can theoretically retrieve device
data and link it up to device data retrieved by the app. However, we're
looking for a more direct approach.
I've had a great deal of difficulty locating information on this, so any
assistance would be appreciated.
We're using the Flurry API on IOS and Android.
Thanks!
Excluding groups from a resultset using criteria in that resultset
Excluding groups from a resultset using criteria in that resultset
Using SQL Server 2008.
We are given a Code, say 020286 that gives us a starting resultset.
Starting data:
Code L R G
020286 2 703 1
030383 3 6 0
031847 4 5 0
021932 7 10 0
022499 8 9 0
020068 229 610 1
020866 231 396 1
020524 232 241 0
030772 233 234 0
031787 235 236 0
031859 237 238 0
031947 239 240 0
020964 242 383 1
021215 253 342 1
030728 343 344 0
020990 345 346 0
022521 347 354 0
Now I want to exclude rows whose L is between L and R of any rows whose
G=1 (in the same resultset) excepting the given Code (essentially do "L
between L and R" for all G=1 except the given Code), while still keeping
all G=1. Expected results:
Code L R G
020286 2 703 1
030383 3 6 0
031847 4 5 0
021932 7 10 0
022499 8 9 0
020068 229 610 1
020866 231 396 1
020964 242 383 1
021215 253 342 1
030728 343 344 0
020990 345 346 0
022521 347 354 0
Here is a table var with starting data.
declare @t table (Code nvarchar(10),L int, R int, G int)
insert into @t (Code, L, R, G)
select '020286',2,703,1 union
select '030383',3,6,0 union
select '031847',4,5,0 union
select '021932',7,10,0 union
select '022499',8,9,0 union
select '020068',229,610,1 union
select '020866',231,396,1 union
select '020524',232,241,0 union
select '030772',233,234,0 union
select '031787',235,236,0 union
select '031859',237,238,0 union
select '031947',239,240,0 union
select '020964',242,383,1 union
select '021215',253,342,1 union
select '030728',343,344,0 union
select '020990',345,346,0 union
select '022521',347,354,0
select * from @t
Using SQL Server 2008.
We are given a Code, say 020286 that gives us a starting resultset.
Starting data:
Code L R G
020286 2 703 1
030383 3 6 0
031847 4 5 0
021932 7 10 0
022499 8 9 0
020068 229 610 1
020866 231 396 1
020524 232 241 0
030772 233 234 0
031787 235 236 0
031859 237 238 0
031947 239 240 0
020964 242 383 1
021215 253 342 1
030728 343 344 0
020990 345 346 0
022521 347 354 0
Now I want to exclude rows whose L is between L and R of any rows whose
G=1 (in the same resultset) excepting the given Code (essentially do "L
between L and R" for all G=1 except the given Code), while still keeping
all G=1. Expected results:
Code L R G
020286 2 703 1
030383 3 6 0
031847 4 5 0
021932 7 10 0
022499 8 9 0
020068 229 610 1
020866 231 396 1
020964 242 383 1
021215 253 342 1
030728 343 344 0
020990 345 346 0
022521 347 354 0
Here is a table var with starting data.
declare @t table (Code nvarchar(10),L int, R int, G int)
insert into @t (Code, L, R, G)
select '020286',2,703,1 union
select '030383',3,6,0 union
select '031847',4,5,0 union
select '021932',7,10,0 union
select '022499',8,9,0 union
select '020068',229,610,1 union
select '020866',231,396,1 union
select '020524',232,241,0 union
select '030772',233,234,0 union
select '031787',235,236,0 union
select '031859',237,238,0 union
select '031947',239,240,0 union
select '020964',242,383,1 union
select '021215',253,342,1 union
select '030728',343,344,0 union
select '020990',345,346,0 union
select '022521',347,354,0
select * from @t
Return value from actionscript 2 function
Return value from actionscript 2 function
I have this function structure:
function doStuff():Boolean {
variables = new LoadVars();
variables.anything = "xxx";
variables.onLoad = function(success) {
if (success) {
doStuff;
results = true;
} else {
results = false;
}
};
variables.sendAndLoad(url, variables, "POST");
return results;
}
Function works fine, but can´t return properly the 'results' value. Any idea?
I have this function structure:
function doStuff():Boolean {
variables = new LoadVars();
variables.anything = "xxx";
variables.onLoad = function(success) {
if (success) {
doStuff;
results = true;
} else {
results = false;
}
};
variables.sendAndLoad(url, variables, "POST");
return results;
}
Function works fine, but can´t return properly the 'results' value. Any idea?
Sunday, 15 September 2013
Accessing element of an array of struct.
Accessing element of an array of struct.
So I have an struct
struct car{
string ownerName;
float price;
int year;
};
and I declared an array of these structs car *cars = new car[1000] Each
car has an index, for example, the car with index 0 has name John Smith.
So, my question is knowing the name of the owner how do I access the index
of the car. I know that the other way i would write cars[0].name, to get
the name, but how would i do it backwards?
So I have an struct
struct car{
string ownerName;
float price;
int year;
};
and I declared an array of these structs car *cars = new car[1000] Each
car has an index, for example, the car with index 0 has name John Smith.
So, my question is knowing the name of the owner how do I access the index
of the car. I know that the other way i would write cars[0].name, to get
the name, but how would i do it backwards?
Scala reflection and type parameters
Scala reflection and type parameters
I am trying to build a reflection based selector that checks if the value
of the field in the case class or result of parameterless method matches
required value.
Case class hierarchy:
trait Event {
def eventType: String
def eventName: String = this.getClass.getSimpleName
}
trait VCSEvent extends Event {
def eventType: String = "VCS"
}
case class BranchAdded(branch: String) extends VCSEvent
So, BranchAdded("develop").eventName == "BranchAdded", and
BranchAdded("develop").branch == "develop"
The matcher itself is pretty simple:
case class EventSelector(ops: List[EventSelectorOp]) {
def matches(event: Event): Boolean = {
ops.map {
op Ë op.matches(event)
}.reduceLeft(_ & _)
}
}
trait EventSelectorOp {
def matches[T <: Event](event: T)(implicit tag: ru.TypeTag[T], classtag:
ClassTag[T]): Boolean
}
case class FieldEventSelectorOp(field: String, operation: Symbol, value:
Any) extends EventSelectorOp {
def getTypeTag[T: ru.TypeTag](obj: T) = ru.typeTag[T]
def matches[T <: Event](event: T)(implicit tag: ru.TypeTag[T], classtag:
ClassTag[T]): Boolean = {
val mirror = ru.runtimeMirror(event.getClass.getClassLoader)
val memberSymbol = tag.tpe.member(ru.newTermName(field))
if (memberSymbol.name.decoded.equals("<none>"))
return false
val fieldValue = if (memberSymbol.isMethod) {
mirror.reflect(event).reflectMethod(memberSymbol.asMethod).apply()
} else {
mirror.reflect(event).reflectField(memberSymbol.asTerm).get
}
operation match {
case 'eq Ë fieldValue.equals(value)
case _ Ë false
}
}
}
Now, the magic starts in testing:
class EventSelectorOpSpec extends WordSpec with ShouldMatchers {
"FieldEventSelectorOp" should {
"match correct paremeterless method" in {
FieldEventSelectorOp("eventName", 'eq,
"BranchAdded").matches(BranchAdded("develop")) should be(true)
}
"not match incorrect parameterless method" in {
FieldEventSelectorOp("eventName", 'eq,
"BranchAdded").matches(Initialize) should be(false)
}
"match field by name" in {
FieldEventSelectorOp("branch", 'eq,
"develop").matches(BranchAdded("develop")) should be(true)
}
"not match existing field with wrong value" in {
FieldEventSelectorOp("branch", 'eq,
"master").matches(BranchAdded("develop")) should be(false)
}
"not match non-existing field by name" in {
FieldEventSelectorOp("branch2", 'eq,
"develop").matches(BranchAdded("develop")) should be(false)
}
}
"EventSelector" should {
"match when all of multiple selectors match" in {
val op1 = FieldEventSelectorOp("eventName", 'eq, "BranchAdded")
val op2 = FieldEventSelectorOp("branch" , 'eq, "develop")
val event = BranchAdded("develop")
val selector = EventSelector(List(op1, op2))
selector.matches(event) should be(true)
}
}
}
In the spec above, all tests in FieldEventSelectorOp part pass, at the
same time last test fails - memberSymbol.name.decoded in the last test is
"" and the tag.tpe.erasure is "Event"
Why is this happening?
I am trying to build a reflection based selector that checks if the value
of the field in the case class or result of parameterless method matches
required value.
Case class hierarchy:
trait Event {
def eventType: String
def eventName: String = this.getClass.getSimpleName
}
trait VCSEvent extends Event {
def eventType: String = "VCS"
}
case class BranchAdded(branch: String) extends VCSEvent
So, BranchAdded("develop").eventName == "BranchAdded", and
BranchAdded("develop").branch == "develop"
The matcher itself is pretty simple:
case class EventSelector(ops: List[EventSelectorOp]) {
def matches(event: Event): Boolean = {
ops.map {
op Ë op.matches(event)
}.reduceLeft(_ & _)
}
}
trait EventSelectorOp {
def matches[T <: Event](event: T)(implicit tag: ru.TypeTag[T], classtag:
ClassTag[T]): Boolean
}
case class FieldEventSelectorOp(field: String, operation: Symbol, value:
Any) extends EventSelectorOp {
def getTypeTag[T: ru.TypeTag](obj: T) = ru.typeTag[T]
def matches[T <: Event](event: T)(implicit tag: ru.TypeTag[T], classtag:
ClassTag[T]): Boolean = {
val mirror = ru.runtimeMirror(event.getClass.getClassLoader)
val memberSymbol = tag.tpe.member(ru.newTermName(field))
if (memberSymbol.name.decoded.equals("<none>"))
return false
val fieldValue = if (memberSymbol.isMethod) {
mirror.reflect(event).reflectMethod(memberSymbol.asMethod).apply()
} else {
mirror.reflect(event).reflectField(memberSymbol.asTerm).get
}
operation match {
case 'eq Ë fieldValue.equals(value)
case _ Ë false
}
}
}
Now, the magic starts in testing:
class EventSelectorOpSpec extends WordSpec with ShouldMatchers {
"FieldEventSelectorOp" should {
"match correct paremeterless method" in {
FieldEventSelectorOp("eventName", 'eq,
"BranchAdded").matches(BranchAdded("develop")) should be(true)
}
"not match incorrect parameterless method" in {
FieldEventSelectorOp("eventName", 'eq,
"BranchAdded").matches(Initialize) should be(false)
}
"match field by name" in {
FieldEventSelectorOp("branch", 'eq,
"develop").matches(BranchAdded("develop")) should be(true)
}
"not match existing field with wrong value" in {
FieldEventSelectorOp("branch", 'eq,
"master").matches(BranchAdded("develop")) should be(false)
}
"not match non-existing field by name" in {
FieldEventSelectorOp("branch2", 'eq,
"develop").matches(BranchAdded("develop")) should be(false)
}
}
"EventSelector" should {
"match when all of multiple selectors match" in {
val op1 = FieldEventSelectorOp("eventName", 'eq, "BranchAdded")
val op2 = FieldEventSelectorOp("branch" , 'eq, "develop")
val event = BranchAdded("develop")
val selector = EventSelector(List(op1, op2))
selector.matches(event) should be(true)
}
}
}
In the spec above, all tests in FieldEventSelectorOp part pass, at the
same time last test fails - memberSymbol.name.decoded in the last test is
"" and the tag.tpe.erasure is "Event"
Why is this happening?
Out-of-line definition of base class' nested class
Out-of-line definition of base class' nested class
Is the following code valid?
class A
{
class nested;
};
class B : public A {};
class B::nested {};
gcc accepts it, but clang rejects it with the following error:
test.cpp:8:14: error: no class named 'nested' in 'B'
class B::nested {};
~~~^
Is the following code valid?
class A
{
class nested;
};
class B : public A {};
class B::nested {};
gcc accepts it, but clang rejects it with the following error:
test.cpp:8:14: error: no class named 'nested' in 'B'
class B::nested {};
~~~^
How to calculate (ax+by+cz=0) this type of equation in c++?
How to calculate (ax+by+cz=0) this type of equation in c++?
Consider these three equation
a1x+b1y+c1z=0
a2x+b2y+c2z=0
a3x+b3y+c3z=0
a1,a2,a3,b1,b2,b3,c1,c2,c3 are given
Now what is x,y,z?
I want to code it in c++ and need logic. Some one told me about iterative
method but i can't understand what is iterative method.
Can anyone help me, please.
Consider these three equation
a1x+b1y+c1z=0
a2x+b2y+c2z=0
a3x+b3y+c3z=0
a1,a2,a3,b1,b2,b3,c1,c2,c3 are given
Now what is x,y,z?
I want to code it in c++ and need logic. Some one told me about iterative
method but i can't understand what is iterative method.
Can anyone help me, please.
Jquery dialog boxes for more than one images using php while
Jquery dialog boxes for more than one images using php while
I have make an image list of ten thumbnails using php while and when user
click on them takes a dialog box with the original image in size. My
problem is that only first picture's thumbnail gives dialog box... When
user click on the rest thumbnails, just get nothing! I am sure that
something is wrong with jquery code but I can't imagine what! Any idea?
My PHP code:
<?php $count=1; while ($count <= 10){
$image_url = $variable->{'photo'.$count}; ?>
<!-- 01. PHOTO VIEWER -->
<div id="viewer_img">
<img src="<?php echo $image_url; ?>" alt="IMAGE <?php echo $count; ?>" />
</div>
<!-- 01. END -->
<!-- 02. PHOTO OPENER -->
<div id="opener_img"> </div>
<!-- 02. END -->
<?php $A1++; }?>
My jQuery code:
var $JQ_ = jQuery.noConflict();
$JQ_(function(){
$JQ_('[id^="viewer"]').dialog({autoOpen:false,
draggable:false,
resizable:false,
modal:true,
position:['center',10],
width:'590',
height:'370',
show:{effect:"fade", duration:250},
hide:{effect:"fade", duration:250}});
$JQ_("#opener_img").click(function(){$JQ_("#viewer_img").dialog("open");});
});
I have make an image list of ten thumbnails using php while and when user
click on them takes a dialog box with the original image in size. My
problem is that only first picture's thumbnail gives dialog box... When
user click on the rest thumbnails, just get nothing! I am sure that
something is wrong with jquery code but I can't imagine what! Any idea?
My PHP code:
<?php $count=1; while ($count <= 10){
$image_url = $variable->{'photo'.$count}; ?>
<!-- 01. PHOTO VIEWER -->
<div id="viewer_img">
<img src="<?php echo $image_url; ?>" alt="IMAGE <?php echo $count; ?>" />
</div>
<!-- 01. END -->
<!-- 02. PHOTO OPENER -->
<div id="opener_img"> </div>
<!-- 02. END -->
<?php $A1++; }?>
My jQuery code:
var $JQ_ = jQuery.noConflict();
$JQ_(function(){
$JQ_('[id^="viewer"]').dialog({autoOpen:false,
draggable:false,
resizable:false,
modal:true,
position:['center',10],
width:'590',
height:'370',
show:{effect:"fade", duration:250},
hide:{effect:"fade", duration:250}});
$JQ_("#opener_img").click(function(){$JQ_("#viewer_img").dialog("open");});
});
Using Word Built in styles with Excel VBA
Using Word Built in styles with Excel VBA
I'm trying to write to a word document from Excel using VBA. However when
i try to apply the style heading 1 to the text it has to be English
version of Office. How can i refer to the built in styles of office?
This is what i got now:
wrdApp.Selection.Style = "Heading 1"
wrdApp.Selection.TypeText Text:= "Test heading
I want something similar to this (to make it international), however this
does not work:
wrdApp.Selection.Style = WdBuiltinStyle.wdStyleHeading1
wrdApp.Selection.TypeText Text:= "Test heading
Any tip or answer or constructive comment is appreciated. :)
I'm trying to write to a word document from Excel using VBA. However when
i try to apply the style heading 1 to the text it has to be English
version of Office. How can i refer to the built in styles of office?
This is what i got now:
wrdApp.Selection.Style = "Heading 1"
wrdApp.Selection.TypeText Text:= "Test heading
I want something similar to this (to make it international), however this
does not work:
wrdApp.Selection.Style = WdBuiltinStyle.wdStyleHeading1
wrdApp.Selection.TypeText Text:= "Test heading
Any tip or answer or constructive comment is appreciated. :)
which Eclipse is required to download for java SE?
which Eclipse is required to download for java SE?
sir can you tell me for java SE(Core java), which eclipse is required to
download? i don't waste my MB and time..i am beginner in java, here's are
a lot http://www.eclipse.org/downloads/
sir can you tell me for java SE(Core java), which eclipse is required to
download? i don't waste my MB and time..i am beginner in java, here's are
a lot http://www.eclipse.org/downloads/
Js search for dynamic contents
Js search for dynamic contents
I have a js function like below, Which load date from mysql database, The
"date" result is some thing like this "2013-11-09", I want to keep a
search box for this like Month:jan, feb, etc... Year:2013,2014 etc... both
are drop down list. then a go button, And when select a specific month and
specific year, it should display only that particular month and year
events . How can i do this. Thanks in Advance.
onClick: function () {
$.ajax({
type: 'POST',
url: 'data.php',
dataType: 'json',
success: function (data) {
var res = [];
for (var i in data) {
var rows = data[i];
res.push({
event_name: rows[0],
date: rows[1],
venue:rows[2]
});
}
viewModel.dSource(res);
}
});
}
};
I have a js function like below, Which load date from mysql database, The
"date" result is some thing like this "2013-11-09", I want to keep a
search box for this like Month:jan, feb, etc... Year:2013,2014 etc... both
are drop down list. then a go button, And when select a specific month and
specific year, it should display only that particular month and year
events . How can i do this. Thanks in Advance.
onClick: function () {
$.ajax({
type: 'POST',
url: 'data.php',
dataType: 'json',
success: function (data) {
var res = [];
for (var i in data) {
var rows = data[i];
res.push({
event_name: rows[0],
date: rows[1],
venue:rows[2]
});
}
viewModel.dSource(res);
}
});
}
};
Saturday, 14 September 2013
How to Generate a C# Event Handler Stub from Visual Studio 2012 Source view?
How to Generate a C# Event Handler Stub from Visual Studio 2012 Source view?
Many times the signature of a control's event handler isn't obvious.
Currently, in order to generate an event handler stub in the code behind I
have to
Leave Source view and enter Design view (and wait for the UI to be generated)
Click on the control in question (which sometimes isn't obvious)
Open the Properties toolbar
Click on the lightning bolt
Double-click on the event for which I want to generate a stub
Is there an easier way to do this while still in Source view?
Many times the signature of a control's event handler isn't obvious.
Currently, in order to generate an event handler stub in the code behind I
have to
Leave Source view and enter Design view (and wait for the UI to be generated)
Click on the control in question (which sometimes isn't obvious)
Open the Properties toolbar
Click on the lightning bolt
Double-click on the event for which I want to generate a stub
Is there an easier way to do this while still in Source view?
NSData to NSString random characters
NSData to NSString random characters
when i log the vaule for responseString below, it always has random
characters - is that a php issue or an ios issue?
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:&error];
NSString *responseString = [NSString stringWithUTF8String:[responseData
bytes]];
NSLog(@"%@", responseString);
NSString *success = @"200200";
[success dataUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%lu", (unsigned long)responseString.length);
NSLog(@"%lu", (unsigned long)success.length);
//responseString.length should = success.length but doesn't :(
when i log the vaule for responseString below, it always has random
characters - is that a php issue or an ios issue?
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:&error];
NSString *responseString = [NSString stringWithUTF8String:[responseData
bytes]];
NSLog(@"%@", responseString);
NSString *success = @"200200";
[success dataUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%lu", (unsigned long)responseString.length);
NSLog(@"%lu", (unsigned long)success.length);
//responseString.length should = success.length but doesn't :(
How to install openssl on linux
How to install openssl on linux
I'm trying to install the openssl library on linux. i've already
downloaded the tar file, but when i enter the "make"command the following
error appears:
making all in crypto...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto'
making all in crypto/objects...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/objects'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/objects'
making all in crypto/md4...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md4'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md4'
making all in crypto/md5...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md5'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md5'
making all in crypto/sha...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/sha'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/sha'
making all in crypto/mdc2...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/mdc2'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/mdc2'
making all in crypto/hmac...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/hmac'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/hmac'
making all in crypto/ripemd...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ripemd'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ripemd'
making all in crypto/whrlpool...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/whrlpool'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/whrlpool'
making all in crypto/des...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/des'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/des'
making all in crypto/aes...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/aes'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/aes'
making all in crypto/rc2...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc2'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc2'
making all in crypto/rc4...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc4'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc4'
making all in crypto/idea...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/idea'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/idea'
making all in crypto/bf...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bf'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bf'
making all in crypto/cast...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cast'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cast'
making all in crypto/camellia...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/camellia'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/camellia'
making all in crypto/seed...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/seed'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/seed'
making all in crypto/modes...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/modes'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/modes'
making all in crypto/bn...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bn'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bn'
making all in crypto/ec...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ec'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ec'
making all in crypto/rsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rsa'
making all in crypto/dsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dsa'
making all in crypto/ecdsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdsa'
making all in crypto/dh...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dh'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dh'
making all in crypto/ecdh...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdh'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdh'
making all in crypto/dso...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dso'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dso'
making all in crypto/engine...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/engine'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/engine'
making all in crypto/buffer...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/buffer'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/buffer'
making all in crypto/bio...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bio'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bio'
making all in crypto/stack...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/stack'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/stack'
making all in crypto/lhash...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/lhash'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/lhash'
making all in crypto/rand...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rand'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rand'
making all in crypto/err...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/err'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/err'
making all in crypto/evp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/evp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/evp'
making all in crypto/asn1...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/asn1'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/asn1'
making all in crypto/pem...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pem'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pem'
making all in crypto/x509...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509'
making all in crypto/x509v3...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509v3'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509v3'
making all in crypto/conf...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/conf'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/conf'
making all in crypto/txt_db...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/txt_db'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/txt_db'
making all in crypto/pkcs7...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs7'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs7'
making all in crypto/pkcs12...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs12'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs12'
making all in crypto/comp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/comp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/comp'
making all in crypto/ocsp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ocsp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ocsp'
making all in crypto/ui...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ui'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ui'
making all in crypto/krb5...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/krb5'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/krb5'
making all in crypto/cms...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cms'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cms'
making all in crypto/pqueue...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pqueue'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pqueue'
making all in crypto/ts...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ts'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ts'
making all in crypto/srp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/srp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/srp'
making all in crypto/cmac...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cmac'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cmac'
if [ -n "" ]; then \
(cd ..; make libcrypto.so.1.0.0); \
fi
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto'
making all in ssl...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/ssl'
if [ -n "" ]; then \
(cd ..; make libssl.so.1.0.0); \
fi
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/ssl'
making all in engines...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines'
echo
making all in engines/ccgost...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines/ccgost'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines/ccgost'
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines'
making all in apps...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
rm -f openssl
shlib_target=; if [ -n "" ]; then \
shlib_target="linux-shared"; \
elif [ -n "" ]; then \
FIPSLD_CC="gcc"; CC=/usr/local/ssl/fips-2.0/bin/fipsld; export CC
FIPSLD_CC; \
fi; \
LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o
dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o
crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o
gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o
s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o
pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o
rand.o engine.o ocsp.o prime.o ts.o srp.o" \
LIBDEPS=" $LIBRARIES -ldl" \
link_app.${shlib_target}
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -ldl}";
LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT
-DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3
-Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}";
LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d |
uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`;
LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o
${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o
dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o
rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o
genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o
app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o
pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o
ts.o srp.o ${LIBDEPS} )
../libcrypto.a(x86_64cpuid.o): In function `OPENSSL_cleanse':
(.text+0x1a0): multiple definition of `OPENSSL_cleanse'
../libcrypto.a(mem_clr.o):mem_clr.c:(.text+0x0): first defined here
../libcrypto.a(cmll-x86_64.o): In function `Camellia_cbc_encrypt':
(.text+0x1f00): multiple definition of `Camellia_cbc_encrypt'
../libcrypto.a(cmll_cbc.o):cmll_cbc.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_encrypt':
(.text+0x460): multiple definition of `AES_encrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x623): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_decrypt':
(.text+0x9f0): multiple definition of `AES_decrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0xacf): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_encrypt_key':
(.text+0xab0): multiple definition of `private_AES_set_encrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_decrypt_key':
(.text+0xd80): multiple definition of `private_AES_set_decrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x402): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_cbc_encrypt':
(.text+0xfa0): multiple definition of `AES_cbc_encrypt'
../libcrypto.a(aes_cbc.o):aes_cbc.c:(.text+0x0): first defined here
collect2: ld devolvió el estado de salida 1
make[2]: *** [link_app.] Error 1
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
make[1]: *** [openssl] Error 2
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
make: *** [build_apps] Error 1
i think i'm skipping a ./config [options] step, but i'm not really sure
how to do it, any help? thanks!
I'm trying to install the openssl library on linux. i've already
downloaded the tar file, but when i enter the "make"command the following
error appears:
making all in crypto...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto'
making all in crypto/objects...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/objects'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/objects'
making all in crypto/md4...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md4'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md4'
making all in crypto/md5...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md5'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/md5'
making all in crypto/sha...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/sha'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/sha'
making all in crypto/mdc2...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/mdc2'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/mdc2'
making all in crypto/hmac...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/hmac'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/hmac'
making all in crypto/ripemd...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ripemd'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ripemd'
making all in crypto/whrlpool...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/whrlpool'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/whrlpool'
making all in crypto/des...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/des'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/des'
making all in crypto/aes...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/aes'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/aes'
making all in crypto/rc2...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc2'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc2'
making all in crypto/rc4...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc4'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rc4'
making all in crypto/idea...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/idea'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/idea'
making all in crypto/bf...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bf'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bf'
making all in crypto/cast...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cast'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cast'
making all in crypto/camellia...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/camellia'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/camellia'
making all in crypto/seed...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/seed'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/seed'
making all in crypto/modes...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/modes'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/modes'
making all in crypto/bn...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bn'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bn'
making all in crypto/ec...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ec'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ec'
making all in crypto/rsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rsa'
making all in crypto/dsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dsa'
making all in crypto/ecdsa...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdsa'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdsa'
making all in crypto/dh...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dh'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dh'
making all in crypto/ecdh...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdh'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ecdh'
making all in crypto/dso...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dso'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/dso'
making all in crypto/engine...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/engine'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/engine'
making all in crypto/buffer...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/buffer'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/buffer'
making all in crypto/bio...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bio'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/bio'
making all in crypto/stack...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/stack'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/stack'
making all in crypto/lhash...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/lhash'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/lhash'
making all in crypto/rand...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rand'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/rand'
making all in crypto/err...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/err'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/err'
making all in crypto/evp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/evp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/evp'
making all in crypto/asn1...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/asn1'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/asn1'
making all in crypto/pem...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pem'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pem'
making all in crypto/x509...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509'
making all in crypto/x509v3...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509v3'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/x509v3'
making all in crypto/conf...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/conf'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/conf'
making all in crypto/txt_db...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/txt_db'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/txt_db'
making all in crypto/pkcs7...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs7'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs7'
making all in crypto/pkcs12...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs12'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pkcs12'
making all in crypto/comp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/comp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/comp'
making all in crypto/ocsp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ocsp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ocsp'
making all in crypto/ui...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ui'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ui'
making all in crypto/krb5...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/krb5'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/krb5'
making all in crypto/cms...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cms'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cms'
making all in crypto/pqueue...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pqueue'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/pqueue'
making all in crypto/ts...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ts'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/ts'
making all in crypto/srp...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/srp'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/srp'
making all in crypto/cmac...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cmac'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto/cmac'
if [ -n "" ]; then \
(cd ..; make libcrypto.so.1.0.0); \
fi
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/crypto'
making all in ssl...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/ssl'
if [ -n "" ]; then \
(cd ..; make libssl.so.1.0.0); \
fi
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/ssl'
making all in engines...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines'
echo
making all in engines/ccgost...
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines/ccgost'
make[2]: No se hace nada para `all'.
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines/ccgost'
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/engines'
making all in apps...
make[1]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
rm -f openssl
shlib_target=; if [ -n "" ]; then \
shlib_target="linux-shared"; \
elif [ -n "" ]; then \
FIPSLD_CC="gcc"; CC=/usr/local/ssl/fips-2.0/bin/fipsld; export CC
FIPSLD_CC; \
fi; \
LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
make -f ../Makefile.shared -e \
APPNAME=openssl OBJECTS="openssl.o verify.o asn1pars.o req.o dgst.o
dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o
crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o
gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o
s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o
pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o
rand.o engine.o ocsp.o prime.o ts.o srp.o" \
LIBDEPS=" $LIBRARIES -ldl" \
link_app.${shlib_target}
make[2]: se ingresa al directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
( :; LIBDEPS="${LIBDEPS:--L.. -lssl -L.. -lcrypto -ldl}";
LDCMD="${LDCMD:-gcc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT
-DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -DTERMIO -O3
-Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5
-DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM
-DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}";
LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d |
uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`;
LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o
${APPNAME:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o
dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o
rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o
genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o
app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o
pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o
ts.o srp.o ${LIBDEPS} )
../libcrypto.a(x86_64cpuid.o): In function `OPENSSL_cleanse':
(.text+0x1a0): multiple definition of `OPENSSL_cleanse'
../libcrypto.a(mem_clr.o):mem_clr.c:(.text+0x0): first defined here
../libcrypto.a(cmll-x86_64.o): In function `Camellia_cbc_encrypt':
(.text+0x1f00): multiple definition of `Camellia_cbc_encrypt'
../libcrypto.a(cmll_cbc.o):cmll_cbc.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_encrypt':
(.text+0x460): multiple definition of `AES_encrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x623): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_decrypt':
(.text+0x9f0): multiple definition of `AES_decrypt'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0xacf): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_encrypt_key':
(.text+0xab0): multiple definition of `private_AES_set_encrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x0): first defined here
../libcrypto.a(aes-x86_64.o): In function `private_AES_set_decrypt_key':
(.text+0xd80): multiple definition of `private_AES_set_decrypt_key'
../libcrypto.a(aes_core.o):aes_core.c:(.text+0x402): first defined here
../libcrypto.a(aes-x86_64.o): In function `asm_AES_cbc_encrypt':
(.text+0xfa0): multiple definition of `AES_cbc_encrypt'
../libcrypto.a(aes_cbc.o):aes_cbc.c:(.text+0x0): first defined here
collect2: ld devolvió el estado de salida 1
make[2]: *** [link_app.] Error 1
make[2]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
make[1]: *** [openssl] Error 2
make[1]: se sale del directorio
`/home/sebastian/Descargas/openssl-1.0.1e/apps'
make: *** [build_apps] Error 1
i think i'm skipping a ./config [options] step, but i'm not really sure
how to do it, any help? thanks!
Bring Ruby 1.6 Code up to 1.93
Bring Ruby 1.6 Code up to 1.93
Received this error from Ruby 1.93, the code is older (written for and
runs on Ruby 1.6)
makeCores.rb:2136:in block (2 levels) in same_contents': undefined
method>' for nil:NilClass (NoMethodError)
Line 2136 is this if f1.lstat.blksize > 0
class File
def File.same_contents(file1, file2)
return false if !File.exists?(file1) # The files are different if
file1 does not exist
return false if !File.exists?(file2) # The files are different if
file2 does not exist
return true if File.expand_path(file1) == File.expand_path(file2) #
The files are the same if they are the same file
# Otherwise, compare the files contents, one block at a time (First
check if both files are readable)
if !File.readable?(file1) || !File.readable?(file2)
puts "\n>> Warning : Unable to read either xco or input parameters
file"
return false
end
open(file1) do |f1|
open(file2) do |f2|
if f1.lstat.blksize > 0
blocksize = f1.lstat.blksize # Returns the native file system's
block size.
else
blocksize = 4096 # Set to a default value for
platforms that don't support this information (like Windows)
end
same = true
while same && !f1.eof? && !f2.eof?
same = f1.read(blocksize) == f2.read(blocksize)
end
return same
end
end
end
end
I can see that the lstat and blksize methods still exist.
Tried changing lstat to File.lstat the error message changed to:
makeCores.rb:2137:in block (2 levels) in same_contents': undefined
methodFile' for # (NoMethodError)
How do I bring this up to date with Ruby 1.93?
Received this error from Ruby 1.93, the code is older (written for and
runs on Ruby 1.6)
makeCores.rb:2136:in block (2 levels) in same_contents': undefined
method>' for nil:NilClass (NoMethodError)
Line 2136 is this if f1.lstat.blksize > 0
class File
def File.same_contents(file1, file2)
return false if !File.exists?(file1) # The files are different if
file1 does not exist
return false if !File.exists?(file2) # The files are different if
file2 does not exist
return true if File.expand_path(file1) == File.expand_path(file2) #
The files are the same if they are the same file
# Otherwise, compare the files contents, one block at a time (First
check if both files are readable)
if !File.readable?(file1) || !File.readable?(file2)
puts "\n>> Warning : Unable to read either xco or input parameters
file"
return false
end
open(file1) do |f1|
open(file2) do |f2|
if f1.lstat.blksize > 0
blocksize = f1.lstat.blksize # Returns the native file system's
block size.
else
blocksize = 4096 # Set to a default value for
platforms that don't support this information (like Windows)
end
same = true
while same && !f1.eof? && !f2.eof?
same = f1.read(blocksize) == f2.read(blocksize)
end
return same
end
end
end
end
I can see that the lstat and blksize methods still exist.
Tried changing lstat to File.lstat the error message changed to:
makeCores.rb:2137:in block (2 levels) in same_contents': undefined
methodFile' for # (NoMethodError)
How do I bring this up to date with Ruby 1.93?
WPI: How to install software in a different partition (other than C:)
WPI: How to install software in a different partition (other than C:)
I want to use the Web Platform Installer 4.6 to install things like MySQL
and the Microsoft SQL Server. However, during the installation process, I
don't see an option to select a different disk drive for the installation.
In my case, I'd like to install MySQL in the E: drive (not in C:). The Web
Platform Installer installs all software in the C: drive by default.
How do I install software in a different partition (other than C:) with
the Web Platform Installer?
JP
I want to use the Web Platform Installer 4.6 to install things like MySQL
and the Microsoft SQL Server. However, during the installation process, I
don't see an option to select a different disk drive for the installation.
In my case, I'd like to install MySQL in the E: drive (not in C:). The Web
Platform Installer installs all software in the C: drive by default.
How do I install software in a different partition (other than C:) with
the Web Platform Installer?
JP
.htaccess does not load css and js
.htaccess does not load css and js
i have 2 blog files one is blogdetail.php and bloglist.php. What i want to
make is if someone enters on a link like this
http://mysite.com/blog
to open bloglist.php and when someone enters to
http://mysite.com/blog/7
to open blogdetail.php?id=7. My .htaccess so far looks like this
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^blog/([0-9]+)$ blogdetail.php?id=$1 [NC,L]
RewriteRule ^([a-zA-Z]+)$ $1.php [NC,L]
ErrorDocument 404 /404.php
but the problem is when i enter on blog/7 , the page opens but the css
does not load. Is there a way to make this work without using absolute
paths to css and js? Thank you, Daniel!
i have 2 blog files one is blogdetail.php and bloglist.php. What i want to
make is if someone enters on a link like this
http://mysite.com/blog
to open bloglist.php and when someone enters to
http://mysite.com/blog/7
to open blogdetail.php?id=7. My .htaccess so far looks like this
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^blog/([0-9]+)$ blogdetail.php?id=$1 [NC,L]
RewriteRule ^([a-zA-Z]+)$ $1.php [NC,L]
ErrorDocument 404 /404.php
but the problem is when i enter on blog/7 , the page opens but the css
does not load. Is there a way to make this work without using absolute
paths to css and js? Thank you, Daniel!
Probabilistic Clause Choice
Probabilistic Clause Choice
Its been a long time since I used Prolog in earnest, but I can't find any
reference to this by googling, or in the texts I have. This may be a
failure of terminology, so apologies if I massacre that.
If I have a program that could have multiple solutions:
likes(mary, joe).
likes(bob, joe).
:- likes(X, joe)
Is there a simple built-in way to have the solver run matching predicates
in random order, and therefore give results in a random order (or,
equivalently, have the first solution be random)?
Obviously you can get as sophisticated as you like with the word random.
I'm thinking of some uniform random sampling from the set of valid
predicates at each step of the solver. Something more complex like a
uniform random sampling over valid solutions is also fine. The issue is
general.
I can probably build a program to do this, using a random number
generator, and meta-programming. But I want to check if I'm missing
something simple.
Its been a long time since I used Prolog in earnest, but I can't find any
reference to this by googling, or in the texts I have. This may be a
failure of terminology, so apologies if I massacre that.
If I have a program that could have multiple solutions:
likes(mary, joe).
likes(bob, joe).
:- likes(X, joe)
Is there a simple built-in way to have the solver run matching predicates
in random order, and therefore give results in a random order (or,
equivalently, have the first solution be random)?
Obviously you can get as sophisticated as you like with the word random.
I'm thinking of some uniform random sampling from the set of valid
predicates at each step of the solver. Something more complex like a
uniform random sampling over valid solutions is also fine. The issue is
general.
I can probably build a program to do this, using a random number
generator, and meta-programming. But I want to check if I'm missing
something simple.
Friday, 13 September 2013
Jagged lists not being set in method
Jagged lists not being set in method
Why don't the two jagged lists of Map class get set? map.row and map.cols
are showing to have values such as 4 and 5 in the Visual Studio debugger.
Do i need these classes to be in a namespace?
Any help appreciated. Thanks!
Whole Map class
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class Map
{
public Map()
{
}
public int rows { get; set; }
public int cols { get; set; }
public int boardXPos { get; set; }
public int boardYPos { get; set; }
public int squareSize { get; set; }
private List<List<int>> m_cellPositions = new List<List<int>>();
public List<List<int>> cellPositions
{
get
{
return m_cellPositions;
}
set
{
m_cellPositions = value;
}
}
private List<List<int>> m_cellWalls = new List<List<int>>();
public List<List<int>> cellWalls
{
get
{
return m_cellWalls;
}
set
{
m_cellWalls = value;
}
}
}
Start of MapController Class
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class MapController
{
public MapController()
{
}
Map map = new Map();
Method to set map.cellWalls
public void defineCellWallsList()
{
//map.cellWalls.Clear();
for (int row = 0; row < (map.rows * map.cols); row++)
{
map.cellWalls.Add(new List<int> { 0, 0 });
}
}
Method to set map.cellPositions
public void defineCellPositionsList()
{
//map.cellPositions.Clear();
for (int row = 0; row < map.rows; row++)
{
for (int col = 0; col < map.cols; col++)
{
map.cellPositions.Add(new List<int> { col, row });
}
}
}
Why don't the two jagged lists of Map class get set? map.row and map.cols
are showing to have values such as 4 and 5 in the Visual Studio debugger.
Do i need these classes to be in a namespace?
Any help appreciated. Thanks!
Whole Map class
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class Map
{
public Map()
{
}
public int rows { get; set; }
public int cols { get; set; }
public int boardXPos { get; set; }
public int boardYPos { get; set; }
public int squareSize { get; set; }
private List<List<int>> m_cellPositions = new List<List<int>>();
public List<List<int>> cellPositions
{
get
{
return m_cellPositions;
}
set
{
m_cellPositions = value;
}
}
private List<List<int>> m_cellWalls = new List<List<int>>();
public List<List<int>> cellWalls
{
get
{
return m_cellWalls;
}
set
{
m_cellWalls = value;
}
}
}
Start of MapController Class
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
public class MapController
{
public MapController()
{
}
Map map = new Map();
Method to set map.cellWalls
public void defineCellWallsList()
{
//map.cellWalls.Clear();
for (int row = 0; row < (map.rows * map.cols); row++)
{
map.cellWalls.Add(new List<int> { 0, 0 });
}
}
Method to set map.cellPositions
public void defineCellPositionsList()
{
//map.cellPositions.Clear();
for (int row = 0; row < map.rows; row++)
{
for (int col = 0; col < map.cols; col++)
{
map.cellPositions.Add(new List<int> { col, row });
}
}
}
Which route when combining two HTML create forms
Which route when combining two HTML create forms
Let's say I have the routes
/magazines/new
/magazines/:magazines_ads/new
but I want to display both forms on the same page, because they are very
small and for convenience it would make more sense. How would one handle
this situation normally?
Let's say I have the routes
/magazines/new
/magazines/:magazines_ads/new
but I want to display both forms on the same page, because they are very
small and for convenience it would make more sense. How would one handle
this situation normally?
The same text has different byte size
The same text has different byte size
I have simple txt file, read this content, do with them some operation
(for example encode and decode) and save result in file. When I compare
its two files in beyond compare I see that content the same. But sizes of
files are different. Why? And how I can resolve this problem?
I have simple txt file, read this content, do with them some operation
(for example encode and decode) and save result in file. When I compare
its two files in beyond compare I see that content the same. But sizes of
files are different. Why? And how I can resolve this problem?
Facebook local currency
Facebook local currency
I'm changing a facebook game from using facebook credits to the new user
local currency model. Everything seems ok except the price that shows at
facebook pay dialog. It shows an old price that I had defined before.
After I change the price in the product file, I upload it and re-scraped
at [object debugger][1]
No errors returned and the price array turned out ok. { "amount": 3
"currency": "USD" }
My facebook account has set the payment currency in "EUR". So at the store
the price should be returned in euros by the facebook callback. And it
does, except for the value that comes out wrong in the facebook pay
dialog.
Accordingly to facebook exchange rates the price shoud be 2.29 (3 US
dollars) instead it returns 1.99
I don't know where this value is coming from. Do you have any idea?
I'm changing a facebook game from using facebook credits to the new user
local currency model. Everything seems ok except the price that shows at
facebook pay dialog. It shows an old price that I had defined before.
After I change the price in the product file, I upload it and re-scraped
at [object debugger][1]
No errors returned and the price array turned out ok. { "amount": 3
"currency": "USD" }
My facebook account has set the payment currency in "EUR". So at the store
the price should be returned in euros by the facebook callback. And it
does, except for the value that comes out wrong in the facebook pay
dialog.
Accordingly to facebook exchange rates the price shoud be 2.29 (3 US
dollars) instead it returns 1.99
I don't know where this value is coming from. Do you have any idea?
Charset on Psliwa PHPPdf Bundle
Charset on Psliwa PHPPdf Bundle
concerning the PdfBundle on Symfony2 propose by Psliwa when I try to add
my custom font I have this error :
Notice: iconv(): Wrong charset, conversion fromMacRoman' to UTF-16BE' is
not allowed in
.../vendor/zendframework/zendpdf/library/ZendPdf/BinaryParser/AbstractBinaryParser.php
line 431
On my config.yml I have :
fonts_file:
"%kernel.root_dir%/../src/Travel/PdfBundle/Resources/config/fonts.xml"
On my template I have :
<dynamic-page encoding="UTF-8" font-type="FFInfoFonts">
On my Controller:
public function pdfAction(Request $request, $ce, $year) {
$format = $this->get('request')->get('_format');
return $this->render(sprintf('TravelPdfBundle:PointsCard:pdf.%s.twig',
$format));
}
And on my fonts.xml I have :
<font name="FFInfoFonts">
<normal src="font/FF Info fonts/police Web/InfoDisplayComp.ttf" />
</font>
Everyone have idea to force the charsey
concerning the PdfBundle on Symfony2 propose by Psliwa when I try to add
my custom font I have this error :
Notice: iconv(): Wrong charset, conversion fromMacRoman' to UTF-16BE' is
not allowed in
.../vendor/zendframework/zendpdf/library/ZendPdf/BinaryParser/AbstractBinaryParser.php
line 431
On my config.yml I have :
fonts_file:
"%kernel.root_dir%/../src/Travel/PdfBundle/Resources/config/fonts.xml"
On my template I have :
<dynamic-page encoding="UTF-8" font-type="FFInfoFonts">
On my Controller:
public function pdfAction(Request $request, $ce, $year) {
$format = $this->get('request')->get('_format');
return $this->render(sprintf('TravelPdfBundle:PointsCard:pdf.%s.twig',
$format));
}
And on my fonts.xml I have :
<font name="FFInfoFonts">
<normal src="font/FF Info fonts/police Web/InfoDisplayComp.ttf" />
</font>
Everyone have idea to force the charsey
Thursday, 12 September 2013
insert in same table avoid duplicate
insert in same table avoid duplicate
below is my sql statement
INSERT INTO tblRB_ReportFilterUserAssoc
(
[FK_ReportID]
,[UserID]
,[FilterExpression]
,[DateFilterValues]
,[IsCustomReport]
)
SELECT
[FK_ReportID]
,@UserId
,[FilterExpression]
,[DateFilterValues]
,[IsCustomReport]
FROM
tblRB_ReportFilterUserAssoc
WHERE
UserID = @AssignedUserID
there is condition of UserID
it is basically inserting all the records in same records of a particular
user for another user
i have to check if the particular filter is exist for new user then dont
insert
case
how can i do that
[FK_ReportID] user_id
1 100
2 100
3 100
1 101
now i want to insert all records of userid 100 to same table for userid
101, but as report id 1 is already there in table for 101 so it should
insert only records for 2,3,4
how should we restrict that
Thank You
below is my sql statement
INSERT INTO tblRB_ReportFilterUserAssoc
(
[FK_ReportID]
,[UserID]
,[FilterExpression]
,[DateFilterValues]
,[IsCustomReport]
)
SELECT
[FK_ReportID]
,@UserId
,[FilterExpression]
,[DateFilterValues]
,[IsCustomReport]
FROM
tblRB_ReportFilterUserAssoc
WHERE
UserID = @AssignedUserID
there is condition of UserID
it is basically inserting all the records in same records of a particular
user for another user
i have to check if the particular filter is exist for new user then dont
insert
case
how can i do that
[FK_ReportID] user_id
1 100
2 100
3 100
1 101
now i want to insert all records of userid 100 to same table for userid
101, but as report id 1 is already there in table for 101 so it should
insert only records for 2,3,4
how should we restrict that
Thank You
What does the 'with' statement do in python?
What does the 'with' statement do in python?
I am new to Python. In one tutorial of connecting to mysql and fetching
data, I saw the with statement. I read about it and it was something
related to try-finally block. But I couldn't find a simpler explanation
that I could understand.
I am new to Python. In one tutorial of connecting to mysql and fetching
data, I saw the with statement. I read about it and it was something
related to try-finally block. But I couldn't find a simpler explanation
that I could understand.
How to use non-String @RiakKey?
How to use non-String @RiakKey?
Is it possible to use a field that isn't a String as a @RiakKey? Here's
what I have:
public class DomainObject {
@RiakKey private UUID objectId;
}
Unfortunately, the current (v1.4.0) java client bombs out setting the key
on deserialization:
java.lang.IllegalArgumentException: Can not set java.util.UUID field
com.company.DomainObject.objectId to java.lang.String
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
~[na:1.7.0_25]
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
~[na:1.7.0_25]
at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
~[na:1.7.0_25]
at java.lang.reflect.Field.set(Field.java:741) ~[na:1.7.0_25]
at
com.basho.riak.client.convert.reflect.ClassUtil.setFieldValue(ClassUtil.java:45)
~[riak-client-1.4.0.jar:na]
at
com.basho.riak.client.convert.reflect.AnnotationInfo.setRiakKey(AnnotationInfo.java:149)
~[riak-client-1.4.0.jar:na]
...snip
Is there any way to do this without degrading the domain object by
changing the UUID to a String?
Is it possible to use a field that isn't a String as a @RiakKey? Here's
what I have:
public class DomainObject {
@RiakKey private UUID objectId;
}
Unfortunately, the current (v1.4.0) java client bombs out setting the key
on deserialization:
java.lang.IllegalArgumentException: Can not set java.util.UUID field
com.company.DomainObject.objectId to java.lang.String
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
~[na:1.7.0_25]
at
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
~[na:1.7.0_25]
at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
~[na:1.7.0_25]
at java.lang.reflect.Field.set(Field.java:741) ~[na:1.7.0_25]
at
com.basho.riak.client.convert.reflect.ClassUtil.setFieldValue(ClassUtil.java:45)
~[riak-client-1.4.0.jar:na]
at
com.basho.riak.client.convert.reflect.AnnotationInfo.setRiakKey(AnnotationInfo.java:149)
~[riak-client-1.4.0.jar:na]
...snip
Is there any way to do this without degrading the domain object by
changing the UUID to a String?
Is there a way to load the constant values stored in a header file via ctypes?
Is there a way to load the constant values stored in a header file via
ctypes?
I'm doing a bunch of ctypes calls to the underlying OS libraries. My
progress slows to a crawl anytime the docs reference a constant value
stored in a .h. file somewhere, as I have to go track it down, and figure
out what the actual value is so that I can pass it into the function.
Is there any way to load a .h file with ctypes and get access to all of
the constants?
ctypes?
I'm doing a bunch of ctypes calls to the underlying OS libraries. My
progress slows to a crawl anytime the docs reference a constant value
stored in a .h. file somewhere, as I have to go track it down, and figure
out what the actual value is so that I can pass it into the function.
Is there any way to load a .h file with ctypes and get access to all of
the constants?
Generate a random integer within a given range AND is even ONLY
Generate a random integer within a given range AND is even ONLY
I am having trouble generating this code which I'm sure I'm just in a
coder's block or something because it seems as though it should be easy
but can't get it for the life of me.
I have a program which needs random numbers generated within a certain
range which is to represent money. The stipulation is that the money need
be in between 2 and 200 and represent only even dollars only so $2, $4,
$6...so on. I have done extensive searching online which yield a bounty of
code to represent random numbers in a range in java but not the part about
being only even.
Any ideas?
I am having trouble generating this code which I'm sure I'm just in a
coder's block or something because it seems as though it should be easy
but can't get it for the life of me.
I have a program which needs random numbers generated within a certain
range which is to represent money. The stipulation is that the money need
be in between 2 and 200 and represent only even dollars only so $2, $4,
$6...so on. I have done extensive searching online which yield a bounty of
code to represent random numbers in a range in java but not the part about
being only even.
Any ideas?
Using Jquery to change field value in webpage using Chrome Extension
Using Jquery to change field value in webpage using Chrome Extension
I am attempting to change the value of a field on a page with a Google
Chrome extension using JQuery
My Code are as follows,
manifest.json
{
"manifest_version": 2,
"name": "One-click Kittens",
"description": "This extension demonstrates a browser action with
kittens.",
"version": "1.0",
"background": { "scripts": ["jquery.js"] },
"permissions": [
"tabs",
"http://*/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
popup.html
<!doctype html>
<html>
<head>
<title>Getting Started Extension's Popup</title>
<style>
body {
min-width: 200px;
overflow-x: hidden;
}
</style>
<!--
- JavaScript and HTML must be in separate files: see our Content
Security
- Policy documentation[1] for details and explanation.
-
- [1]:
http://developer.chrome.com/extensions/contentSecurityPolicy.html
-->
<script src="jquery.js"></script>
<script src="popup.js"></script>
</head>
<body>
<ul>
<li><a href="#" id="watch_list">Watch</a>
</li>
<li id="assets">Assets
</li>
<li id="liab">Liabilities
</li>
</ul>
</body>
</html>
and lastly popup.js
$(document).ready($(function(){
$('#watch_list').click(function(){
$('#name').val("Hello");
})
}));
My issue is when the link Watch is clicked its suppose to fill in the web
page form with ID name with the word "Hello" but nothing seems to work.
Any help would be greatly appreciated! Thank you for reading.
I am attempting to change the value of a field on a page with a Google
Chrome extension using JQuery
My Code are as follows,
manifest.json
{
"manifest_version": 2,
"name": "One-click Kittens",
"description": "This extension demonstrates a browser action with
kittens.",
"version": "1.0",
"background": { "scripts": ["jquery.js"] },
"permissions": [
"tabs",
"http://*/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
popup.html
<!doctype html>
<html>
<head>
<title>Getting Started Extension's Popup</title>
<style>
body {
min-width: 200px;
overflow-x: hidden;
}
</style>
<!--
- JavaScript and HTML must be in separate files: see our Content
Security
- Policy documentation[1] for details and explanation.
-
- [1]:
http://developer.chrome.com/extensions/contentSecurityPolicy.html
-->
<script src="jquery.js"></script>
<script src="popup.js"></script>
</head>
<body>
<ul>
<li><a href="#" id="watch_list">Watch</a>
</li>
<li id="assets">Assets
</li>
<li id="liab">Liabilities
</li>
</ul>
</body>
</html>
and lastly popup.js
$(document).ready($(function(){
$('#watch_list').click(function(){
$('#name').val("Hello");
})
}));
My issue is when the link Watch is clicked its suppose to fill in the web
page form with ID name with the word "Hello" but nothing seems to work.
Any help would be greatly appreciated! Thank you for reading.
how to filter a select statement in mysql for a particular time period without using now()
how to filter a select statement in mysql for a particular time period
without using now()
i have tried to filter records but with the use of now function as given
below
select * from table where date>= DATE_SUB( NOW( ) ,INTERVAL 90 DAY )
what i need is a select statement that can filter its records for a week
or month from the current date but without using NOW() function
without using now()
i have tried to filter records but with the use of now function as given
below
select * from table where date>= DATE_SUB( NOW( ) ,INTERVAL 90 DAY )
what i need is a select statement that can filter its records for a week
or month from the current date but without using NOW() function
How can I set an external variable to nil inside a method?
How can I set an external variable to nil inside a method?
I'd like to subclass TThread in order to have a thread class that, when
FreeOnTerminate = True, sets to nil its reference variable. In other
words, I want do do something like this:
TFreeAndNilThread = class(TThread)
private
FReferenceObj: TFreeAndNilThread; //?? // <-- here I'm holding the
reference to myself
protected
procedure Execute;
procedure DoTerminate; override; // <-- here I'll set FReferenceObj to
nil after inherited (only if FreeAndNil = True)
public
constructor Create(CreateSuspended: Boolean; var ReferenceObj);
reintroduce; <-- untyped param like FreeAndNil and
TApplication.CreateForm ??
end;
The consumer code should be like this:
var
MyThread: TFreeAndNilThread;
begin
MyThread := TFreeAndNilThread.Create(True, MyThread);
MyThread.FreeOnTerminate := True;
MyThread.Resume;
end;
...and then I could safely test for Assigned(MyThread).
I see how FreeAndNil manages to set a reference object passed by untyped
param to nil, but it does this locally. In my case I should "save" it to a
class field (FReferenceObj) and make it nil in another place
(DoTerminate).
How can I correctly pass, store and retrieve it? I can think of passing
and storing the address of MyThread instead of MyThread itself, but I hope
there is a more elegant way.
Thank you!
I'd like to subclass TThread in order to have a thread class that, when
FreeOnTerminate = True, sets to nil its reference variable. In other
words, I want do do something like this:
TFreeAndNilThread = class(TThread)
private
FReferenceObj: TFreeAndNilThread; //?? // <-- here I'm holding the
reference to myself
protected
procedure Execute;
procedure DoTerminate; override; // <-- here I'll set FReferenceObj to
nil after inherited (only if FreeAndNil = True)
public
constructor Create(CreateSuspended: Boolean; var ReferenceObj);
reintroduce; <-- untyped param like FreeAndNil and
TApplication.CreateForm ??
end;
The consumer code should be like this:
var
MyThread: TFreeAndNilThread;
begin
MyThread := TFreeAndNilThread.Create(True, MyThread);
MyThread.FreeOnTerminate := True;
MyThread.Resume;
end;
...and then I could safely test for Assigned(MyThread).
I see how FreeAndNil manages to set a reference object passed by untyped
param to nil, but it does this locally. In my case I should "save" it to a
class field (FReferenceObj) and make it nil in another place
(DoTerminate).
How can I correctly pass, store and retrieve it? I can think of passing
and storing the address of MyThread instead of MyThread itself, but I hope
there is a more elegant way.
Thank you!
Wednesday, 11 September 2013
Rounding corner using GrapicMagick using convert only
Rounding corner using GrapicMagick using convert only
Is it possible to add round corner to an existing image using convert only.
-compose and -mask seems to require the mask file prepared in advance.
Is it possible to add round corner to an existing image using convert only.
-compose and -mask seems to require the mask file prepared in advance.
Delphi XE4 - get your local IP in statusbar
Delphi XE4 - get your local IP in statusbar
Seen most of the examples posted here but none seem to work on XE4. I am
trying to display my IP in the status bar.
AdvOfficeStatusBar1.Panels[0].Text := GetIP;
Functions I have seen here mostly fail on xe4 as they were written in
older delphi versions.I would like to get just the local IP,not the one
behind the router. Well, for the sake of learning, it would be usefull to
know that one too...:)
Seen most of the examples posted here but none seem to work on XE4. I am
trying to display my IP in the status bar.
AdvOfficeStatusBar1.Panels[0].Text := GetIP;
Functions I have seen here mostly fail on xe4 as they were written in
older delphi versions.I would like to get just the local IP,not the one
behind the router. Well, for the sake of learning, it would be usefull to
know that one too...:)
c# convert class to query string
c# convert class to query string
Im trying to convert a few classes/objects in my application to a query
string for example:
public class LoginRequest : BaseRequest
{
public string username { get; set; }
public string password { get; set; }
public otherclass d { get; set; }
}
public class otherclass
{
public string a { get; set; }
public string b { get; set; }
}
would then become:
username=test&password=p&a=123&b=123
Which i am achieving with the following function
private string ObjectToQueryString<T>(T obj) where T: class {
StringBuilder sb = new StringBuilder();
Type t = obj.GetType();
var properties = t.GetProperties();
foreach (PropertyInfo p in properties)
{
if (p.CanRead)
{
var indexes = p.GetIndexParameters();
if (indexes.Count() > 0)
{
var pp = p.GetValue(obj, new object[] { 1 });
sb.Append(ObjectToQueryString(pp));
}
else
{
//I dont think this is a good way to do it
if (p.PropertyType.FullName != p.GetValue(obj,
null).ToString())
{
sb.Append(String.Format("{0}={1}&", p.Name,
HttpUtility.UrlEncode(p.GetValue(obj,
null).ToString())));
}
else
{
sb.Append(ObjectToQueryString(p.GetValue(obj, null)));
}
}
}
}
return sb.ToString().TrimEnd('&');
}
but If I pass a list into the function it will also include the Count and
Capacity properties and other thing I dont want. Say its a list of
List<otherclass>()
Cheers
Im trying to convert a few classes/objects in my application to a query
string for example:
public class LoginRequest : BaseRequest
{
public string username { get; set; }
public string password { get; set; }
public otherclass d { get; set; }
}
public class otherclass
{
public string a { get; set; }
public string b { get; set; }
}
would then become:
username=test&password=p&a=123&b=123
Which i am achieving with the following function
private string ObjectToQueryString<T>(T obj) where T: class {
StringBuilder sb = new StringBuilder();
Type t = obj.GetType();
var properties = t.GetProperties();
foreach (PropertyInfo p in properties)
{
if (p.CanRead)
{
var indexes = p.GetIndexParameters();
if (indexes.Count() > 0)
{
var pp = p.GetValue(obj, new object[] { 1 });
sb.Append(ObjectToQueryString(pp));
}
else
{
//I dont think this is a good way to do it
if (p.PropertyType.FullName != p.GetValue(obj,
null).ToString())
{
sb.Append(String.Format("{0}={1}&", p.Name,
HttpUtility.UrlEncode(p.GetValue(obj,
null).ToString())));
}
else
{
sb.Append(ObjectToQueryString(p.GetValue(obj, null)));
}
}
}
}
return sb.ToString().TrimEnd('&');
}
but If I pass a list into the function it will also include the Count and
Capacity properties and other thing I dont want. Say its a list of
List<otherclass>()
Cheers
Why is the compositionComplete event not called in durandaljs
Why is the compositionComplete event not called in durandaljs
Thats my sample project (8,3 MB) Visual Studio 2012 solution:
sample project zipped
My problem:
module step2 and its compositionComplete event is NOT called! module step1
is and the same event works fine!
This way you can reproduce the problem:
1.) start app
2.) click the 'Browse schoolyears' button
3.) click the 'create' button
4.) Wizard step1 is visible and its compositionComplete event is called
5.) click the 'next' button
6.) Wizard step2 is visible and its compositionComplete event is NOT called
I am posting here the important stuff only and these are 5 modules.
The SchoolyearDialog module is composed of the SchoolyearBrowser and
SchoolyearWizard module. Both modules are switched with the 'compose:
activeScreen' binding.
When the SchoolyearWizard is loaded and the user clicked the next step
button to load step2 then here is the problem see number 6.) above.
SchoolyearDialog
define(['durandal/app','plugins/dialog', 'knockout',
'services/dataservice', 'plugins/router', 'moment'], function (app,
dialog, ko, dataservice, router, moment) {
var SchoolyearDialog = function () {
var self = this;
self.activeScreen = ko.observable('viewmodels/SchoolyearBrowser');
// set the schoolyear browser as default module
app.on('activateStep1').then(function (obj) {
self.activeScreen(obj.moduleId);
});
app.on('activateStep2').then(function (obj) {
self.activeScreen(obj.moduleId);
});
app.on('dialog:close').then(function (options) {
dialog.close(self, options );
});
self.closeDialog = function () {
dialog.close(self, { isSuccess: false });
}
}
SchoolyearDialog.show = function () {
return dialog.show(new SchoolyearDialog());
};
return SchoolyearDialog;
});
SchoolyearBrowser
define(['durandal/app', 'plugins/dialog', 'knockout',
'services/dataservice', 'plugins/router', 'moment'],
function (app, dialog, ko, dataservice, router, moment) {
var SchoolyearBrowser = function () {
var self = this;
self.create = function () {
app.trigger('activateStep1', {
moduleId: 'viewmodels/SchoolyearWizard',
viewMode: 'create'
});
}
self.open = function () {
// do not open the wizard
}
self.compositionComplete = function (view) {
debugger;
}
};
return SchoolyearBrowser;
});
SchoolyearWizard
define(['durandal/activator', 'viewmodels/step1', 'viewmodels/step2',
'knockout', 'plugins/dialog','durandal/app'], function (activator, Step1,
Step2, ko, dialog, app) {
var steps = [new Step1(), new Step2()];
var step = ko.observable(0); // Start with first step
var activeStep = activator.create();
var stepsLength = steps.length;
var hasPrevious = ko.computed(function () {
return step() > 0;
});
var caption = ko.computed(function () {
if (step() === stepsLength - 1) {
return 'save';
}
else if (step() < stepsLength) {
return 'next';
}
});
activeStep(steps[step()]);
var hasNext = ko.computed(function () {
if ((step() === stepsLength - 1) && activeStep().isValid()) {
// save
return true;
} else if ((step() < stepsLength - 1) && activeStep().isValid()) {
return true;
}
});
return {
showCodeUrl: true,
steps: steps,
step: step,
activeStep: activeStep,
next: next,
caption: caption,
previous: previous,
hasPrevious: hasPrevious,
hasNext: hasNext
};
function isLastStep() {
return step() === stepsLength - 1;
}
function next() {
if (isLastStep()) {
// Corrects the button caption when the user re-visits the wizard
step(step() - 1);
// Resets the wizard init page to the first step when the user
re-visits the wizard
activeStep(steps[0]);
debugger;
// save;
}
else if (step() < stepsLength) {
step(step() + 1);
activeStep(steps[step()]);
debugger;
//app.trigger('activateStep2', {
// moduleId: 'viewmodels/step2'
//});
}
}
function previous() {
if (step() > 0) {
step(step() - 1);
activeStep(steps[step()]);
}
}
});
Step1
define(function () {
return function () {
var self = this;
self.isValid = function () {
return true;
}
self.name = 'step1';
self.compositionComplete = function (view) {
debugger;
}
};
});
Step2
define(function () {
return function () {
this.isValid = function () {
return true;
}
this.name = 'step2';
self.compositionComplete = function (view) {
// I never get here WHY ???
}
};
});
Thats my sample project (8,3 MB) Visual Studio 2012 solution:
sample project zipped
My problem:
module step2 and its compositionComplete event is NOT called! module step1
is and the same event works fine!
This way you can reproduce the problem:
1.) start app
2.) click the 'Browse schoolyears' button
3.) click the 'create' button
4.) Wizard step1 is visible and its compositionComplete event is called
5.) click the 'next' button
6.) Wizard step2 is visible and its compositionComplete event is NOT called
I am posting here the important stuff only and these are 5 modules.
The SchoolyearDialog module is composed of the SchoolyearBrowser and
SchoolyearWizard module. Both modules are switched with the 'compose:
activeScreen' binding.
When the SchoolyearWizard is loaded and the user clicked the next step
button to load step2 then here is the problem see number 6.) above.
SchoolyearDialog
define(['durandal/app','plugins/dialog', 'knockout',
'services/dataservice', 'plugins/router', 'moment'], function (app,
dialog, ko, dataservice, router, moment) {
var SchoolyearDialog = function () {
var self = this;
self.activeScreen = ko.observable('viewmodels/SchoolyearBrowser');
// set the schoolyear browser as default module
app.on('activateStep1').then(function (obj) {
self.activeScreen(obj.moduleId);
});
app.on('activateStep2').then(function (obj) {
self.activeScreen(obj.moduleId);
});
app.on('dialog:close').then(function (options) {
dialog.close(self, options );
});
self.closeDialog = function () {
dialog.close(self, { isSuccess: false });
}
}
SchoolyearDialog.show = function () {
return dialog.show(new SchoolyearDialog());
};
return SchoolyearDialog;
});
SchoolyearBrowser
define(['durandal/app', 'plugins/dialog', 'knockout',
'services/dataservice', 'plugins/router', 'moment'],
function (app, dialog, ko, dataservice, router, moment) {
var SchoolyearBrowser = function () {
var self = this;
self.create = function () {
app.trigger('activateStep1', {
moduleId: 'viewmodels/SchoolyearWizard',
viewMode: 'create'
});
}
self.open = function () {
// do not open the wizard
}
self.compositionComplete = function (view) {
debugger;
}
};
return SchoolyearBrowser;
});
SchoolyearWizard
define(['durandal/activator', 'viewmodels/step1', 'viewmodels/step2',
'knockout', 'plugins/dialog','durandal/app'], function (activator, Step1,
Step2, ko, dialog, app) {
var steps = [new Step1(), new Step2()];
var step = ko.observable(0); // Start with first step
var activeStep = activator.create();
var stepsLength = steps.length;
var hasPrevious = ko.computed(function () {
return step() > 0;
});
var caption = ko.computed(function () {
if (step() === stepsLength - 1) {
return 'save';
}
else if (step() < stepsLength) {
return 'next';
}
});
activeStep(steps[step()]);
var hasNext = ko.computed(function () {
if ((step() === stepsLength - 1) && activeStep().isValid()) {
// save
return true;
} else if ((step() < stepsLength - 1) && activeStep().isValid()) {
return true;
}
});
return {
showCodeUrl: true,
steps: steps,
step: step,
activeStep: activeStep,
next: next,
caption: caption,
previous: previous,
hasPrevious: hasPrevious,
hasNext: hasNext
};
function isLastStep() {
return step() === stepsLength - 1;
}
function next() {
if (isLastStep()) {
// Corrects the button caption when the user re-visits the wizard
step(step() - 1);
// Resets the wizard init page to the first step when the user
re-visits the wizard
activeStep(steps[0]);
debugger;
// save;
}
else if (step() < stepsLength) {
step(step() + 1);
activeStep(steps[step()]);
debugger;
//app.trigger('activateStep2', {
// moduleId: 'viewmodels/step2'
//});
}
}
function previous() {
if (step() > 0) {
step(step() - 1);
activeStep(steps[step()]);
}
}
});
Step1
define(function () {
return function () {
var self = this;
self.isValid = function () {
return true;
}
self.name = 'step1';
self.compositionComplete = function (view) {
debugger;
}
};
});
Step2
define(function () {
return function () {
this.isValid = function () {
return true;
}
this.name = 'step2';
self.compositionComplete = function (view) {
// I never get here WHY ???
}
};
});
No output in EShell
No output in EShell
test.js:
console.log('Hello world!');
process.exit(0);
I run in EShell (Emacs shell) in Emacs 24.2.1 on Windows XP:
node test.js
Output: nothing
Expected output: Hello world!
Is there a fix? (without changing test.js, of course, because that's just
a test case)
test.js:
console.log('Hello world!');
process.exit(0);
I run in EShell (Emacs shell) in Emacs 24.2.1 on Windows XP:
node test.js
Output: nothing
Expected output: Hello world!
Is there a fix? (without changing test.js, of course, because that's just
a test case)
Combining two double[] arrays into double[,]
Combining two double[] arrays into double[,]
I frequently have two arrays that I need to combine to one matrix (same
lenght and type). I was wondering whether there is a linq way that is more
elegant than:
var result = new double[dt.Count, 2];
for (int i = 0; i < dt.Count; i++)
{
result[i, 0] = dts[i];
result[i, 1] = dt[i];
}
I tried
var result = dts.zip(dt, (a,b) => new{a,b})
and:
var result = dts.Concat(dt).ToArray()
But neither do what I would like to do...
I frequently have two arrays that I need to combine to one matrix (same
lenght and type). I was wondering whether there is a linq way that is more
elegant than:
var result = new double[dt.Count, 2];
for (int i = 0; i < dt.Count; i++)
{
result[i, 0] = dts[i];
result[i, 1] = dt[i];
}
I tried
var result = dts.zip(dt, (a,b) => new{a,b})
and:
var result = dts.Concat(dt).ToArray()
But neither do what I would like to do...
Tuesday, 10 September 2013
How can i move a file with existing one
How can i move a file with existing one
How can i move a file one path to another path. I don't want to copy that
file. in the condition of copying the file it is working fine for me.But i
want to move that file don't want to copy that file. it should be move
from one path to another path and overwrite the existing one.
Please help me out.
How can i move a file one path to another path. I don't want to copy that
file. in the condition of copying the file it is working fine for me.But i
want to move that file don't want to copy that file. it should be move
from one path to another path and overwrite the existing one.
Please help me out.
Subscribe to:
Posts (Atom)