How to INSERT data to Vici storage in window phone - windows-phone-7

In my project, i want to add data :
"\n<p>sadasdasdsad</p>"
i use :
CSParameterCollection parameters = new CSParameterCollection();
parameters.Add("#title", f.Title.ToString());
parameters.Add("#sumary", f.Summary.ToString());
parameters.Add("#link[",f.Links[0].Uri.ToString());
parameters.Add("#datetime", f.PublishDate.ToString());
parameters.Add("#cid", idCate.ToString());
CSDatabase.ExecuteNonQuery("INSERT INTO Acticle (title,sumary,link,datetime,cid) VALUES ('#title','#sumary','#link','#datetime','#cid')",parameters);
but nerver complete .
Please help me !

A quick look at that, you have
parameters.Add("#link[",f.Links[0].Uri.ToString());
Do you need that [ in there, after #link, or is it a typo?

Related

How to load custom dataset from CSV in Huggingfaces

I would like to load a custom dataset from csv using huggingfaces-transformers
From https://huggingface.co/docs/datasets/loading_datasets.html#loading-from-local-files
dataset = load_dataset('csv', data_files={'train': "train_set.csv",'test': "test_set.csv"})
You can use load_dataset directly as shown in the official documentation.
I can't find any documentation about supported arguments, but in my experiments they seem to match those of pandas.read_csv
file_dict = {
"train" : "train.csv",
"test" : "test.csv"
}
load_dataset(
'csv',
data_files=file_dict,
delimiter=',',
column_names=['column01', 'column02', 'column03'],
skiprows=1
)

How to create laravel custom storage:link?

How to create laravel custom storage:link?
I would like to point
project/public/storage >> project/storage/app/tenancy/tenants
In config/filesystems.php :
'links' => [
public_path() . '_html\storage' => storage_path('app/public'),
],
after following this tutorial to change /public to /public_html
https://developerhowto.com/2018/11/12/how-to-change-the-laravel-public-folder/
At this moment it is not possible to customize the path with this command. I looked at the source code and couldn't find any hints regarding to this issue.
The simplest thing you can do is make the symbolic link yourself.
The only thing this command does is create that symlink with PHP. This is the source code:
if (! windows_os()) {
return symlink($target, $link);
}
$mode = $this->isDirectory($target) ? 'J' : 'H';
exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
If you really need to make a command for it. You can create your own. If you want to see how Taylor did it, you can look in the following file:
vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCommand.php

Ruby Hash and Tumblr API

controller page, Json output from api
I'm trying to display posts from the users tumblr account on my view page using ruby. I have never done anything with api's before. I'm trying to use Hash tables. my controller code is as such:
#Posts = client.posts"zombieprocess1.tumblr.com"
on my view page using html I have
<%=Posts%>
the response is such
{"blog"=>{"title"=>"Untitled", "name"=>"zombieprocess1", "total_posts"=>1, "posts"=>1, "url"=>"URL", "updated"=>1478191052, "description"=>"", "is_nsfw"=>false, "ask"=>false, "ask_page_title"=>"Ask me anything", "ask_anon"=>false, "followed"=>false, "can_send_fan_mail"=>true, "is_blocked_from_primary"=>false, "share_likes"=>true, "likes"=>1, "twitter_enabled"=>false, "twitter_send"=>false, "facebook_opengraph_enabled"=>"N", "tweet"=>"N", "facebook"=>"N", "followers"=>0, "primary"=>true, "admin"=>true, "messages"=>0, "queue"=>0, "drafts"=>0, "type"=>"public", "reply_conditions"=>3, "subscribed"=>false, "can_subscribe"=>false}, "posts"=>[{"blog_name"=>"zombieprocess1", "id"=>152689921093, "post_url"=>"URL", "slug"=>"", "type"=>"photo", "date"=>"2016-11-03 16:37:32 GMT", "timestamp"=>1478191052, "state"=>"published", "format"=>"html", "reblog_key"=>"NCDqGTzW", "tags"=>[], "short_url"=>"URL", "summary"=>"", "recommended_source"=>nil, "recommended_color"=>nil, "followed"=>false, "liked"=>true, "note_count"=>1, "caption"=>"", "reblog"=>{"tree_html"=>"", "comment"=>""}, "trail"=>[], "image_permalink"=>"url", "photos"=>[{"caption"=>"", "alt_sizes"=>[{"url"=>"URL", "width"=>400, "height"=>544}, {"url"=>"URL", "width"=>250, "height"=>340}, {"url"=>"URL", "width"=>100, "height"=>136}, {"url"=>"URL", "width"=>75, "height"=>75}], "original_size"=>{"url"=>"URL", "width"=>400, "height"=>544}}], "can_like"=>false, "can_reblog"=>true, "can_send_in_message"=>true, "can_reply"=>true, "display_avatar"=>true}], "total_posts"=>1}
I have tried many different formats and can't seem to just get the post url. My thought is to get the post_url and embed each of them so it shows as it would in tumblr on my webpage. Can anyone help me?
Try this:
#posts['posts'].first['post_url']
Or if your response contains more than one post you can return them all like this:
(0...#posts['total_posts']).map { |i| #posts['posts'][i]['post_url'] }
EDIT: Fixed capitalization in second line of code. I assume you are using lowercase variable as per Ruby convention, '#posts'. If not, you should change to a lowercase variable as this may be confusing something.

Retrieving BLOB Data from MySQL Database

I am trying the following simple code.query is working but showing data of BLOB field unusual. How can I fix it?
while($row=mysql_fetch_array($result))
{
echo$row['hline'].$row['date'];
print("<BR/>");
echo$row['details'];//blob field
}
proxy server2005-07-18 01:2
PK!Ýü•7f [Content_Types].xml ¢( ´TËnÂ0¼Wê?D¾V‰¡‡ªªú8¶H¥ì
XõKöòúûnDUA*å)YïÌììăÑÚšl 1iïJÖ/z,'½ÒnV²ÉK~ϲ„Â)a¼ƒ’m ±Ñðúj0ÙHu»T²9bxà<É9X‘
ÀQ¥òÑ
¤×8ãAÈO1~ÛëÝqé‚Ãk6$N{9›êÍ+P9Y ¢†vuÇGD²ìÃï»ÆoR€”wàͳ¶
ÌIÊŠ~‰‰˜8›ïWòZè“"V0}¿˜ûßÀ»„´ù“>þÁŒýuQwHoî·áÿÿPK!‘·óN_rels/.rels ¢( Œ’ÛJA†ïßaÈ}7Û
"ÒÙÞH¡w"ë„™ìw̤ھ½£ ºPÛ^æôçËOÖ›ƒ›Ô;§<¯aYÕ Ø›Gßkxm·‹PYÈ[š‚g
GΰinoÖ/<‘”¡<Œ1«¢â³†A$>"f3°£\…ȾTºI S‘ÌõŒ«º¾ÇôWš™¦ÚY
igï#µÇX6_Ö]7~
What kind of data is your blob? If your blob is an image you need to base64_encode() before putting in your html. It will then looks like:
echo '';

Opa : give a name to a binary resource

I'm trying to download a file from an opa database. I've used the following code :
case {path:[], query:[("download", filename)], ...} : Resource.binary(/myDatabase[filename], "application/txt")
It's working fine, but the file I download is always named "download.txt". How can I change this name ?
Thanks
case {path:[], query:[("download", filename)], ...} : Resource.binary(/myDatabase[filename], "application/txt") |> Resource.add_header(_, {content_disposition={attachment=filename}})

Resources