1. Initialize git local repo "master" using the command
Go to the folder where your local developmet happening
E:\backup\me\chasy>git init
Add data to local master repository
E:\backup\me\chasy>git add .
E:\backup\me\chasy>git commit -m"larval based chasy project added to repo"
E:\backup\me\chasy>git remote add origin https://github.com/gunabalans/chasy.git
E:\backup\me\chasy>git remote -v
origin https://github.com/gunabalans/chasy.git (fetch)
origin https://github.com/gunabalans/chasy.git (push)
E:\backup\me\chasy>git push -f origin master
This is forced update if local maser repo is started before online github origin repo
===================
Now ready to sync with development
E:\backup\me\chasy>git add README.md
E:\backup\me\chasy>git commit -m"read me update"
E:\backup\me\chasy>git push oigin master
Wednesday, 11 March 2020
Friday, 21 February 2020
elgg ajax in action
in start.php
$plugin_path = elgg_get_plugins_path();
$base = $plugin_path . 'custom_modules/actions/';
// action ajax page
elgg_register_action("custom_modules/assign_assessment_type", "$base/assign_assessment_type.php");
//add below code in view
$("#assessment_type").click(function(){
var steps = 1;
var mod_id = 10;
elgg.action('custom_modules/assign_assessment_type', {
data: { mod_id: mod_id,steps_id:steps},
success: function(json) {
//alert(json);
}
});
});
});
$plugin_path = elgg_get_plugins_path();
$base = $plugin_path . 'custom_modules/actions/';
// action ajax page
elgg_register_action("custom_modules/assign_assessment_type", "$base/assign_assessment_type.php");
//add below code in view
$("#assessment_type").click(function(){
var steps = 1;
var mod_id = 10;
elgg.action('custom_modules/assign_assessment_type', {
data: { mod_id: mod_id,steps_id:steps},
success: function(json) {
//alert(json);
}
});
});
});
Monday, 13 January 2020
toggle a dom element by id using radio button group jquery
$('input:radio[name="radiogroupname"]').click(function() {
if ($(this).val() == 'one') {
$('#id').show();//css('display','block');
}
else {
$('#id').hide();//css('display','none');
}
});
Sunday, 5 January 2020
enable or disable button using check box using javascript
<!DOCTYPE html>
<html>
<body>
<div id="agree-form" >
<form method="post" action="$action_url">
<div id="button-part" style="float:left;margin-right:50px;">
<input type=checkbox name="agree" id='agree_terms' value='agreed'" onclick="document.getElementById('agreesubmit').disabled = this.checked ? false:true;"/>
<label>Agree</label>
</div>
<div class="elgg-foot">
<input style="width:100px" type="submit" id="agreesubmit" value="Submit" disabled>
</div>
</form>
</div>
</body>
</html>
<html>
<body>
<div id="agree-form" >
<form method="post" action="$action_url">
<div id="button-part" style="float:left;margin-right:50px;">
<input type=checkbox name="agree" id='agree_terms' value='agreed'" onclick="document.getElementById('agreesubmit').disabled = this.checked ? false:true;"/>
<label>Agree</label>
</div>
<div class="elgg-foot">
<input style="width:100px" type="submit" id="agreesubmit" value="Submit" disabled>
</div>
</form>
</div>
</body>
</html>
Saturday, 14 December 2019
s3 deleteObject statusCode 204
object(Aws\Result)#312 (2) {
["data":"Aws\Result":private]=>
array(4) {
["DeleteMarker"]=> bool(false)
["VersionId"]=> string(0) ""
["RequestCharged"]=> string(0) ""
["@metadata"]=> array(4) { ["statusCode"]=> int(204)
["effectiveUri"]=> string(115) "https://dde.s3.us-east-2.amazonaws.com/upload/gbs.jpg" ["headers"]=> array(4) { ["x-amz-id-2"]=> string(76) "HNZj7VPsQ8="
["x-amz-request-id"]=> string(16) "0D"
["date"]=> string(29) "Sat, 14 Dec 2019 09:05:11 GMT"
["server"]=> string(8) "AmazonS3" }
["transferStats"]=> array(1) { ["http"]=> array(1) { [0]=> array(0) { } } } } } ["monitoringEvents":"Aws\Result":private]=> array(0) { } }
Check is object deleted in console - if actually deleted -
it looks apk check exists after deleting that is why 204 no content status so use
["DeleteMarker"]=> bool(false)
["VersionId"]=> string(0) ""
["RequestCharged"]=> string(0) ""
["@metadata"]=> array(4) { ["statusCode"]=> int(204)
["effectiveUri"]=> string(115) "https://dde.s3.us-east-2.amazonaws.com/upload/gbs.jpg" ["headers"]=> array(4) { ["x-amz-id-2"]=> string(76) "HNZj7VPsQ8="
["x-amz-request-id"]=> string(16) "0D"
["date"]=> string(29) "Sat, 14 Dec 2019 09:05:11 GMT"
["server"]=> string(8) "AmazonS3" }
["transferStats"]=> array(1) { ["http"]=> array(1) { [0]=> array(0) { } } } } } ["monitoringEvents":"Aws\Result":private]=> array(0) { } }
Check is object deleted in console - if actually deleted -
it looks apk check exists after deleting that is why 204 no content status so use
function delete_s3_object($keyname){
try{
$s3 = s3client();
$result = $s3->deleteObject([
'Bucket' => 'dddd',
'Key' => $keyname
]);
var_dump($result);
if($result["@metadata"]["statusCode"] === 204){
return true;
}else{
return false;
}
} catch (S3Exception $e) {
return false;
}
}
Thursday, 12 December 2019
chandrayaan-2-mission
With reference to the information below from the source https://www.indiatoday.in/science/story/chandrayaan-2-mission-did-vikram-lander-make-a-crash-landing-on-the-moon-1596706-2019-09-07
Scientists are also trying to find out from the data of Vikram's flight data recorder why it lost its way at an altitude of 2.1 km. A flight data recorder is a device like the black box of an aircraft.
Sources in Isro said that Vikram deviated from its path at an altitude of 2.1 km from its designated landing spot on the Moon's South Pole. After that, the lander reached 335 meters at a speed of 60 meters per second. It was at this place that Vikram lost contact with the Isro station in Bengaluru.
The key points are
point 0 is from the question why it lost its way at an altitude of 2.1 km.
what i believe the rockers attached to the lander lost it power or due to loss in power it is not able to counteract the moon gravity
so deviation from the expected path, The path is not straight down - so it is not a free fall
Next: IF we consider as free fall from this point, then also due to very small gravity of moon (1.62 m/s²)
The impact is going to be 5.98 times less than if it happen in Earth.
We do a little calculation using equation of motion considering free fall with following points
1. the lander reached 335 meters at a speed of 60 meters per second.
2. The approximate combined mass of the lander and rover is 1,471 kg (3,243 lb).
3. Gravity in moon is 1.62 m/s² - this is the constant acceleration in Moon
S = ut + (1/2)*at²
=> 335 m = 60 m/s * t + (1/2)* 1.64 * t²
=> 0.82 t² + 60 t - 335 = 0
=> t = 5.212 sec to reach the moon surface
=> final velocity - when it hit the moon surface
v = u + at
v = 60 m/s + 1.64 m/s² * 5.212 s
v = 68.54768 m/s it is about (246.77 km/hr) is the final velocity - when it hit the moon surface - if it is considering free fall
Here the communication delay from moon to earth is critical
(The delay for Earth-Moon communications is about 1.25 second (distance is ~ 380,000 km, the speed of light is ~300,000 km/s))
So at the time we receive the information that "the lander reached 335 meters at a speed of 60 meters per second"
The lander actually at the speed of 62.085 m/s and at the distance of 274 m from moon surface.
Thus the final conclusion is
1. The delay we use here 1.25 s may be high some times due to hardware limitations,
2. The other important issue is that the measuring object position and point on the surface of the moon,
landing point is not same as place user for measurement, the difference in height between these two places in moon from the point of measurement
The above two point narrow down the actual distance "the lander reached 335 meters at a speed of 60 metres per second"
So, probably the lander lost its communication only after landing.
File upload to S3 using aws php sdk
Step 1. Create AWS IAM user with s3 full access and api access only option
Step 2: Create a user Group with s3 full access
Step 3: Add AWS IAM user to to group created
Step 4: Finally on creating the user it will show you user credentials also one time download file with credential to use IAM user
Then go to iam user
Step 5: click on the user menu in the list, u can get the ARN - copy have it for further use

6. Next: Step is creating S3 bucket
7. Now Allow this bucket to access from IAM user using bucket policy
8. go to policy generator
https://awspolicygen.s3.amazonaws.com/policygen.html
This is like whom (IAM) to get access to what resource (S3)
generate policy and copy past to bucket policy in point 7.

Finally use php AWS sdk to access bucket from php code
Example:
https://gunabalans.blogspot.com/2019/09/aws-s3-file-upload-using-php-sdk.html
Subscribe to:
Posts (Atom)