How to crop image on PHPPresentation

Uncategorized
Question: This is my code and I can't find any documentation:$shape2 = $currentSlide->createDrawingShape(); $shape2->setName("IMAGE_NAME") ->setDescription("IMAGE_DESCRIPTION") ->setPath("IMAGE_PATH") ->setWidth(300) ->setOffsetX(110) ->setOffsetY(120); Answer: Just use php function for this and then put the filepath of the cropped image to PHPPresentation http://php.net/manual/en/function.imagecrop.php Read more
Read More

Retrieve value from a table

Uncategorized
Question: I want to know the content of first td tag in each tr tag. The problem is I need to store the title of a file and the file name in the database without repeating the code for each chosen file. I am trying to get the value of the tag. I have written a code that shows to the user a table of two columns the first one is the file title, the second is a button to choose file So that user can upload multi files and send it by Send button at once. To clarify the idea: This is my code:Course Report @foreach ($temp1 as $fi) @if($fi->title =="Course Report") id}}">delete @endif @endforeach @if($fi->title !="Course Report") {{csrf_field()}} @endif Sample of Midterm Exam Answer sheet – High @foreach…
Read More

Matching colors using multiple wireframes in R package lattice

Uncategorized
Question: Using the syntax below I managed to have 2 wireframes in 1 plot (after interpolation). However the color schemes differ because they are based on the range of the z values (which are different for both z1 and z2). Since in my case the z-axis is always between 0 and 1, i would like to match the color gradients for both plots. To clarify, the color gradient on the right side of the plot should always be between 0 and 1 (as is the z-axis) and not between the minimum and maximum of z1 and z2 vector respectively. Can anyone help me out here? library(lattice) library(akima) library(reshape2) x
Read More

Match_parent on dynamically added GridLayout

Uncategorized
Question: I have some TextView inside a GridLayout. The GridLayout is inflated dynamically at runtime and then added to the main layout. The width of my boxitem (the GridLayout) is scaled correctly but the height seems to always wrap the content. I want the height do match the parent. main.axml: border.xml: BoxItem.axml: and here is my On Create protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); var view = LayoutInflater.Inflate(Resource.Layout.BoxItem, null); FindViewById(Resource.Id.CenterLayout).AddView(view); } Answer: Read more
Read More

Deploying Laravel to GAE php flex environment with npm dependencies and gulp

Uncategorized
Question: I'm trying to deploy Laravel project with Gulpfile and Npm dependencies to php flex environment. I am already had node_modules directory. What lines i need to add to my app.yaml to ignore this folder and install npm-dependencies via command "npm i". Maybe i need to modify post-deploy-cmd section of my composer.json? Thank you for replies Answer: Read more
Read More

How to do submodule sparse-checkout with Git?

Uncategorized
Question: There are a lot of articles and SO questions about sparse-checkout. Unfortunately I did not find concrete examples. I would like to get this following example work: Create a submodule cd ~ mkdir sub && cd $_ git init mkdir foo && touch $_/foo mkdir bar && touch $_/bar git add . git commit -am "Initial commit" Create a project cd ~ mkdir project && cd $_ git init git submodule add ../sub sub git config -f .gitmodules submodule.sub.shallow true git config -f .gitmodules submodule.sub.sparsecheckout true echo foo/* > .git/modules/sub/info/sparse-checkout git commit -am "Initial commit" git submodule update cd sub git checkout . A this point I am expecting sub folder to only contain foo/foo not bar. Unfortunately it doesn't work: $ ls bar/ foo/ How can I make…
Read More

“Single-row subquery returns more than one row” in Update statement

Uncategorized
Question: I've been struggling for a couple of days to work out how to make my update statement work. The select statement appears to work as expected, but when I try to update my column values I get an ORA-01427 single-row subquery returns more than one row error. Here's the code:UPDATE tbl_metrics SET act_end_time = (WITH base AS (SELECT caseid, entry_timestamp FROM activity WHERE act_id IN (100, 700, 300) ) SELECT t1.entry_timestamp FROM base t1, tbl_metrics t2 WHERE t1.caseid = t2.caseid AND t2.act_start_time < (SELECT MIN(t1.entry_timestamp) FROM base t1 WHERE t1.caseid = t2.caseid)) The idea is that the tbl_metrics.act_end_time column is updated with the lowest entry_timestamp value from activity table where activity.caseid=tbl_metrics.caseid and activity.entry_timestamp>tbl_metrics.act_start_time and the activity.act_id is 100, 700, or 300. Answer: I think it should be like this:UPDATE…
Read More

Cassandra Failure Detector

Uncategorized
Question: Cassansra Failure detector is responsible to mark one node up or down based on the heart beat value.Basically it keeps track of tje heart beat values thats coming through gossip for each node and periodically checks if heart beat value is monotonously increasing integer value..if the value is stagnant for over a period of time,FD mark the node as down. My question is what is the period or how many heartbeat values are checked to determine if the node is down... Is there any such logic that FD does check so many periodic hb values in every x second... Answer: The only configuration option I've found is the phi_convict_threshold in cassandra.yaml, which tunes the probability of marking a specific node as unavailable. There's a suggestion in the documentation to…
Read More