how to run a php project which required Yii framwork [on hold]

Uncategorized
Question: I want to run a PHP project(php-open-school-project) which requires a Web server, PHP 5 and Yii. I ran it on wamp-server. So first, two requirements are full fill. I have downloaded and run Yii framework successfully as a separate module. But I don't know how to connect it with php-open-school-project or how to full fill the Yii requirement from here?? Since its requirements cannot full fill. So, it throws exception written under the catch block. try { if($this->_connection->enableProfiling) Yii::beginProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute'); $this->prepare(); if($params===array()) $this->_statement->execute(); else $this->_statement->execute($params); $n=$this->_statement->rowCount(); if($this->_connection->enableProfiling) Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute'); return $n; } catch(Exception $e) { if($this->_connection->enableProfiling) Yii::endProfile('system.db.CDbCommand.execute('.$this->getText().')','system.db.CDbCommand.execute'); $errorInfo = $e instanceof PDOException ? $e->errorInfo : null; $message = $e->getMessage(); Yii::log(Yii::t('yii','CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.', array('{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand'); if(YII_DEBUG) $message .= '. The SQL statement executed was: '.$this->getText().$par; throw…
Read More

draw polyline on roads in android

Uncategorized
Question: I currently have a google map in my android app with user location marker on open map and when user click to a position in map a blue marker will shows(destination marker) with a polyline between user location marker and destination marker like this image: How can i draw this lines in roads ??? I have following code :@Override public void onMapReady(final GoogleMap googleMap) { this.googleMap = googleMap; googleMap.setOnMapLongClickListener(new GoogleMap.OnMapLongClickListener() { @Override public void onMapLongClick(LatLng latLng) { destinationLocation = new Location(LocationManager.GPS_PROVIDER); destinationLocation.setLatitude(latLng.latitude); destinationLocation.setLongitude(latLng.longitude); destinationMarker = googleMap.addMarker(new MarkerOptions().position(latLng).title("your destination").icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_destination_marker))); Polyline line = googleMap.addPolyline(new PolylineOptions() .add(new LatLng(userLocation.getLatitude(), userLocation.getLongitude()), new LatLng(destinationLocation.getLatitude(), destinationLocation.getLongitude())).color(Color.BLUE).width(10)); } }); } Answer: Read more
Read More

Video encryption by Crypto.js

Uncategorized
Question: How to encrypt and decrypt video and audio streaming url by crypto.js? This line of code :var encrypted = CryptoJS.AES.encrypt("#string#", "#theKey#"); require data as string. So what can I do? I just have a video URL. Answer: It's not as simple as put the url in a variable, you will have to listen to a stream, & when you receive data you will have to download it and encrypt it after. Just check at ffmpeg node_module if you have specific video stream url (m3u format) or just request if you have a file video url Read more
Read More

Copied C9 Workspace with Rails app, PostgreSQL service won’t start: permission denied

Uncategorized
Question: I just copied a C9 workspace with a functional Ruby on Rails app, and can't seem to get the PostgreSQL service running. running this command:sudo service postgresql start returns this error:The PostgreSQL server failed to start. Please check the log output:2017-08-15 06:50:57 UTC FATAL: could not remove old lock file "postmaster.pid": Permission denied 2017-08-15 06:50:57 UTC HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again. after deleting this file manual and running again:The PostgreSQL server failed to start. Please check the log output:2017-08-15 07:01:45 UTC FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied I'm guessing I need to setup some permission access to PostgreSQL, but I'm not sure how to do that. Any ideas?…
Read More

How to make boxplot for time format data?

r
Question: I have a data frame with four columns showing the daylight in hours. I need to make boxplot to compare different groups and also to take anova test for comparing the groups. here is what i did but it is not working. A B C D 15:15:08 15:29:08 15:32:50 15:34:12 15:02:32 15:23:43 15:21:06 15:34:50 14:40:34 14:58:30 15:21:06 15:32:50 15:15:08 15:29:08 15:21:06 15:34:50 15:10:03 14:58:30 15:30:01 15:34:12 15:23:43 15:19:42 15:30:01 15:34:00 14:56:24 15:29:08 15:21:06 15:34:50 15:15:08 14:58:30 15:24:56 15:34:50 15:15:08 14:58:30 15:32:50 15:34:12 14:56:24 14:42:57 15:32:50 15:34:50 14:56:24 14:47:35 15:21:06 15:30:01 14:56:24 15:23:43 15:24:56 15:34:12 15:15:08 14:49:51 15:30:01 15:34:12 15:02:32 15:32:50 15:30:01 15:27:10 15:10:03 15:29:08 15:34:12 15:34:12 DF
Read More

Can I decode an xpi file using any software for Windows?

