|
i need complete code of a search engine where it crawl minimum of 5 sites and must also allow a user to enter a term and get its url
|
|
|
|
|
|
Google might help you—not kidding, they usually do release some guidance on how they work on the crawlers, indexers etc.
If that is not what you are looking for, then try to study Elasticsearch and see how it works; GitHub - elastic/elasticsearch: Open Source, Distributed, RESTful Search Engine. But remember, before reading the source code, it might need that you study the basics of how coding works as well as the core components of computer science, as search engines or indexation gets pretty messy down the road.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
hello, am looking for a simple code in C# to develop QR scanner for android phone camera. please help.
|
|
|
|
|
|
hi
i have android webview app. one of my parts is to download blob sound data link to my device.my step as flow:
1- live audio record
2- create blob url
3- i can listen the url, and once press download i receive this message (unknown blob protocol)
any solution please?
|
|
|
|
|
Member 14501743 wrote: ...i receive this message (unknown blob protocol) From where? What does the download code look like? Have you stepped through it using the debugger?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
my html script is :
تسجيل الصوت
الايعازات
بدء
ايقاف
-->
and my js script is :
'use strict'
var log = console.log.bind(console),
id = val => document.getElementById(val),
ul = id('ul'),
gUMbtn = id('gUMbtn'),
start = id('start'),
stop = id('stop'),
stream,
recorder,
counter = 1,
chunks,
media;
gUMbtn.onclick = e => {
var mv = id('mediaVideo'),
mediaOptions = {
audio: {
tag: 'audio',
type: 'audio/mpeg',
ext: '.mp3',
gUM: { audio: true }
}
};
media = mv.checked ? mediaOptions.video : mediaOptions.audio;
navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => {
stream = _stream;
id('gUMArea').style.display = 'none';
id('btns').style.display = 'inherit';
start.removeAttribute('disabled');
recorder = new MediaRecorder(stream);
recorder.ondataavailable = e => {
chunks.push(e.data);
if (recorder.state == 'inactive') makeLink();
};
log('got media successfully');
}).catch(log);
}
start.onclick = e => {
start.disabled = true;
stop.removeAttribute('disabled');
chunks = [];
recorder.start();
}
stop.onclick = e => {
stop.disabled = true;
recorder.stop();
start.removeAttribute('disabled');
}
function makeLink() {
var blob = new Blob(chunks, { type: media.type })
, url = window.URL.createObjectURL(blob)
, li = document.createElement('li')
, mt = document.createElement(media.tag)
, hf = document.createElement('a')
;
mt.controls = true;
mt.src = url;
hf.href = url;
hf.download = `SRV_${counter++}${media.ext}`;
hf.innerHTML = `donwload ${hf.download}`;
li.appendChild(mt);
li.appendChild(hf);
ul.appendChild(li);
}
|
|
|
|
|
Hello to all! Hope you are fine. I am developing an e-commerce android app and integrating Stripe payment gateway in it and using Google Fire base as real time database.
I browsed the official website of stripe and took the source code from there. I used my test key from there. I successfully generated Stripe Token and saved it on my server (i-e Fire base). But I am unable to make an actual charge by using that token. That means no transaction shows on my stripe account. I am pasting my code, guide me what should i do to create/make charge?
Card cardToSave = cardInputWidget.getCard();
if (cardToSave == null) {
Toast.makeText(getActivity(),"Invalid Card Data",Toast.LENGTH_LONG).show();
// mErrorDialogHandler.showError("Invalid Card Data");
}
else{
Stripe stripe = new Stripe(MainActivity.mcont,
"pk_test_XZFc6CW7wmDMl4WWESxtvWd300ibs1wr85");
stripe.createToken(
cardToSave,
new TokenCallback() {
public void onSuccess(final Token token) {
// Send token to your server
customer_ref =
database.getReference("Customers").child(MainActivity.user.getUid());
final String tokenid = token.getId();
//saving the tokenID on my server(i-e fiebase)
final Map<String, Object> params = new HashMap<>();
params.put("amount", paid);
params.put("currency", "usd");
params.put("description", "Example charge");
params.put("source", tokenid);
HashMap map = new HashMap();
map.put("StripeToken",tokenid);
customer_ref.updateChildren(map);
try {
// creating charge object
Charge charge = Charge.create(params);
} catch (AuthenticationException e) {
e.printStackTrace();
} catch (InvalidRequestException e) {
e.printStackTrace();
} catch (APIConnectionException e) {
e.printStackTrace();
} catch (CardException e) {
e.printStackTrace();
} catch (APIException e) {
e.printStackTrace();
}
|
|
|
|
|
The Stripe developers hang out here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
--Android Code
--============
<pre>private class UploadData extends AsyncTask<String, Void, String>
{
@Override
protected void onPreExecute()
{
progressDialog.setMessage("Wait !!! Transferring SQLite Data into SQL Server DB.");
progressDialog.setIndeterminate(false);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setCancelable(false);
progressDialog.show();
}
@Override
protected void onPostExecute(String result)
{
progressDialog.dismiss();
AlertDialog YesNo1 = DialogYesNo();
YesNo1.setMessage("Hh Count Tablet: " + HhTablet + " , Hh Count Server: " + HhServer + "\n" + " -- has been transferred to SQL server DB !!! ");
YesNo1.setCancelable(false);
YesNo1.show();
HhServer = 0;
}
@Override
protected String doInBackground(String... params)
{
String result = "";
httpclient = new DefaultHttpClient();
httppost = new HttpPost("http://172.16.15.13/testing/datasync.php");
try
{
try
{
cursor = ConnectionDB.SelectRecord("Select HH,PartM,GISID,Mohalla from HH");
HhTablet = cursor.getCount();
if (cursor != null)
{
cursor.moveToFirst();
while (!cursor.isAfterLast())
{
for (int k = 0; k < HhTablet; k++)
{
nameValuePairs = new ArrayList<NameValuePair>(4);
nameValuePairs.add(new BasicNameValuePair("HH", cursor.getString(cursor.getColumnIndex("HH"))));
nameValuePairs.add(new BasicNameValuePair("PartM", cursor.getString(cursor.getColumnIndex("PartM"))));
nameValuePairs.add(new BasicNameValuePair("GISID", cursor.getString(cursor.getColumnIndex("GISID"))));
nameValuePairs.add(new BasicNameValuePair("Mohalla", cursor.getString(cursor.getColumnIndex("Mohalla"))));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HhServer = HhServer + 1;
}
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String responseBody = httpclient.execute(httppost, responseHandler);
JSONObject json = new JSONObject(responseBody);
JSONArray jArray = json.getJSONArray("posts");
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
for (int i = 0; i < jArray.length(); i++)
{
HashMap<String, String> map = new HashMap<String, String>();
JSONObject e = jArray.getJSONObject(i);
String s = e.getString("post");
JSONObject jObject = new JSONObject(s);
map.put("HH", jObject.getString(cursor.getString(cursor.getColumnIndex("HH"))));
map.put("PartM", jObject.getString(cursor.getString(cursor.getColumnIndex("PartM"))));
map.put("GISID", jObject.getString(cursor.getString(cursor.getColumnIndex("GISID"))));
map.put("Mohalla", jObject.getString(cursor.getString(cursor.getColumnIndex("Mohalla"))));
mylist.add(map);
cursor.moveToNext();
}
}
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
cursor.close();
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
return result;
}
}
--PHP code
--==========
<?php
include ("dbconnection.php");
$json = file_get_contents('php://input');
$obj = json_decode($json);
$HH=$_POST[HH];
$PartM=$_POST[PartM];
$GISID=$_POST[GISID];
$Mohalla=$_POST[Mohalla];
$query = "INSERT INTO HH(HH,PartM,GISID,Mohalla) VALUES ('$HH','$PartM','$GISID','$Mohalla')";
$stmt = $conn->query( $query );
if ($query)
{
$response["success"] = 1;
$response["message"] = "Record is successfully created.";
echo json_encode($response);
}
else
{
$response["success"] = 0;
$response["message"] = "Sorry! An error occurred.";
echo json_encode($response);
}
$posts = array(1);
header('Content-type: application/json');
echo json_encode(array('posts'=>$posts));
$stmt = null;
$conn = null;
?>
modified 6-May-19 6:12am.
|
|
|
|
|
What exactly happens when you run this code? What is the data sent in the URL, and what is the response from the server?
|
|
|
|
|
Data is sending properly from this code but I am having problem in the loop. In my SQLite DB I am having 5 records but I am getting only one record when I am sending from the TAB.
|
|
|
|
|
Sorry but your descrikption is not clear. Please edit your question and explain exactly where the problem occurs, and what happens.
|
|
|
|
|
|
So I have created my first mobile app with xamarin cross platform. I only use the Android part.
I have tested my app extensively and all works very fine.
I also have a server and all the data comes from this server by APIs.
All the CRUD is working
After that I created an apk-file and send it to my tablet and Phone.
The pages/View are presented but with a very small font.
But that's not my problem. The problem is: no data. It looks like nothing is returned but, there are also no messages of network problems.
So, what's going on?
|
|
|
|
|
At a guess, there is a bug somewhere in your code.
|
|
|
|
|
I'm now checking it...But it runs fine on my development computer. And the server is somewehere in the world. I have no idea but it is not a local server.
I'll get back
|
|
|
|
|
Found it. No bugs.
I used just a very small font (6). On my virtual device it looks fine but on my tablet it wasn't readable.
I'm very happy it works, but I'm very sorry for posting here. I was too hasty
Thanks for the reply.
|
|
|
|
|
What was the problem with the data connection?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
|
speech to text and text to speech android application code
|
|
|
|
|
|
In my react native app I am trying to get URL with the highlighted text from
any browser, I used ShareMenu to get highlighted text but failed to get URL, If any user highlighted any text from any website in a browser I want that website URL also, how can I achieve this I have tried many ways but failed, please suggest any solution.
|
|
|
|
|
The only thing happening ASAP is the removal of your ad.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|