天道酬勤,学无止境

url

Android Media Player: Url is not set properly

i tried a lot to play the music from localhost path but it is not playing i am getting an error as uri is not correctly given means it is going to catch block in the below code i have designed as this in xml file 2 buttons which is start and stop then populated the uri in java file can anyone help me in correcting the code below public class MusicAndroidActivity extends Activity { static MediaPlayer mPlayer; Button buttonPlay; Button buttonStop; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); buttonPlay = (Button)

2021-10-27 03:59:20    分类:问答    java   android   url   media-player

如何在 PHP 中将 URL 分解为其组成部分?(How do I break apart a URL to its component parts in PHP?)

问题 正则表达式从来都不是我的强项之一,这一点让我很难过。 作为项目的一部分,我想用 PHP 开发一个 SEO 链接类。 通过 Apache 处理mod_rewrite对我来说相当简单,而且效果很好。 但是,我想创建一个函数,该函数能够根据我作为第一个(也是唯一一个)参数传入的动态 URL 生成 SEO 链接。 例如,这将是 PHP 中的函数调用: <a href="<?= SEO::CreateLink('blog/post.php?post=123&category=5') ?>" title="Blog Post Title">Blog Post Title</a> 然后函数CreateLink会分析传入的字符串,并输出如下内容: blog/blog-post-title 博客文章的 URL 存根已经存储在数据库中。 我认为最好的实现方式是分析传入的动态URL字符串,生成关联数组进行分析。 我的问题是,使用 URL 并在 PHP 中生成以下关联数组的正则表达式是什么? link_pieces['page_type'] = 'blog/post'; link_pieces['post'] = 123; link_pieces['category'] = 5; 其中page_type是基本目录和没有扩展名的请求页面,其他数组值是请求变量? 回答1 你可以只使用 parse_url

2021-10-27 03:44:06    分类:技术分享    php   url

authentication username password url in blackberry

I'm setting up a connection to a site which requires a username and password but it doesn't connect and I don't know the reason can you help me with this please? This is the code I'm using { HttpsConnection connection; connection = (HttpsConnection) Connector.open(url + getBlackBerryConnectionParams()); connection.setRequestProperty("Authorization", "Basic" + new String(getEncode())); } public byte[] getEncode() { String login = "user:@@iPass"; byte[] encoded = null; try { encoded = Base64OutputStream.encode(login.getBytes(), 0, login.length(), false, false); } catch (IOException e) { // TODO

2021-10-27 03:03:48    分类:问答    url   blackberry

Blob URL 能否被视为防止用户从开发者控制台内部复制图像的解决方案?(Can Blob URLs be considered as a solution to prevent users from copying the images from inside the developers console?)

问题 众所周知,如果我们将图像(或视频)文件作为二进制对象读取,然后为这些对象创建一个 URL,那么我们就可以在 HTML 中显示这些带有这些 blob URL 的文件,而这些文件在另一个窗口中无法访问或选项卡,因为它只存在于当前会话中。 因此,用户不能简单地保存文件(例如,我们不能简单地下载 youtube 视频,因为他们的视频标签将 blob URL 作为其来源)。 那么我们可以说这是一种防止用户使用开发者控制台窃取敏感文件的方法吗? 如果是这样,为什么这么多网站不这样做? 我知道许多网站都拥有受版权保护的图片或出售壁纸,但您只需从控制台下载它们的文件即可。 还是这种方法有问题? 回答1 完全没有。 该文件已经在他们的计算机上,他们可以很好地保存它,无论是图像还是视频,使用 blob:// URL 提供 HTML 元素不会阻止任何“另存为”操作: fetch( "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png" ) .then( resp => resp.blob() ) .then( blob => { console.log( 'img loaded' ); const elem = document.querySelector( 'img' )

2021-10-27 03:00:15    分类:技术分享    javascript   url   blob

Url routing errors in php in codeigniter

My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controllers/users/action") it starts working. How can i fix this problem?

2021-10-27 02:42:09    分类:问答    apache   codeigniter   routing   url

How to make Firefox treat forward and back slashes the same in url or file-paths?

Is there a way to make Firefox treat / like \ and vice versa in the url or local file path (rewrite it)? Through a tweak, add-on, or anything? this is related to some local pages and links in some files. P.S. That behavior is already in IE and Chrome.

2021-10-27 02:41:40    分类:问答    url   firefox

Http java文件下载问题(Http java file download problem)

问题 尝试使用 apache httpclient 库下载文件,结果文件比原始文件小(大约 32-32kb,正常文件大小为 92-93 时)并且无法在 pdf 查看器中正常打开。 有人能解释一下为什么会发生这种情况吗? (使用firefox下载此文件有时会导致文件下载完整,有时会部分下载) 这是我用来通过 URL 下载文件的代码 URL url = new URL("pathtofile"); final URLConnection connection = url.openConnection(); final InputStream is = connection.getInputStream(); FileOutputStream fos = new FileOutputStream("C://result1.pdf"); byte buffer[] = new byte[1024]; int bytesRead; while ((bytesRead = is.read(buffer)) >= 0) { fos.write(buffer, 0, bytesRead); } fos.flush(); fos.close(); is.close(); PS 尝试使用 HttpClient apache 库下载此文件,结果相同。 更新:使用网络工具监控流量我发现通过 Firefox

2021-10-27 02:40:43    分类:技术分享    java   http   url   download   httpclient

Is there any way to replace "&" with "&" in Magento URL

Is there any way to to replace & with & in magento url. Every time when magento URL is redirecting from one store to another it is adding & between the url. And the url is breaking. for eg: https://www.indelust.com/designer?d=370 Above URL is the default url which is linked to US storeview based on US geoIP. When I am clicking on the url from Google search results it should redirect me to the same page with respective storeview. Now below url is the one when I clicked on google search result. https://indelust.com/in/designer?___store=in_storeview&d=370 And the above link is breaking. When I am

2021-10-27 02:28:36    分类:问答    magento   url   url-rewriting   urlencode   magento-1.9.1

Getting unique hash for two different string URLs that are actually the same

I'm indexing some URLs based on their hash code and use this hash to retrieve them. I have 2 questions in this matter: Do you think this is a good approach? I mean sometimes two different URLs can produce the same hash but I don't seem to have any other choice since URLs can be very long and I need to produce a file name for them. [More important] Sometimes two different URLs are actually reffering to the same page (e.g. http://www.stackoverflow.com and http://stackoverflow.com and sometimes URLs with % characters) but I need to produce the same hash code for these URLs. What do you suggest

2021-10-27 01:50:14    分类:问答    c#   .net   string   url   hash

如果基本 url 包含端口号,则不会加载资产 - codeigniter 4(Assets won't load if base url contains port number - codeigniter 4)

问题 我正在运行php spark serve以在本地运行 codeigniter 4 应用程序。 如果我的$base_url有一个端口号,我所有的资产都不会加载,但如果我删除端口号,它会加载 这不会加载我的资产 public $baseURL = 'http://localhost:8080/folder_name'; 这将加载我的资产 public $baseURL = 'http://localhost/folder_name'; 关于为什么以及如何解决它的任何建议? 回答1 我希望我的回答不会迟到。 由于 codeigniter 4 使用了 Spark 服务器,并且有很多更新。 只需将您的资产文件放入公共文件夹 例如,在视图中加载您的资产 <link rel="stylesheet" href="<?=base_url('vendor/login-register/css/style.css')?>"> 它将在文件夹 public/vendor/login-register/css/style.css 中加载您的资产 如果您有任何问题或其他问题,请告诉我:)

2021-10-27 01:17:17    分类:技术分享    php   url   base-url   codeigniter-4