Uncategorized
Question: The containing .xpi file I have on my pc only displays what appears to be gibberish, like the following below. ========================================================================= EÙtò¼5d¨Šîx›b5I‡„ŽœpGñ³FBÜ ç±w×ÅjR„dÊøº®Þg¾’Ÿæj(·I®XœPyb-tè•9³} 𼿿à8HS:sö}êfÆD¤’ã-ÀÃ=mcÀx†Î0 ‡‘ŠÀ@ÄÄ$ÈVã ‚2Bé=ü,èsfrbg+œaù9dT˜¸Â€àü3;48N ¢¯¨ÿrÛ£pã-^øœ3ßF4¡:#88;ðÿYð #³$¨ƒ»Ê (T‘ßÁÃÃE‰üŸÝˆ´±BÚ¸9‰»Ø:ÿCØ~Œ¿âá&ÿ‘ño()ï€Î'õzSñšçolåÑzÉH}r×f÷×=Y>™!ˆš¢Uò%öeŸ' Jù+à¦^Å W+$òØ6Ø¥å®{CTJJ.ê– ‹µM1(aùUxœ§gh.P)²t+—3½ù"š enä ¥ÝíVIÔ¾U],í^':ù5spîéjµx±]øƒ‚õÔJ½É‘7
Read More

Angular(2) – Base64 Image from URL [on hold]

Uncategorized
Question: I need to create a function that receives the URL of an image and returns that image in Base64. I created the function:getBase64Image(url: string): Promise { return this.http.get(url, { headers: this.headers, responseType: ResponseContentType.Blob }) .toPromise() .then(res => { let blob: Blob = new Blob([res.json()], { type: res.headers.get("Content-Type") }); var reader = new FileReader(); reader.readAsDataURL(blob); reader.onloadend = function(e){ base64 = reader.result; SOME_CODE } }) My problem is on how to return Base64 (reader.result). Answer: Here is an answer with example to get image from api and return it as base64. Read more
Read More

Android SBC with mPCIE modem only connecting to 2G

Uncategorized
Question: I have an Android SBC with a ZTE MF210v2 modem. The modem is 2G and 3G capable and the frequencies match our local mobile networks in Australia. However the modem only works with 2G capable SIM card. I cannot get it connected on 3G simcards/networks. I have specifically selected '3G preferred' in the device settings. I have access to the source code on this board. Can anyone advise where I should be looking to determine the modems configuration in relation to 2G/3G etc? The board is from China so the bands/frequencies might be hard coded incorrectly? Thank you Answer: Read more
Read More

Is there a way to include the instance of a service in the Get-Service and Get-WmiObject commands?

powershell
Question: I am trying to write a script that stops a service if it exists. The service I want to stop has multiple instances and I was trying to get the service based on the given instance name (it shows up as ServiceName$InstanceName). The weird thing is when I run the following command:Get-Service -Name "ServiceName*" | Format-List -Property Name or Get-WmiObject -Class Win32_Service -Filter "name like 'ServiceName%'" | Format-List -Property Name The results look like:Name : ServiceName$InstanceNameA Name : ServiceName$InstanceNameB Name : ServiceName$InstanceNameC Name : ServiceName$InstanceNameD Name : ServiceName$InstanceNameE Name : ServiceName$InstanceNameF Given the above results, I assumed that if I wanted to search for a service named ServiceName with an instance of InstanceNameC I could do something like Get-Service -Name "ServiceName$InstanceNameC" or Get-WmiObject -Class Win32_Service -Filter "name='ServiceName$InstanceNameC'" but it's…
Read More

JAVAFX in android studio

Uncategorized
Question: Is there a way that i can directly install gluon plugin to android studio. I would like to use scene javafx in my project with the help of scene builder i am searching for dependencies for javafx to import in my gradel. I don't know what is possible and what's not possible with these so many IDE's,plugins,Platforms etc., Answer: Read more
Read More

Progress bar auto hide in debug mode, but not in a simply run

android
Question: Unexpected issue I'm getting while run my android app. I call rest API with using progress bar AsyncTask. Somehow progress load correctly and hide correctly while I'm in debugging mode. When run my app without debugging mode the progress load correctly but not hide automatically. Below is my code 'MainActivity.java import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.*; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.params.BasicHttpParams; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.Toast; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity { TextView tv1; ProgressDialog pd; Button Btngetdata; String myJSON; //URL to get…
Read More

Form height and width measured differently than TextBox height

Uncategorized
Question: I'm using a function to create textboxes for a class for making arrays of textboxes, and I want to center the grid to the form. After some debugging, I realized that the form height and width are measured on a different scale than the width and height of the textboxes. Values for variables:height = 50 width = 50 numCols = 10 numRows = 10 vertCellOffset = 50 horzCellOffset = 50 private TextBox AddNewTextBox() { SOSTextBox txtBox = new SOSTextBox(); this.List.Add(txtBox); hostForm.Controls.Add(txtBox); txtBox.Height = height; txtBox.Width = width; float scrnWidth = hostForm.Width; float scrnHeight = hostForm.Height; txtBox.Top = (int)(((int)((Count - 1) / numCols) + 1) * vertCellOffset + (scrnHeight / 2 - ((numRows / 2 + 1) * vertCellOffset))); txtBox.Left = (int)((((Count - 1) % numCols) + 1) * horzCellOffset…
Read More