id
int64 | text
string | metadata
dict | line_start_n_end_idx
dict | quality_signals
dict | eai_taxonomy
dict | pid
string |
---|---|---|---|---|---|---|
4,711,943,723,493,964,000 |
AirVPN Vs AVG VPN Comparison 2022: Tested Them For 3 Years Here Are The End Results
• Time to read: 16 min.
Affiliate Disclaimer
Full Disclosure: This post contains affiliate links to products/services. We may receive a commission for purchases made through these links.
Do you wish to stay anonymous while surfing the web? If yes, then AirVPN could be the ideal service for you.
While anybody can claim to be unique these days, when it comes to VPN suppliers, AirVPN reveals that it really is.
AirVPN sticks out from other VPN services because of its dedication to securing user privacy. From the start, the AirVPN site begins with an appeal for your trust, specifying, “A VPN based on OpenVPN and operated by activists and hacktivists in defence of net neutrality, privacy and against censorship”.While anybody can claim to be special these days, when it concerns VPN service providers, AirVPN shows that it truly is.
AirVPN Home Page
They’ve been around a long time, since 2010, when it was started with the aid of 2 lawyers and a little group of hackers and activists. The satellite communications provider Iridium previously ran it, but AirVPN took over in November 2012. According to the owner’s listing, AirVPN, based in Perugia, is currently owned by Paolo Brini (Italy).
During the last years, it hasn’t been dogged by security scandals like some VPNs have. Nor has it been acquired by a larger business either.
Throughout their About Us and Mission pages, the company’s history is discussed and information the privacy projects that AirVPN has developed or supported. These consist of an online encryption tool, a net neutrality monitor, and other projects such as Tor, the Electronic Frontier Foundation, and WikiLeaks.
AirVPN takes the unconventional route and breaks the mold by providing a VPN designed by enthusiasts for enthusiasts.
So how does AirVPN stack up against its rivals with such strong privacy credentials?
AirVPN’s Key Features
Servers
AirVPN’s network is much smaller than a lot of, with just 246 servers spread out throughout 23 nations.
Most servers are in Europe (besides those in the US, Canada, and Hong Kong). A small issue here is that the absence of diversity of servers reduces the number of international AirVPN users who might access geo-restricted services in their home nation while keeping their personal privacy.
AirVPN Servers
That said, Air is well known for its impressive performance across its server network, with many nations having high-performance physical individual servers.
They use transparent bandwidth allocation techniques to supply an accurate evaluation of performance, without any overbooking or overselling. Plus, they are completely unlimited, with no speed restrictions or time limits.
To establish a connection between your machine and their servers, they utilize OpenVPN and WireGuard (in beta). OpenVPN is the most reputable and safe and secure way to create encrypted tunnels. It provides more security than the military.
Many ports and protocols are offered; they use OpenVPN on the following ports: 80 TCP/UDP, 443 TCP/UDP, and 53 TCP/UDP. Additionally, every Air server directly supports OpenVPN over SSH, OpenVPN over SSL, and OpenVPN over Tor. Forget about PPTP and other hazardous protocols.
No preference is given to any application, protocol, or service when it comes down to it. Net Neutrality is upheld. Notably, you can get rid of web constraints such as avoiding censorship, geographical restrictions, and traffic shaping.
The use is OpenVPN is a big plus as it instantly enhances users’ privacy and security and is highly reliable. The lack of WireGuard as standard may reveal Air isn’t rather keeping up with its competitors. That stated, AirVPN states it is evaluating WireGuard, but it won’t put the more recent protocol fully in place until some of its technical and personal privacy issues are addressed.
AirVPN has also added a lot for power users and tech-savvy people who like to experiment with things.
Switching is unlimited, so if you don’t like one server, you can quickly switch servers as frequently as you like.
You can keep track of the current load on each server, any existing issues, and a history of previous issues on AirVPN’s network status page (which opens in a new tab).
There is a comprehensive specs page for AirVPN’s servers, with info like the available ports, protocols, DNS server information (AirVPN has its own DNS server), and the IP addresses of each VPN server’s access points.
All of it is nice, but considering that there is no third-party audit, you need to rely on that what is being offered will work. Looking at the active community online forum or the comprehensive open-source clients puts your mind at ease.
A nice feature of this is that you can see what other individuals say about the service before registering. You do not have to take their word for it or the word of an audit.
Just How Private Is AirVPN, & Does It Keep Logs?
The company is extremely clear when it comes to AirVPN’s no-logging policy. Online personal privacy and security are the outright concern, with defense from snoopers, data miners, and other entities that invade personal privacy. There is no individual info logged by AirVPN, which has a strong no-logging, tracking, or monitoring policy.
AirVPN doesn’t track what you do when you’re connected to the VPN, date/time stamps, or your IP address. It just collects non-identifiable “technical information” to keep the server running and enhance services, but you can request for this details to be deleted at any time. This makes it among the most privacy-friendly VPN services.
As a result, no one can identify you online; not even your ISP can determine what kind of traffic or protocol you’re using.
There’s no listening in, so you can connect to any wi-fi network without stressing over your computer system and the Wi-Fi hotspot spying on your data.
Even the most ruthless surveillance, censoring, throttling, and traffic shaping tactics will fail against AirVPN since your ISP and government will just see TCP or UDP communication on a single port.
They likewise state they abide by EU personal privacy regulations and that any servers outside the EU will be treated with the exact same or greater levels of privacy and data protection as those in the EU.
You can get a new IP address to hide your IP so that nobody can use it to learn who you are. You’ll remain safe with the top-level security provided.
You can still connect to an AirVPN server through OpenVPN over SSH, SSL, or Tor if your ISP or country blocks OpenVPN.
Open-source clients and a lively community online forum allow you to get a sense of what existing users are saying about the service before signing up.
All of AirVPN’s software is open-source, which is a huge plus. This indicates that anyone can check out AirVPN’s security. ProtonVPN, Private Internet Access, and Mullvad VPN have open-source apps, however just ProtonVPN’s apps have been checked by a third party.
Relating to security, AirVPN’s cryptography is probably the very best available. It resembles that of some other suppliers, however still worth mentioning. The very first exchange utilizes 4096-bit RSA to attain Perfect Forward Secrecy (PFS) via Diffie-Hellman key exchange. Following the first key negotiation, re-keying takes place every 60 minutes, and the user can lower this value. The primary data channel employs AES-256-CBC encryption.
When creating an account, you are not required to input any personal info, not even your real e-mail address. That’s great considering that it lets you prevent leaving any sort of digital footprint. Be conscious that you won’t be able to change your account’s password if you do not utilize one.
Italy, where AirVPN is based, is a member of the 5/9/14 Eyes Alliances (a group of countries that share intelligence data). However even if the government requested user details, AirVPN would have absolutely nothing to give them.
Who Or What Is Eddie??
The Eddie UI is the name of AirVPN’s primary open-source application, readily available on all major platforms and OSes, consisting of Windows, Mac, Linux, and Android. Sadly, despite Eddie’s substantial capability with OpenVPN, it does not yet support WireGuard, so performance isn’t quite as good as those providers who utilize it as requirement.
AirVPN Eddie Overview
Establishing the app is easy, and it has all the information you need to connect to a VPN.
Regrettably, there are no maps or clearly indicated buttons to assist you. While it’s not difficult to get things working, it doesn’t have the most easy to use user interface, so it might be a more tough learning curve for unskilled users.
With Windows, there are a ton of download choices. There are builds for various running systems (from Windows XP to Windows 11), in 32- and 64-bit flavors, and in portable or installable formats. In addition, there’s a changelog to explain what’s new and an archive of past releases in case the most current does not function on your setup.
After introducing it, select ‘Connect to a recommended server,’ and the app will connect to your closest location. You just click Disconnect when you’re ended up. Simple enough for anybody, but Eddie can do so much more given that AirVPN provides more fine-tuned complete control over operations than any other VPN app we have actually seen.
AirVPN Eddie Servers List
Two key AirVPN features through Eddie are its auto-connect and kill switch. AirVPN permits you to connect when your computer system launches, however you can’t select which VPN server it will connect to; it will always connect to the one you selected last.
Although it defines “kill switch” anywhere in the settings, AirVPN has actually a tab called “network lock” that does the very same thing. The distinction is that AirVPN’s “network lock” stops all traffic that isn’t going through its protected tunnel. The majority of basic kill switches just do this when the VPN is on, however you can set up the “network lock” to filter your traffic at all times.
Eddie’s design is easy to understand. Along the top, there are 6 tabs: Overview, Servers, Countries, Speed, Stats, and Logs.
The Overview merely shows the server to which you are connected, the download and upload speeds, the exit IP address, and the connection time. This is where you log into your account.
The Servers page shows all readily available servers in the network, along with in-depth details about every one, such as the server’s nickname, place, latency in milliseconds from your location, and existing users and server load. Remarkable stuff!
This tab also has an amber/green signal that lets you know whether a server is suggested for you.
The Countries page displays the variety of servers offered in each country at a glance, together with an indicator of server load and user numbers. Just like the Servers page, the amber/green sign is also shown. Many servers have up to 1000 Mb/s bandwidth, while some smaller sized ones have a 100 Mb/s connection.
A green checkmark, a red “X,” and a blank box can be found on the right rail of the Countries tab. Highlight a country, click the green checkmark, and the servers for that nation will appear on the Servers tab. This whitelist is essentially a favorites list; you may choose as lots of nations as you like.
If you click the red “x”, that nation will be eliminated, efficiently making it a blocklist/denylist. To get rid of the green checkmark from a country, click the empty box.
By picking a country, you are not right away connected to a VPN server. To do so, go back to the Servers page and select the server you want in a specific country. Then, connect to a server by marking it and clicking the “indication out” icon on the right-hand side (a right-facing arrow pointing into a square bracket). There are likewise a checkmark, “X,” and blank box icons. There’s likewise a “refresh” button to get updated information on ping times and load times.
The Speed tab shows a simple throughput graph with thin plot lines. Its temporal resolution can be changed, so you can see traffic from the last 10 seconds to one day.
While most apps show your current VPN server location and IP address at most. Eddie’s Stats page also reveals fine-grained details, such as the server’s location, load, current user count, protocol, port, encryption algorithm, session start time and length, IPv6 exit address, data uploaded and downloaded, and far more.
Power users, in particular, should value the capability to use a VPN with all the information they could ever desire about the different locations, down to the number of users on a specific server. It’s an invaluable resource.
Logs is a detailed record of connections, routes, and other information.
This allows you to tweak the setup, such as whether it must always connect when opened, which protocol to utilize between UDP and TCP, and which port number. Proxies, Tor support, custom-made DNS servers, and routes can be modified.
The really competent user can go into Advanced and Expert Mode settings, which allow, among other things, sending orders to the OpenVPN Management User Interface via the Logs pane.
If the large function list appears scary, even if you are a VPN specialist, it might be difficult to find out what particular settings do and how to get the preferred outcomes. In addition, it differs from any other service in terms of customization.
Do not dismiss AirVPN’s Eddie just because of its intricacy. Remember that the program normally operates fine by itself, and you’ll never see the settings up until you look for them. Nevertheless, if you sometimes yearn for power or configurability, the app will supply it.
AirVPN Software Configurations
Suppose you do not wish to utilize Eddie. In that case, you can also set up a router or firewall to send out all traffic through a VPN tunnel. This works with routers running the open-source DD-WRT and Tomato firmware and the FreeBSD-based pfSense firewall.
How Good Is AirVPN’s Mobile App?
There isn’t any VPN software for iOS, you can use an exceptionally feature-rich Android VPN app instead. This software application offers the same comprehensive configuration options as its desktop sibling and practical status information.
Different pages for nation and server lists are what the Android app lacks that the desktop versions provides. Instead, you can expand a country and pick a specific city on the very same page. Some useful text additions make the details more easy to understand, however it’s still quite challenging to comprehend in some spots.
Android does not have as many settings as Windows. That’s not a significant critique; there are still much more than many people will ever require. The software application likewise attempts a little more to assist you, with additional text subtitles to describe what each option does.
Speeds/Performance
Utilizing OpenVPN, the Eddie Windows app from AirVPN typically connects quickly and is ready to enter less than 10 seconds.
Online reviewers felt the connection monitoring was good, with the app discovering when the VPN tunnel drops, notifying us with a desktop notification, and reconnecting us in seconds.
In terms of personal privacy, leak tests showed that AirVPN’s Windows client didn’t have any DNS leaks, which shows that the Network Lock/Kill Switch works well.
Now let’s get to those speeds.
It was always going to be slower than the WireGuard-equipped competitors since AirVPN only supports OpenVPN.
Reviewers have reported speeds to be outstanding. Indeed, one stated there wasn’t a single country where they might grumble about the speed. On the contrary, it was truly remarkable overall.
While it wasn’t quite on top tier for VPNs that utilize WireGuard, it was still more than fast enough for many people, and scenarios like HD video, video gaming, and streaming conferencing definitely will not slow you down.
What AirVPN lacks is a broader variety of server places. This may limit the availability of neighboring servers for some users (which will always lead to better speeds). As a result, this VPN is an exceptional option for most people in the United States and Europe, but perhaps less so for other areas.
Streaming
Streaming the huge services such as Netflix, Amazon Prime Video, Disney+, Apple Television, Hulu, HBO, BBC iPlayer, and Discovery+ has actually been a mixed bag for reviewers. Some report that AirVPN is effective enough to bypass the VPN blocks used by Netflix in the USA, whereas others do not.
Some report that Air is quite bad for streaming and does not work with any of the major streaming services. However, it appears to deal with less-popular streaming apps like Peacock and Sony Crackle.
Another reviewer states services like BBC iPlayer and United States Netflix hardly ever work, and when they do, finding the best server needs prolonged experimentation. This is most likely since, unlike other service providers, AirVPN doesn’t provide servers that are optimised for accessing streaming websites.
The good news is, on AirVPN’s site, there is a list of ‘blocked websites’ that users can inspect to see if the situation with these streaming websites ever changes.
However, streaming is certainly not an area in which AirVPN excels, just since that’s not what the service is about, as they are more concentrated on privacy and security.
Does AirVPN Permit P2P?
Air supports P2P file-sharing on all of its servers. Just connect to the VPN server of your option and get going.
Plus, you can utilize port forwarding to enhance your file-sharing performance. Numerous applications, such as BitTorrent and eMule clients, would run poorly without it, and your computer’s shares might be inaccessible from the Web.
File sharing has good speeds on regional servers, permits port forwarding for as much as 20 ports simultaneously (which lets you connect to more peers for faster speeds), and deals with top torrenting clients like qBitTorrent and uTorrent.
AirVPN’s built-in kill switch, activated by default, will obstruct all traffic from leaving your gadget if the VPN connection ever drops. That way, you won’t be sending out unencrypted packets to the Web. If you are file sharing, a kill switch is very hassle-free, especially if you need to leave your connection unattended.
Reviewers have revealed torrenting to be impressive, smooth running with quick download and upload speeds, and with no problems whatsoever.
AirVPN Plans & Pricing
AirVPN offers a wider variety of plans than many VPNs. As standard, each plan lets you connect up to five devices at the same time, so you can connect your PC, phone, tablet, and a couple of other devices all at the same time.
This makes it an excellent choice for individuals who reside in a family home or wish to use a VPN on a public network. While 5 really should be enough for many people, other VPN companies offer 7 or even 10 if you need more.
Rates varies based upon the subscription length, and each plan consists of the same features. Many plans provide good value; however, longer subscriptions offer the best deal.
The standard pricing is in Euros. However, they utilize the European Central Bank to supply real-time currency exchange rate for those overseas, so it can be easily transformed to and spent for in the currency of your option.
The present plans available are:
Three days- EUR2
One month – EUR7
Three months – EUR15 – works out to EUR 5/month
Six months – EUR29 – works out to EUR 4.83/month
One year – EUR49 – works out to EUR 4.08/month
Two years – EUR79 – works out to EUR 3.29/month
Three years – EUR99 – works out to EUR 2.75/month
AirVPN accepts major credit cards, PayPal, Amazon Pay, and a whole load of cryptocurrencies, consisting of Bitcoin, Bitcoin Cash, and Doge. Lots of global options are also accepted, such as Alipay and Giropay.
AirVPN offers a three-day totally free trial, which can be obtained by sending out a message to the support team and using the discount coupon code they send you.
There’s likewise a 30-day money-back guarantee, as long as they haven’t broken the terms of service or used more than 5 GB of data throughout that time.
AirVPN Customer Support
AirVPN has a different customer support offering than numerous other VPNs. While it doesn’t have live chat, it uses e-mail support and frequently asked questions (FAQs) and has a very active assistance online forum with contributors from both the service itself and the community.
Notably, AirVPN’s email support isn’t outsourced however can be a little irregular with the time it requires to get a response. That stated, the e-mail assistance is high quality, and the agents are useful and friendly, however the extensive responses can be pretty technical, which may put off those new to VPNs.
AirVPN’s site has a great deal of info, consisting of a big Frequently asked questions section that is separated by topic.
AirVPN’s community forums cover various subjects, however novices will have the very same troubles comprehending a lot of the tech lingo in the posts.
AirVPN Pros & Cons
Pros:
No logging Whatsoever.
Excellent speeds with minimal loss.
Unlimited P2P enabled with Port Forwarding.
Strong security on apps and servers alike, with advanced protocols and encryption.
Network Lock/Kill Switch.
Split tunneling.
Supports Windows, Mac, Linux, mobile, and routers.
Supports Tor over VPN.
Easy app setup and usage.
Many, many advanced settings and customization choices in the client app.
Strong Customer Support.
Active Community Online Forums and Comprehensive Guides.
Great prices, particularly for longer-term plans.
Optional block lists shield you from ads, adware, trackers, and hazardous sources.
Cons:
Only fully supports OpenVPN.
Client app isn’t very user-friendly or pretty like other services.
Client app might overwhelm newer users.
It is really hit and miss with streaming services.
No native iOS or ChromeOS apps.
Perhaps there are too many advanced alternatives.
Found in 14-Eyes Nation.
Server numbers are relatively low.
Rounding Things Up – Is AirVPN The Very Best Option?
So the bottom line is that AirVPN is a strong, trustworthy, and safe VPN service with great pricing. It’s clearly tailored towards more power and advanced users, so those brand-new to VPNs will be much better served by a less, shall we say, specialized VPN supplier. Even new users might do much, much worse.
While it could be challenging to use if you’re brand-new to VPNs, you’ll get much quicker speeds and much better results than many of its competing VPN competitors.
When it boils down to it, this VPN service is more focused on protecting your privacy than unblocking streaming services like Netflix or Hulu.
Although it might not guarantee the very same level of personal privacy and privacy as a service like Mullvad, which assigns you a random account number and enables you to pay in cash, AirVPN is still a great alternative for customers who value their personal privacy.
While it doesn’t hit the speed heights of a WireGuard service, performance-wise, it’s absolutely the best purely OpenVPN service out there. In addition to being an excellent choice for online filesharing.
Highly recommended!
Click Here Or Below To Join AirVPN Today!!
AirVPN Vs Hotspot Shield: Outstanding VPNs Matched Up
|
{
"url": "https://chitorch.org/vpn-reviews/airvpn-vs-avg-vpn-comparison-2022-tested-them-for-3-years-here-are-the-end-results/",
"source_domain": "chitorch.org",
"snapshot_id": "CC-MAIN-2024-18",
"warc_metadata": {
"Content-Length": "114861",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:J2KCERMRO4ZHMRAHZ3GPCE6X4KPXLQ5R",
"WARC-Concurrent-To": "<urn:uuid:3e39a7fe-6d5f-44cd-bcd1-f8e20018af89>",
"WARC-Date": "2024-04-22T07:06:44Z",
"WARC-IP-Address": "104.21.73.103",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:J2G5AW5P2SCQ6QI5SODXUMR726AYEFNC",
"WARC-Record-ID": "<urn:uuid:92214fcf-dd65-4586-9bb9-84b1adb9825b>",
"WARC-Target-URI": "https://chitorch.org/vpn-reviews/airvpn-vs-avg-vpn-comparison-2022-tested-them-for-3-years-here-are-the-end-results/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:62822e8c-0164-4b18-921e-0fa1eba52330>"
},
"warc_info": "isPartOf: CC-MAIN-2024-18\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for April 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-234\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
84,
85,
111,
132,
133,
275,
276,
385,
386,
501,
502,
927,
928,
945,
946,
1289,
1290,
1431,
1432,
1742,
1743,
1861,
1862,
1947,
1948,
1970,
1971,
1979,
1980,
2084,
2085,
2374,
2375,
2390,
2391,
2549,
2550,
2772,
2773,
3013,
3014,
3290,
3291,
3528,
3529,
3917,
3918,
4020,
4021,
4136,
4137,
4306,
4307,
4525,
4526,
4765,
4766,
4941,
4942,
4991,
4992,
5330,
5331,
5667,
5668,
5792,
5793,
5945,
5946,
6146,
6147,
6354,
6355,
6505,
6506,
6625,
6626,
6778,
6779,
7043,
7044,
7488,
7489,
7785,
7786,
8016,
8017,
8040,
8041,
8390,
8391,
8413,
8414,
8505,
8506,
8746,
8747,
9088,
9089,
9431,
9432,
9458,
9459,
9716,
9717,
10117,
10118,
10243,
10244,
10428,
10429,
10679,
10680,
10778,
10779,
11094,
11095,
11401,
11402,
11575,
11576,
12048,
12049,
12217,
12218,
12539,
12540,
12767,
12768,
12841,
12842,
13075,
13076,
13257,
13258,
13509,
13510,
13784,
13785,
13816,
13817,
14075,
14076,
14109,
14110,
14350,
14351,
14679,
14680,
14966,
14967,
14986,
14987,
15111,
15112,
15296,
15297,
15459,
15460,
15491,
15492,
15601,
15602,
15793,
15794,
16018,
16019,
16322,
16323,
16333,
16334,
16630,
16631,
16831,
16832,
17144,
17145,
17310,
17311,
17483,
17484,
17508,
17509,
17623,
17624,
17857,
17858,
18098,
18099,
18424,
18425,
18565,
18566,
18589,
18590,
18817,
18818,
19044,
19045,
19221,
19222,
19448,
19449,
19482,
19483,
19500,
19501,
19518,
19519,
19567,
19568,
19617,
19618,
19665,
19666,
19714,
19715,
19765,
19766,
19976,
19977,
20140,
20141,
20294,
20295,
20319,
20320,
20601,
20602,
20916,
20917,
21040,
21041,
21192,
21193,
21212,
21213,
21219,
21220,
21243,
21244,
21280,
21281,
21325,
21326,
21409,
21410,
21436,
21437,
21454,
21455,
21506,
21507,
21530,
21531,
21557,
21558,
21632,
21633,
21658,
21659,
21716,
21717,
21767,
21768,
21851,
21852,
21858,
21859,
21888,
21889,
21956,
21957,
21997,
21998,
22049,
22050,
22082,
22083,
22133,
22134,
22159,
22160,
22195,
22196,
22249,
22250,
22559,
22560,
22725,
22726,
22869,
22870,
23139,
23140,
23345,
23346,
23366,
23367,
23410,
23411
],
"line_end_idx": [
84,
85,
111,
132,
133,
275,
276,
385,
386,
501,
502,
927,
928,
945,
946,
1289,
1290,
1431,
1432,
1742,
1743,
1861,
1862,
1947,
1948,
1970,
1971,
1979,
1980,
2084,
2085,
2374,
2375,
2390,
2391,
2549,
2550,
2772,
2773,
3013,
3014,
3290,
3291,
3528,
3529,
3917,
3918,
4020,
4021,
4136,
4137,
4306,
4307,
4525,
4526,
4765,
4766,
4941,
4942,
4991,
4992,
5330,
5331,
5667,
5668,
5792,
5793,
5945,
5946,
6146,
6147,
6354,
6355,
6505,
6506,
6625,
6626,
6778,
6779,
7043,
7044,
7488,
7489,
7785,
7786,
8016,
8017,
8040,
8041,
8390,
8391,
8413,
8414,
8505,
8506,
8746,
8747,
9088,
9089,
9431,
9432,
9458,
9459,
9716,
9717,
10117,
10118,
10243,
10244,
10428,
10429,
10679,
10680,
10778,
10779,
11094,
11095,
11401,
11402,
11575,
11576,
12048,
12049,
12217,
12218,
12539,
12540,
12767,
12768,
12841,
12842,
13075,
13076,
13257,
13258,
13509,
13510,
13784,
13785,
13816,
13817,
14075,
14076,
14109,
14110,
14350,
14351,
14679,
14680,
14966,
14967,
14986,
14987,
15111,
15112,
15296,
15297,
15459,
15460,
15491,
15492,
15601,
15602,
15793,
15794,
16018,
16019,
16322,
16323,
16333,
16334,
16630,
16631,
16831,
16832,
17144,
17145,
17310,
17311,
17483,
17484,
17508,
17509,
17623,
17624,
17857,
17858,
18098,
18099,
18424,
18425,
18565,
18566,
18589,
18590,
18817,
18818,
19044,
19045,
19221,
19222,
19448,
19449,
19482,
19483,
19500,
19501,
19518,
19519,
19567,
19568,
19617,
19618,
19665,
19666,
19714,
19715,
19765,
19766,
19976,
19977,
20140,
20141,
20294,
20295,
20319,
20320,
20601,
20602,
20916,
20917,
21040,
21041,
21192,
21193,
21212,
21213,
21219,
21220,
21243,
21244,
21280,
21281,
21325,
21326,
21409,
21410,
21436,
21437,
21454,
21455,
21506,
21507,
21530,
21531,
21557,
21558,
21632,
21633,
21658,
21659,
21716,
21717,
21767,
21768,
21851,
21852,
21858,
21859,
21888,
21889,
21956,
21957,
21997,
21998,
22049,
22050,
22082,
22083,
22133,
22134,
22159,
22160,
22195,
22196,
22249,
22250,
22559,
22560,
22725,
22726,
22869,
22870,
23139,
23140,
23345,
23346,
23366,
23367,
23410,
23411,
23464
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 23464,
"ccnet_original_nlines": 301,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.40025630593299866,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.021785559132695198,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.15783852338790894,
"rps_doc_frac_unique_words": 0.3162681758403778,
"rps_doc_mean_word_length": 4.90072774887085,
"rps_doc_num_sentences": 222,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 6.1335673332214355,
"rps_doc_word_count": 3848,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.0057270098477602005,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.004772509913891554,
"rps_doc_frac_chars_top_3gram": 0.0023862600792199373,
"rps_doc_frac_chars_top_4gram": 0.002916530007496476,
"rps_doc_books_importance": -2017.5418701171875,
"rps_doc_books_importance_length_correction": -2017.5418701171875,
"rps_doc_openwebtext_importance": -973.9871215820312,
"rps_doc_openwebtext_importance_length_correction": -973.9871215820312,
"rps_doc_wikipedia_importance": -598.5619506835938,
"rps_doc_wikipedia_importance_length_correction": -598.5619506835938
},
"fasttext": {
"dclm": 0.0277482308447361,
"english": 0.9359846711158752,
"fineweb_edu_approx": 1.3920334577560425,
"eai_general_math": 0.08309078216552734,
"eai_open_web_math": 0.13260352611541748,
"eai_web_code": 0.06797564029693604
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.822",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "352.32",
"labels": {
"level_1": "Social sciences",
"level_2": "Public administration and Military art and science",
"level_3": "Local government"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "5",
"label": "Evaluate"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "14",
"label": "Reviews/Critiques"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "17",
"label": "Product Page"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
8,824,616,658,797,290,000 |
Skip to content
Instantly share code, notes, and snippets.
Embed
What would you like to do?
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import nltk
from nltk.stem import WordNetLemmatizer
set(stopwords.words('english'))
text = """He determined to drop his litigation with the monastry, and relinguish his claims to the wood-cuting and
fishery rihgts at once. He was the more ready to do this becuase the rights had become much less valuable, and he had
indeed the vaguest idea where the wood and river in question were."""
stop_words = set(stopwords.words('english'))
word_tokens = word_tokenize(text)
filtered_sentence = []
for w in word_tokens:
if w not in stop_words:
filtered_sentence.append(w)
print(filtered_sentence)
lemma_word = []
import nltk
from nltk.stem import WordNetLemmatizer
wordnet_lemmatizer = WordNetLemmatizer()
for w in filtered_sentence:
word1 = wordnet_lemmatizer.lemmatize(w, pos = "n")
word2 = wordnet_lemmatizer.lemmatize(word1, pos = "v")
word3 = wordnet_lemmatizer.lemmatize(word2, pos = ("a"))
lemma_word.append(word3)
print(lemma_word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
|
{
"url": "https://gist.github.com/shubham-singh-ss/5c972387542b468a94e71f94aee80f41",
"source_domain": "gist.github.com",
"snapshot_id": "crawl=CC-MAIN-2022-27",
"warc_metadata": {
"Content-Length": "80106",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:ZTN6TQM3Q76MVHXKXDQ7H2J4L7PTEF4O",
"WARC-Concurrent-To": "<urn:uuid:3397d676-29b5-4cff-86b1-af04707142f6>",
"WARC-Date": "2022-07-03T03:35:51Z",
"WARC-IP-Address": "140.82.114.3",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:K5P74YT6QO6DLBJIUBHBDDTFQXRDSKFU",
"WARC-Record-ID": "<urn:uuid:cdd24abc-ff75-4d46-a8f5-828bece107c6>",
"WARC-Target-URI": "https://gist.github.com/shubham-singh-ss/5c972387542b468a94e71f94aee80f41",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:7c5c5de6-2d07-49c0-9c5c-bc401e55cae4>"
},
"warc_info": "isPartOf: CC-MAIN-2022-27\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for June/July 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-171\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
16,
17,
60,
61,
67,
94,
128,
168,
180,
220,
252,
367,
485,
555,
600,
634,
657,
679,
703,
731,
756,
772,
784,
824,
865,
893,
944,
999,
1056,
1081,
1099
],
"line_end_idx": [
16,
17,
60,
61,
67,
94,
128,
168,
180,
220,
252,
367,
485,
555,
600,
634,
657,
679,
703,
731,
756,
772,
784,
824,
865,
893,
944,
999,
1056,
1081,
1099,
1196
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1196,
"ccnet_original_nlines": 31,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.28151261806488037,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2899159789085388,
"rps_doc_frac_unique_words": 0.6551724076271057,
"rps_doc_mean_word_length": 6.420689582824707,
"rps_doc_num_sentences": 18,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.337772846221924,
"rps_doc_word_count": 145,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.0966702476143837,
"rps_doc_frac_chars_dupe_6grams": 0.0966702476143837,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.008592910133302212,
"rps_doc_frac_chars_top_3gram": 0.0300751905888319,
"rps_doc_frac_chars_top_4gram": 0.047261010855436325,
"rps_doc_books_importance": -97.3087387084961,
"rps_doc_books_importance_length_correction": -97.3087387084961,
"rps_doc_openwebtext_importance": -43.631893157958984,
"rps_doc_openwebtext_importance_length_correction": -43.623291015625,
"rps_doc_wikipedia_importance": -32.50201416015625,
"rps_doc_wikipedia_importance_length_correction": -32.50201416015625
},
"fasttext": {
"dclm": 0.940925121307373,
"english": 0.856545627117157,
"fineweb_edu_approx": 2.7310335636138916,
"eai_general_math": 0.16305679082870483,
"eai_open_web_math": 0.04888058081269264,
"eai_web_code": 0.0002141599979950115
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "410",
"labels": {
"level_1": "Philology; or, Language and languages",
"level_2": "Linguistics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "1",
"label": "Leftover HTML"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,019,492,798,405,173,000 |
Jump to content
• Log In with Google Sign In
• Create Account
- - - - -
Status: BTIC1C + BC6H and BC7, Expanded RGB depth.
Posted by , 24 December 2013 · 754 views
well, first off, recently did a test showing the image quality for BTIC1C:
this test was for a video at 1024x1024 with 8.6 Mbps and 0.55 bpp.
as noted, the quality degradation is noticeable, but "mostly passable".
some amount of it is due largely to the conversion to RGB555, rather than actual quantization artifacts (partly because video compression and dithering don't really mix well in my tests). however, some quantization artifacts are visible.
as usual, working spec:
http://cr88192.dyndns.org:8080/wiki/index.php/BTIC1C
other recent changes:
I have split apart BTIC1C and RPZA into different codecs, mostly as 1C has diverged sufficiently from RPZA that keeping them as a single codec was becoming problematic.
BTIC1C now has BC6H and BC7 decode routes, with single-thread decode speeds of around 320-340 Mpix/sec for BC7, and around 400 Mpix/sec for BC6H (the speed difference is mostly due to the lack of an alpha channel in 6H, and slightly awkward handling of alpha in BC7).
as-is, both effectively use a subset of the format (currently Mode 5 for BC7, and Mode 11 for 6H).
the (theoretical) color depth has been expanded, as it now supports 23-bit RGB and 31-bit RGB.
RGB23 will give (approximately) a full 24-bit color depth (mostly for BC7, possibly could be used for RGBA).
RGB31 will support HDR (for BC6H), and comes in signed and unsigned variants. as-is, it stores 10-bits per component (as floating-point).
likewise, the 256-color indexed block-modes have been expanded to support 23 and 31 bit RGB colors.
these modes are coerced to RGB565 for DXTn decoding, as well as RGB555 still being usable with BC7 and BC6H, ...
this means that video intended for one format can still be decoded for another if-needed (though videos will still have a "preferred format").
as-is, it will still require some work on the encoder end to be able to generate output supporting these color depths (likely moving from 128 to 256 blocks on the encoder end).
the current encoder basically uses a hacked form of DXT5 for its intermediate form, where:
(AlphaA>AlphaB) && (ColorA>ColorB)
basically the same as DXT5.
(AlphaA<=AlphaB) || (ColorA<=ColorB)
special cases (flat colors, skip blocks, ...)
however, there are no free bits for more color data (at least while keeping block-complexity "reasonable").
so, likely, it will be necessary to expand the block size to 256 bits and probably use a 128-bit color block.
ex:
64-bits: tag and metadata
64-bits: alpha block
128-bits: expanded color block.
this would not effect the output format, as these blocks are purely intermediate (used for frame conversion/quantization/encoding), but would require a bit of alteration to the encoder-side logic.
it sort of works I guess...
ADD:
video-texture, now with audio...
had an idea here for how to do a DXTn-space deblocking filter, but it would likely come with a bit of a speed cost.
may try it out and see if it works ok though.
ADD, Comment:
just noticed that apparently posts can only contain a single video or something... (trying to add another will remove the one that was already there...).
here is the second video:
ADD 2:
I am running into a minor side-issue:
all the features that keep being added have generally turned the decoder into an evil/awful mess, and even then there are holes, like differential-colors + higher color-depths (or when using BC6H or BC7 as the output format) aren't actually implemented.
the giant switch for the DXTn decode path has now expanded to nearly 1500 lines.
ironically, the BC6 and BC7 paths are actually smaller, mostly because some more of the logic was factored out into functions.
another idle thought is if the extended 23-bit RGB mode were used for in-game video capture.
this mode would use 5 bpp block (vs 4 bpp blocks for the current capture), but could look a little better. ( the encoder used for capture is fairly naive, prioritizing fast encoding over good compression. )
PARTNERS
|
{
"url": "http://www.gamedev.net/blog/1645/entry-2259090-status-btic1c-bc6h-and-bc7-expanded-rgb-depth/",
"source_domain": "www.gamedev.net",
"snapshot_id": "crawl=CC-MAIN-2016-36",
"warc_metadata": {
"Content-Length": "100416",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:BUPIG4QTO36W74BAHUR4TODQOP4KJK2E",
"WARC-Concurrent-To": "<urn:uuid:922a6531-64ee-4a2f-9854-86158133a319>",
"WARC-Date": "2016-08-29T02:09:46Z",
"WARC-IP-Address": "64.91.255.13",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:MUBSJ2DZEGUDQFAHJHY5PJOI2YAB23FH",
"WARC-Record-ID": "<urn:uuid:5e637dc8-bd29-4575-9e88-7911160f1473>",
"WARC-Target-URI": "http://www.gamedev.net/blog/1645/entry-2259090-status-btic1c-bc6h-and-bc7-expanded-rgb-depth/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:a9fda528-89dd-434d-90fb-6ab17b84ae90>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-153-172-175.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2016-36\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for August 2016\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
16,
17,
56,
75,
76,
77,
78,
79,
80,
90,
91,
142,
143,
184,
185,
260,
261,
262,
329,
330,
402,
640,
641,
642,
666,
719,
720,
721,
743,
744,
913,
914,
1182,
1183,
1282,
1283,
1284,
1379,
1488,
1489,
1627,
1628,
1728,
1729,
1842,
1985,
1986,
1987,
2164,
2165,
2256,
2291,
2319,
2356,
2402,
2403,
2511,
2621,
2622,
2626,
2652,
2673,
2705,
2706,
2903,
2904,
2905,
2933,
2934,
2935,
2940,
2941,
2942,
2975,
2976,
3092,
3138,
3139,
3140,
3141,
3142,
3143,
3144,
3158,
3159,
3313,
3314,
3316,
3317,
3343,
3344,
3346,
3347,
3349,
3350,
3357,
3358,
3396,
3397,
3651,
3652,
3654,
3655,
3736,
3737,
3864,
3865,
3867,
3868,
3870,
3871,
3964,
3965,
4172,
4173
],
"line_end_idx": [
16,
17,
56,
75,
76,
77,
78,
79,
80,
90,
91,
142,
143,
184,
185,
260,
261,
262,
329,
330,
402,
640,
641,
642,
666,
719,
720,
721,
743,
744,
913,
914,
1182,
1183,
1282,
1283,
1284,
1379,
1488,
1489,
1627,
1628,
1728,
1729,
1842,
1985,
1986,
1987,
2164,
2165,
2256,
2291,
2319,
2356,
2402,
2403,
2511,
2621,
2622,
2626,
2652,
2673,
2705,
2706,
2903,
2904,
2905,
2933,
2934,
2935,
2940,
2941,
2942,
2975,
2976,
3092,
3138,
3139,
3140,
3141,
3142,
3143,
3144,
3158,
3159,
3313,
3314,
3316,
3317,
3343,
3344,
3346,
3347,
3349,
3350,
3357,
3358,
3396,
3397,
3651,
3652,
3654,
3655,
3736,
3737,
3864,
3865,
3867,
3868,
3870,
3871,
3964,
3965,
4172,
4173,
4181
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4181,
"ccnet_original_nlines": 115,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3803131878376007,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05257270857691765,
"rps_doc_frac_lines_end_with_ellipsis": 0.0258620698004961,
"rps_doc_frac_no_alph_words": 0.23601789772510529,
"rps_doc_frac_unique_words": 0.5171386003494263,
"rps_doc_mean_word_length": 4.773472309112549,
"rps_doc_num_sentences": 40,
"rps_doc_symbol_to_word_ratio": 0.006711409892886877,
"rps_doc_unigram_entropy": 5.428258419036865,
"rps_doc_word_count": 671,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.008741799741983414,
"rps_doc_frac_chars_top_3gram": 0.00624414999037981,
"rps_doc_frac_chars_top_4gram": 0.009366219863295555,
"rps_doc_books_importance": -442.3564453125,
"rps_doc_books_importance_length_correction": -442.3564453125,
"rps_doc_openwebtext_importance": -261.3943176269531,
"rps_doc_openwebtext_importance_length_correction": -261.3943176269531,
"rps_doc_wikipedia_importance": -259.732177734375,
"rps_doc_wikipedia_importance_length_correction": -259.732177734375
},
"fasttext": {
"dclm": 0.25509196519851685,
"english": 0.9454158544540405,
"fineweb_edu_approx": 1.9605759382247925,
"eai_general_math": 0.6149716973304749,
"eai_open_web_math": 0.47794950008392334,
"eai_web_code": 0.24293678998947144
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.0151",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "006.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Cognitive science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "9",
"label": "Personal/Misc"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-1,073,925,561,157,668,600 |
Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
PerlMonks
Re: How to empty an array ???
by Albannach (Prior)
on Nov 25, 2005 at 22:31 UTC ( #511764=note: print w/ replies, xml ) Need Help??
in reply to How to empty an array ???
Taking another approach, depending on the requirements of your algorithm you might just confine your @flowers in blocks using my like so:
use strict; my @flowers; { my @flowers = qw(rose daisy buttercup); # arrange your flowers here } print @flowers; # prints nothing as these flowers were never assigned
Mind you, from a readability point of view, re-use of variable names is not generally a good idea in my opinion, as it can be quite confusing to others unless your array is always used for the same purpose (e.g. as working space for some subroutine).
--
I'd like to be able to assign to an luser
Comment on Re: How to empty an array ???
Select or Download Code
Log In?
Username:
Password:
What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://511764]
help
Chatterbox?
and the web crawler heard nothing...
How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-10-25 08:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
For retirement, I am banking on:
Results (142 votes), past polls
|
{
"url": "http://www.perlmonks.org/?node_id=511764",
"source_domain": "www.perlmonks.org",
"snapshot_id": "crawl=CC-MAIN-2014-42",
"warc_metadata": {
"Content-Length": "18361",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:YQMUV4BPHIC6QAEIFIJC4HVGDGRAQW2K",
"WARC-Concurrent-To": "<urn:uuid:855b8734-c167-4992-83f6-717005dc250b>",
"WARC-Date": "2014-10-25T08:53:27Z",
"WARC-IP-Address": "209.197.123.153",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:F3QMVDD6QOZS7VWWFZBOSMM6CYFMR2XT",
"WARC-Record-ID": "<urn:uuid:5a5271ae-dd42-4553-b633-b6410f3d2bb4>",
"WARC-Target-URI": "http://www.perlmonks.org/?node_id=511764",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:9a6e71a1-3f3a-44bc-9ea1-80ae12c34a0a>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-16-133-185.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2014-42\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for October 2014\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
63,
90,
120,
122,
134,
135,
165,
166,
187,
268,
269,
270,
308,
309,
447,
448,
615,
866,
867,
870,
912,
913,
914,
955,
979,
980,
988,
998,
1008,
1009,
1029,
1047,
1060,
1073,
1103,
1108,
1120,
1157,
1158,
1196,
1209,
1269,
1296,
1306,
1319,
1331,
1342,
1360,
1361,
1398,
1399,
1400,
1401,
1402,
1403,
1404,
1405,
1406,
1407,
1408
],
"line_end_idx": [
63,
90,
120,
122,
134,
135,
165,
166,
187,
268,
269,
270,
308,
309,
447,
448,
615,
866,
867,
870,
912,
913,
914,
955,
979,
980,
988,
998,
1008,
1009,
1029,
1047,
1060,
1073,
1103,
1108,
1120,
1157,
1158,
1196,
1209,
1269,
1296,
1306,
1319,
1331,
1342,
1360,
1361,
1398,
1399,
1400,
1401,
1402,
1403,
1404,
1405,
1406,
1407,
1408,
1443
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1443,
"ccnet_original_nlines": 60,
"rps_doc_curly_bracket": 0.0013859999598935246,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3207547068595886,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.022012580186128616,
"rps_doc_frac_lines_end_with_ellipsis": 0.01639343984425068,
"rps_doc_frac_no_alph_words": 0.2704402506351471,
"rps_doc_frac_unique_words": 0.692307710647583,
"rps_doc_mean_word_length": 4.57692289352417,
"rps_doc_num_sentences": 20,
"rps_doc_symbol_to_word_ratio": 0.01257861964404583,
"rps_doc_unigram_entropy": 4.890798568725586,
"rps_doc_word_count": 234,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.05135387182235718,
"rps_doc_frac_chars_dupe_6grams": 0.035480860620737076,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.014005599543452263,
"rps_doc_frac_chars_top_3gram": 0.028011199086904526,
"rps_doc_frac_chars_top_4gram": 0.033613450825214386,
"rps_doc_books_importance": -138.05389404296875,
"rps_doc_books_importance_length_correction": -134.7044677734375,
"rps_doc_openwebtext_importance": -74.20382690429688,
"rps_doc_openwebtext_importance_length_correction": -74.20382690429688,
"rps_doc_wikipedia_importance": -40.52045822143555,
"rps_doc_wikipedia_importance_length_correction": -32.641990661621094
},
"fasttext": {
"dclm": 0.01826643943786621,
"english": 0.898486316204071,
"fineweb_edu_approx": 1.9308255910873413,
"eai_general_math": 0.001212890027090907,
"eai_open_web_math": 0.21891295909881592,
"eai_web_code": -1.199999957179898e-7
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1332",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,326,398,376,670,920,700 |
Create a Super Simple Light/Dark Mode Switch
It seems like more and more websites are developing dark modes and many people prefer dark modes as it can cause less eye strain, especially in low light. This should be considered when developing any website today.
Luckily a dark mode switch is very easy to implement with a few lines of JavaScript and some CSS custom properties.
First of all, we need to think about the technical implementation. It's possible to use the prefers-color-scheme media query in CSS and not use any JavaScript, however I believe that dark mode should always be a choice of the user as many websites implement dark mode horribly.
Setting up dark mode
So the first step is to write a JavaScript snippet to place into the top of the <head></head> of the document. This should be inlined into the top of the head so that it is executed as early as possible on page load.
<script type="text/javascript">
document.documentElement.classList.toggle(
'dark',
localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
);
</script>
The above toggle class conditional adds a dark class to the HTML tag if localStorage.theme is set to dark or prefers-color-scheme is dark.
Toggling dark mode
Next, we need to implement the toggle functionality. This needs to do a few things; update the local storage (so that when the user reloads the page the preference is restored) and also toggle the dark class on the <html> tag.
The functionality can be implemented in many ways, but here's a simple example. If you are using a JavaScript library then the code will be completely different, this is just a vanilla JavaScript implementation.
document.addEventListener('DOMContentLoaded', () =>
document.querySelectorAll('[toggle-dark-mode]').forEach((item) =>
item.addEventListener('click', () => {
localStorage.setItem('theme', localStorage.theme == 'dark' ? 'light' : 'dark');
document.documentElement.classList.toggle('dark');
})
)
);
The above code simply adds a click event listener to all elements with the toggle-dark-mode HTML attribute. Clicking the element should then update local storage and toggle the dark mode class.
Example button:
<button toggle-dark-mode>Toggle dark mode</button>
Styling for dark mode
If you are using Tailwind, dark mode should now be functional. You can simply add the dark: prefix to any class names for modifications in dark mode.
CSS custom properties are widely supported cross browser and simplify the effort required for colour mode theming.
Here's some example CSS to get started:
:root {
--color-bg: #fff;
}
html.dark {
--color-bg: #000;
}
body {
background-color: var(--color-bg);
}
It's assumed that the default colour theme will be light mode, so it's safe to place all default colour properties inside :root {}.
Dark colour theme changes can be placed inside of the html.dark {} selector, which will override the root properties.
Et voila! You now have a basic dark mode implementation.
Whats next?
But wait, theres more!
Many media queries are planned for release with the Media Queries Level 5 spec. So keep a watch out for other colour modes, especially prefers-contrast which will allow us to easily implement more accessible colour modes.
19
|
{
"url": "https://02dev.com/post/learn/61d8ed729c67d2983d96d827",
"source_domain": "02dev.com",
"snapshot_id": "CC-MAIN-2024-33",
"warc_metadata": {
"Content-Length": "147347",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:QDR7AJYBPTT3CVLGRKW2ZEYDMHPNO7WU",
"WARC-Concurrent-To": "<urn:uuid:5496f2de-69b6-4909-be60-57339c4a9c5d>",
"WARC-Date": "2024-08-10T06:59:28Z",
"WARC-IP-Address": "104.21.19.10",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:VXNDDWUAGY7CHYQ5VL3XHINRK52BJEPK",
"WARC-Record-ID": "<urn:uuid:6e537cf5-e6de-41ff-b86b-a9992a2bcb2d>",
"WARC-Target-URI": "https://02dev.com/post/learn/61d8ed729c67d2983d96d827",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:343979cb-40c6-46de-9240-f32ba6a63598>"
},
"warc_info": "isPartOf: CC-MAIN-2024-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-107\r\nsoftware: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
45,
46,
262,
263,
379,
380,
658,
659,
680,
681,
898,
899,
931,
976,
988,
1115,
1120,
1130,
1131,
1270,
1271,
1290,
1291,
1518,
1519,
1731,
1732,
1784,
1852,
1895,
1981,
2038,
2045,
2049,
2052,
2053,
2247,
2248,
2264,
2265,
2316,
2317,
2339,
2340,
2490,
2491,
2606,
2607,
2647,
2648,
2656,
2676,
2678,
2679,
2691,
2711,
2713,
2714,
2721,
2758,
2760,
2761,
2893,
2894,
3012,
3013,
3070,
3071,
3083,
3084,
3107,
3108,
3330,
3331
],
"line_end_idx": [
45,
46,
262,
263,
379,
380,
658,
659,
680,
681,
898,
899,
931,
976,
988,
1115,
1120,
1130,
1131,
1270,
1271,
1290,
1291,
1518,
1519,
1731,
1732,
1784,
1852,
1895,
1981,
2038,
2045,
2049,
2052,
2053,
2247,
2248,
2264,
2265,
2316,
2317,
2339,
2340,
2490,
2491,
2606,
2607,
2647,
2648,
2656,
2676,
2678,
2679,
2691,
2711,
2713,
2714,
2721,
2758,
2760,
2761,
2893,
2894,
3012,
3013,
3070,
3071,
3083,
3084,
3107,
3108,
3330,
3331,
3333
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3333,
"ccnet_original_nlines": 74,
"rps_doc_curly_bracket": 0.00360035989433527,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3096960783004761,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01013024989515543,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.23878437280654907,
"rps_doc_frac_unique_words": 0.4589473605155945,
"rps_doc_mean_word_length": 5.3684210777282715,
"rps_doc_num_sentences": 46,
"rps_doc_symbol_to_word_ratio": 0.0028943601064383984,
"rps_doc_unigram_entropy": 4.938905715942383,
"rps_doc_word_count": 475,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.0117647098377347,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0313725508749485,
"rps_doc_frac_chars_top_3gram": 0.009411759674549103,
"rps_doc_frac_chars_top_4gram": 0.009411759674549103,
"rps_doc_books_importance": -304.343505859375,
"rps_doc_books_importance_length_correction": -304.343505859375,
"rps_doc_openwebtext_importance": -173.51028442382812,
"rps_doc_openwebtext_importance_length_correction": -173.51028442382812,
"rps_doc_wikipedia_importance": -116.6489486694336,
"rps_doc_wikipedia_importance_length_correction": -116.6489486694336
},
"fasttext": {
"dclm": 0.17970067262649536,
"english": 0.7908008694648743,
"fineweb_edu_approx": 2.096876859664917,
"eai_general_math": 0.4787404537200928,
"eai_open_web_math": 0.09599608182907104,
"eai_web_code": 0.8027794361114502
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,434,357,142,458,232,000 |
Advertisement Remove all ads
If the 3rd and the 9th Terms of an Arithmetic Progression Are 4 and -8 Respectively, Which Term of It is Zero? - Mathematics
Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads
Sum
If the 3rd and the 9th terms of an arithmetic progression are 4 and -8 respectively, Which term of it is zero?
Advertisement Remove all ads
Solution
For an A.P
`t_3 = 4`
=> a +2d = 4 .....(i)
`t_9 = -8`
=> a + 8d = -8 ....(ii)
Substractinjg (i) from (ii) we get
6d = -12
=> d = -2
Substituting d = -2 in (i) we get
a + 2(-2) = 4
=> a - 4 = 4
=> a = 8
=> general term = `t_n = 8 + (n - 1)(-2)`
Let pth term of this A.P be 0
`=> 8 + (p - 1) xx (-2) = 0`
`=> 8 - 2p + 2 = 0`
=> 10 - 2p = 0
=> 2p = 10
=> p = 5
Thus 5th term of this A.P is 0.
Concept: Arithmetic Progression - Finding Their General Term
Is there an error in this question or solution?
APPEARS IN
Selina Concise Maths Class 10 ICSE
Chapter 10 Arithmetic Progression
Exercise 10 (B) | Q 5 | Page 140
Advertisement Remove all ads
Share
Notifications
View all notifications
Forgot password?
View in app×
|
{
"url": "https://www.shaalaa.com/question-bank-solutions/if-3rd-9th-terms-arithmetic-progression-are-4-8-respectively-which-term-it-zero-arithmetic-progression-finding-their-general-term_31042",
"source_domain": "www.shaalaa.com",
"snapshot_id": "crawl=CC-MAIN-2022-21",
"warc_metadata": {
"Content-Length": "39011",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:TZLPUTX5Z434HOO3BHWVP5FHBLQT3UVN",
"WARC-Concurrent-To": "<urn:uuid:2ccbd361-646d-469d-a97c-1215105062d1>",
"WARC-Date": "2022-05-25T01:32:56Z",
"WARC-IP-Address": "104.26.13.31",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:CBJCVXDYO3TAHAI6XIF5K65MGGRYWRV4",
"WARC-Record-ID": "<urn:uuid:6c505676-6f75-4403-a2d0-4dd71576a4f9>",
"WARC-Target-URI": "https://www.shaalaa.com/question-bank-solutions/if-3rd-9th-terms-arithmetic-progression-are-4-8-respectively-which-term-it-zero-arithmetic-progression-finding-their-general-term_31042",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3acead0f-138e-4155-8183-abb38171ad1a>"
},
"warc_info": "isPartOf: CC-MAIN-2022-21\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-116\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
29,
30,
155,
156,
185,
214,
243,
247,
248,
359,
360,
389,
390,
399,
400,
411,
412,
422,
423,
445,
446,
457,
458,
482,
483,
518,
519,
528,
529,
539,
540,
574,
575,
589,
590,
603,
604,
613,
614,
656,
657,
687,
688,
717,
718,
738,
739,
754,
755,
766,
767,
776,
777,
809,
810,
871,
921,
922,
933,
934,
969,
1003,
1036,
1065,
1071,
1085,
1086,
1109,
1110,
1111,
1134
],
"line_end_idx": [
29,
30,
155,
156,
185,
214,
243,
247,
248,
359,
360,
389,
390,
399,
400,
411,
412,
422,
423,
445,
446,
457,
458,
482,
483,
518,
519,
528,
529,
539,
540,
574,
575,
589,
590,
603,
604,
613,
614,
656,
657,
687,
688,
717,
718,
738,
739,
754,
755,
766,
767,
776,
777,
809,
810,
871,
921,
922,
933,
934,
969,
1003,
1036,
1065,
1071,
1085,
1086,
1109,
1110,
1111,
1134,
1146
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1146,
"ccnet_original_nlines": 71,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 1,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.20344828069210052,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03793102875351906,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.4413793087005615,
"rps_doc_frac_unique_words": 0.446153849363327,
"rps_doc_mean_word_length": 3.856410264968872,
"rps_doc_num_sentences": 11,
"rps_doc_symbol_to_word_ratio": 0.006896549835801125,
"rps_doc_unigram_entropy": 4.211239337921143,
"rps_doc_word_count": 195,
"rps_doc_frac_chars_dupe_10grams": 0.228723406791687,
"rps_doc_frac_chars_dupe_5grams": 0.32845744490623474,
"rps_doc_frac_chars_dupe_6grams": 0.32845744490623474,
"rps_doc_frac_chars_dupe_7grams": 0.32845744490623474,
"rps_doc_frac_chars_dupe_8grams": 0.32845744490623474,
"rps_doc_frac_chars_dupe_9grams": 0.228723406791687,
"rps_doc_frac_chars_top_2gram": 0.15159574151039124,
"rps_doc_frac_chars_top_3gram": 0.17553190886974335,
"rps_doc_frac_chars_top_4gram": 0.19946809113025665,
"rps_doc_books_importance": -171.5838623046875,
"rps_doc_books_importance_length_correction": -171.5838623046875,
"rps_doc_openwebtext_importance": -110.47633361816406,
"rps_doc_openwebtext_importance_length_correction": -107.1181869506836,
"rps_doc_wikipedia_importance": -88.79251861572266,
"rps_doc_wikipedia_importance_length_correction": -88.79251861572266
},
"fasttext": {
"dclm": 0.8934623599052429,
"english": 0.8391148447990417,
"fineweb_edu_approx": 1.9592338800430298,
"eai_general_math": 0.9581754207611084,
"eai_open_web_math": 0.30103784799575806,
"eai_web_code": 0.02295297011733055
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "512.0",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Algebra"
}
},
"secondary": {
"code": "515.0",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Calculus and Mathematical analysis"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,733,790,016,391,075,000 |
LogoFastComments.com
Developing Extensions
Context
FastComments provides the ability to extend our core functionality via scripts we call Extensions.
An Extension can add additional markup to the comment widget, event listeners, and run arbitrary code.
Here you will find examples of extensions we have in production, as well as documentation on how to write extensions.
The Extension Lifecycle Internal Link
The script for each extension is fetched and invoked before the comment widget begins fetching the first set of comments and rendering the UI.
On initial load, the following data will be tagged onto the extension object:
• config - A reference to the config object.
• translations - A reference to the translations object.
• commentsById - A reference to all comments by id.
• root - A reference to the root DOM node.
Extensions should override the desired functions, which the comment widget will invoke at the appropriate times.
Defining an Extension Internal Link
The smallest extension possible would be:
A Simple Extension
External Link
1
2(function () {
3 const extension = FastCommentsUI.extensions.find((extension) => {
4 return extension.id === 'my-extension';
5 });
6})();
7
For the sake of this example, save this as my-extension.js, and make it available at https://example.com/my-extension.min.js.
This extension does not do anything, except on load it fetches the extension object created by the core comment library.
This Extension object is a singleton and is not shared with any other extensions.
Next, to load our extension, we have to tell the comment widget about it. For example:
Using a Custom Extension
External Link
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5window.FastCommentsUI(document.getElementById('fastcomments-widget'), {
6 "tenantId": "demo",
7 "extensions": [
8 {
9 "id": "my-extension",
10 "path": "https://example.com/my-extension.min.js"
11 }
12 ]
13});
14</script>
15
For functional examples, see the next section.
Example Extensions Internal Link
At FastComments, we write our own extensions, using the same API. You can view the unminified code for these extensions at the following endpoints:
Dark Mode
The Dark Mode extension is conditionally loaded when a "dark" page is detected. This extension simply adds some CSS to the comment widget. This way we do not have to load the dark mode CSS when it is not needed.
https://fastcomments.com/js/comment-ui/extensions/comment-ui.dark.extension.js
Moderation
When the current user is a moderator, we use the moderation extension.
This is a good example for adding click-based event listeners, making API requests, adding to the comment menu and comment areas.
https://fastcomments.com/js/comment-ui/extensions/comment-ui.moderation.extension.js
Live Chat
The Live Chat extension (in combination with other configuration and styling) turns the comment widget into a live chat component.
https://fastcomments.com/js/comment-ui/extensions/live-chat.extension.js
The Extension Object Internal Link
The extension object consists of the following definition:
Extension Object JSDoc
External Link
1
2/**
3 * The FastCommentsUI extension object. Used for lazy-loading certain components. For example, the review system is not
4 * used by all customers, so we only load that extension when we want it.
5 *
6 * @typedef {Object} FastCommentsUIExtension
7 * @property {string} id
8 * @property {Element} scriptNode
9 * @property {Element} root - The widget root dom node.
10 * @property {string} [css]
11 * @property {Object} config - The FastComments config object.
12 * @property {Object} commentsById - A reference to an object with all comments by id, which is kept up to date.
13 * @property {Object} translations - A reference to all translations.
14 * @property {Function} reRenderComment - A reference to a function that can be invoked to re-render a comment.
15 * @property {Function} removeCommentAndReRender - A reference to a function that can be invoked to remove a comment from memory and re-render the appropriate part of the DOM.
16 * @property {Function} newBroadcastId - A reference to a function that can be invoked create a new broadcast id and add it to the local list of broadcast ids to ignore.
17 * @property {FastCommentsUIExtensionSetupEventHandlers} [setupEventHandlers]
18 * @property {FastCommentsUIExtensionPrepareCommentForSavingCallback} [prepareCommentForSaving]
19 * @property {FastCommentsUIExtensionNewCommentCallback} [newComment]
20 * @property {FastCommentsUIExtensionReplyAreaFilter} [replyAreaFilter] - Filter HTML for the comment area.
21 * @property {FastCommentsUIExtensionWidgetFilter} [widgetFilter] - Filter HTML for the whole widget on render.
22 * @property {FastCommentsUIExtensionCommentTopFilter} [commentFilter] - Filter HTML for each comment before render.
23 * @property {FastCommentsUIExtensionReplyAreaFilter} [commentMenuFilter] - Filter HTML for each comment menu before render.
24 * @property {FastCommentsUIExtensionMenuFilter} [menuFilter] - Filter HTML for the whole widget on render.
25 * @property {FastCommentsUIExtensionReplyAreaTop} [replyAreaTop] - (LEGACY) Return HTML to add to the top of the reply area.
26 * @property {FastCommentsUIExtensionWidgetTopCallback} [widgetTop] - (LEGACY) Return HTML to add to the top of the widget.
27 * @property {FastCommentsUIExtensionCommentTopCallback} [commentTop] - (LEGACY) Return HTML to add to the top of the comment element.
28 * @property {FastCommentsUIExtensionCommentBottomCallback} [commentBottom] - (LEGACY) Return HTML to add to the bottom of the comment element.
29 * @property {FastCommentsUIExtensionMenuBottomCallback} [menuBottom] - (LEGACY) Return HTML to add to the bottom of the menu element for each comment.
30 * @property {FastCommentsUIExtensionRenderCallback} [onRender]
31 * @property {FastCommentsUIExtensionConnectionStatusCallback} [onLiveConnectionStatusUpdate]
32 * @property {FastCommentsUIExtensionInitialRenderCallback} [onInitialRenderComplete]
33 * @property {FastCommentsUIExtensionPresenceUpdateCallback} [onPresenceUpdate]
34 */
35
36/**
37 * @callback FastCommentsUIExtensionSetupEventHandlers
38 * @param {Element} element - The root element.
39 * @param {Object.<string, Function>} clickListeners - The event handlers for clicks, by class name, which can be modified by reference.
40 * @returns void
41 */
42
43/**
44 * @callback FastCommentsUIExtensionWidgetTopCallback
45 * @param {Object} moduleData
46 * @returns {string}
47 */
48
49/**
50 * @callback FastCommentsUIExtensionWidgetFilter
51 * @param {Object} moduleData
52 * @param {Object} html
53 * @returns {string}
54 */
55
56/**
57 * @callback FastCommentsUIExtensionCommentTopCallback
58 * @param {Object} comment
59 * @returns {string}
60 */
61
62/**
63 * @callback FastCommentsUIExtensionCommentTopFilter
64 * @param {Object} comment
65 * @param {string} html
66 * @returns {string}
67 */
68
69/**
70 * @callback FastCommentsUIExtensionCommentBottomCallback
71 * @param {Object} comment
72 * @returns {string}
73 */
74
75/**
76 * @callback FastCommentsUIExtensionMenuBottomCallback
77 * @param {Object} comment
78 * @returns {string}
79 */
80
81/**
82 * @callback FastCommentsUIExtensionMenuFilter
83 * @param {Object} comment
84 * @param {string} html
85 * @returns {string}
86 */
87
88/**
89 * @callback FastCommentsUIExtensionRenderCallback
90 * @returns {string}
91 */
92
93/**
94 * @callback FastCommentsUIExtensionConnectionStatusCallback
95 * @param {boolean} isConnected
96 * @returns {void}
97 */
98
99/**
100 * @callback FastCommentsUIExtensionInitialRenderCallback
101 * @returns {void}
102 */
103
104/**
105 * @callback FastCommentsUIExtensionReplyAreaTop
106 * @param {Object|null} currentUser
107 * @param {boolean} isSaving
108 * @param {boolean} isReplyOpen
109 * @param {string|null} parentId
110 * @returns {string}
111 */
112
113/**
114 * @callback FastCommentsUIExtensionReplyAreaFilter
115 * @param {Object|null} currentUser
116 * @param {boolean} isSaving
117 * @param {boolean} isReplyOpen
118 * @param {string|null} parentId
119 * @param {string|null} html
120 * @returns {string}
121 */
122
123/**
124 * @callback FastCommentsUIExtensionPrepareCommentForSavingCallback
125 * @param {Object} comment
126 * @param {string} parentId
127 */
128
129/**
130 * @callback FastCommentsUIExtensionNewCommentCallback
131 * @param {Object} comment
132 */
133
134/**
135 * @callback FastCommentsUIExtensionPresenceUpdateCallback
136 * @param {Object} update
137 */
138
The Extension API Internal Link
Interacting with the Extension is simple, as we simply define references to functions we want invoked.
To build off the example earlier, let's say we want to add HTML to the top of each comment:
A Simple Extension - Continued
External Link
1
2(function () {
3 const extension = FastCommentsUI.extensions.find((extension) => {
4 return extension.id === 'my-extension';
5 });
6
7 extension.commentFilter = function(comment, html) {
8 return `<h3>The user's name is ${comment.commenterName}!</h3>` + html;
9 }
10})();
11
Whenever you return HTML like this, it will get merged into the UI via a dom-diffing algorithm.
Manually triggering the re-render of a comment
We can wait for the initial page load and manually re-render a comment by invoking reRenderComment:
Re-Rending a Comment
External Link
1
2(function () {
3 const extension = FastCommentsUI.extensions.find((extension) => {
4 return extension.id === 'my-extension';
5 });
6
7 let renderCount = 0;
8
9 extension.commentFilter = function(comment, html) {
10 renderCount++;
11 return `<h3>The render count is ${renderCount}!</h3>` + html;
12 }
13
14 extension.onInitialRenderComplete = function() {
15 setInterval(function() {
16 extension.reRenderComment(extension.commentsById[Object.keys(extension.commentsById)[0]], function renderDone() {
17 console.log('Comment re-render done.');
18 });
19 }, 2000); // timeout not required, just an example.
20 }
21})();
22
|
{
"url": "https://docs.fastcomments.com/guide-extensions.html",
"source_domain": "docs.fastcomments.com",
"snapshot_id": "crawl=CC-MAIN-2021-43",
"warc_metadata": {
"Content-Length": "45650",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:GCMEZORKSCZLC2HCA42BUANXLKTDRJUD",
"WARC-Concurrent-To": "<urn:uuid:050bcf62-3384-48e1-871b-4b885a1acdee>",
"WARC-Date": "2021-10-22T22:50:52Z",
"WARC-IP-Address": "173.255.254.17",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:MK2NZUQK4UZH2YGNHDYCBYR7HRWQJID2",
"WARC-Record-ID": "<urn:uuid:1827883a-29c0-466e-a6cd-8578c4c62ed3>",
"WARC-Target-URI": "https://docs.fastcomments.com/guide-extensions.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:a4931aec-0a31-4098-93c1-80e7a548a80f>"
},
"warc_info": "isPartOf: CC-MAIN-2021-43\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for October 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-217\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
21,
22,
44,
45,
53,
54,
153,
154,
257,
258,
376,
377,
415,
416,
559,
560,
638,
639,
686,
745,
799,
844,
845,
958,
959,
995,
996,
1038,
1039,
1058,
1072,
1074,
1090,
1158,
1200,
1206,
1213,
1215,
1216,
1342,
1343,
1464,
1465,
1547,
1548,
1635,
1636,
1661,
1675,
1677,
1750,
1788,
1798,
1871,
1893,
1911,
1915,
1939,
1992,
1997,
2002,
2008,
2020,
2023,
2024,
2071,
2072,
2105,
2106,
2254,
2255,
2265,
2266,
2478,
2479,
2558,
2559,
2570,
2571,
2642,
2643,
2773,
2774,
2859,
2860,
2870,
2871,
3002,
3003,
3076,
3077,
3112,
3113,
3172,
3173,
3196,
3210,
3212,
3217,
3338,
3413,
3417,
3463,
3489,
3524,
3581,
3611,
3676,
3791,
3863,
3977,
4155,
4327,
4407,
4505,
4577,
4687,
4801,
4920,
5047,
5157,
5285,
5411,
5548,
5694,
5848,
5914,
6010,
6098,
6180,
6186,
6189,
6195,
6252,
6302,
6441,
6460,
6466,
6469,
6475,
6531,
6563,
6586,
6592,
6595,
6601,
6652,
6684,
6710,
6733,
6739,
6742,
6748,
6805,
6834,
6857,
6863,
6866,
6872,
6927,
6956,
6982,
7005,
7011,
7014,
7020,
7080,
7109,
7132,
7138,
7141,
7147,
7204,
7233,
7256,
7262,
7265,
7271,
7320,
7349,
7375,
7398,
7404,
7407,
7413,
7466,
7489,
7495,
7498,
7504,
7567,
7601,
7622,
7628,
7631,
7637,
7698,
7720,
7727,
7731,
7738,
7790,
7829,
7861,
7896,
7932,
7956,
7963,
7967,
7974,
8029,
8068,
8100,
8135,
8171,
8203,
8227,
8234,
8238,
8245,
8316,
8346,
8377,
8384,
8388,
8395,
8453,
8483,
8490,
8494,
8501,
8563,
8592,
8599,
8603,
8604,
8636,
8637,
8740,
8741,
8833,
8834,
8865,
8879,
8881,
8897,
8965,
9007,
9013,
9015,
9069,
9142,
9146,
9154,
9157,
9158,
9254,
9255,
9302,
9303,
9403,
9404,
9425,
9439,
9441,
9457,
9525,
9567,
9573,
9575,
9598,
9600,
9654,
9672,
9737,
9742,
9745,
9797,
9825,
9942,
9985,
9992,
10047,
10052,
10060
],
"line_end_idx": [
21,
22,
44,
45,
53,
54,
153,
154,
257,
258,
376,
377,
415,
416,
559,
560,
638,
639,
686,
745,
799,
844,
845,
958,
959,
995,
996,
1038,
1039,
1058,
1072,
1074,
1090,
1158,
1200,
1206,
1213,
1215,
1216,
1342,
1343,
1464,
1465,
1547,
1548,
1635,
1636,
1661,
1675,
1677,
1750,
1788,
1798,
1871,
1893,
1911,
1915,
1939,
1992,
1997,
2002,
2008,
2020,
2023,
2024,
2071,
2072,
2105,
2106,
2254,
2255,
2265,
2266,
2478,
2479,
2558,
2559,
2570,
2571,
2642,
2643,
2773,
2774,
2859,
2860,
2870,
2871,
3002,
3003,
3076,
3077,
3112,
3113,
3172,
3173,
3196,
3210,
3212,
3217,
3338,
3413,
3417,
3463,
3489,
3524,
3581,
3611,
3676,
3791,
3863,
3977,
4155,
4327,
4407,
4505,
4577,
4687,
4801,
4920,
5047,
5157,
5285,
5411,
5548,
5694,
5848,
5914,
6010,
6098,
6180,
6186,
6189,
6195,
6252,
6302,
6441,
6460,
6466,
6469,
6475,
6531,
6563,
6586,
6592,
6595,
6601,
6652,
6684,
6710,
6733,
6739,
6742,
6748,
6805,
6834,
6857,
6863,
6866,
6872,
6927,
6956,
6982,
7005,
7011,
7014,
7020,
7080,
7109,
7132,
7138,
7141,
7147,
7204,
7233,
7256,
7262,
7265,
7271,
7320,
7349,
7375,
7398,
7404,
7407,
7413,
7466,
7489,
7495,
7498,
7504,
7567,
7601,
7622,
7628,
7631,
7637,
7698,
7720,
7727,
7731,
7738,
7790,
7829,
7861,
7896,
7932,
7956,
7963,
7967,
7974,
8029,
8068,
8100,
8135,
8171,
8203,
8227,
8234,
8238,
8245,
8316,
8346,
8377,
8384,
8388,
8395,
8453,
8483,
8490,
8494,
8501,
8563,
8592,
8599,
8603,
8604,
8636,
8637,
8740,
8741,
8833,
8834,
8865,
8879,
8881,
8897,
8965,
9007,
9013,
9015,
9069,
9142,
9146,
9154,
9157,
9158,
9254,
9255,
9302,
9303,
9403,
9404,
9425,
9439,
9441,
9457,
9525,
9567,
9573,
9575,
9598,
9600,
9654,
9672,
9737,
9742,
9745,
9797,
9825,
9942,
9985,
9992,
10047,
10052,
10060,
10062
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 10062,
"ccnet_original_nlines": 285,
"rps_doc_curly_bracket": 0.01610017940402031,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.16724053025245667,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.018199700862169266,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.446630597114563,
"rps_doc_frac_unique_words": 0.39065107703208923,
"rps_doc_mean_word_length": 6.499165058135986,
"rps_doc_num_sentences": 94,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.4507060050964355,
"rps_doc_word_count": 1198,
"rps_doc_frac_chars_dupe_10grams": 0.07346519082784653,
"rps_doc_frac_chars_dupe_5grams": 0.09337271749973297,
"rps_doc_frac_chars_dupe_6grams": 0.08720780909061432,
"rps_doc_frac_chars_dupe_7grams": 0.08720780909061432,
"rps_doc_frac_chars_dupe_8grams": 0.08720780909061432,
"rps_doc_frac_chars_dupe_9grams": 0.07821731269359589,
"rps_doc_frac_chars_top_2gram": 0.008348319679498672,
"rps_doc_frac_chars_top_3gram": 0.01387105043977499,
"rps_doc_frac_chars_top_4gram": 0.011559209786355495,
"rps_doc_books_importance": -739.33935546875,
"rps_doc_books_importance_length_correction": -739.33935546875,
"rps_doc_openwebtext_importance": -365.9852294921875,
"rps_doc_openwebtext_importance_length_correction": -365.9852294921875,
"rps_doc_wikipedia_importance": -263.2210998535156,
"rps_doc_wikipedia_importance_length_correction": -263.2210998535156
},
"fasttext": {
"dclm": 0.7348006963729858,
"english": 0.5091222524642944,
"fineweb_edu_approx": 1.5434023141860962,
"eai_general_math": 0.14595121145248413,
"eai_open_web_math": 0.43800729513168335,
"eai_web_code": 0.74900883436203
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-5,314,066,210,141,336,000 |
Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I want to let user to choose "Exact Match" or "Not Exact Match" options for the search. How can I do that?
I tried to create a searching field typed "string" and copyField is "text". String is for exact match and text is for not exact match. How can I specific the field type in the query? Or any idea is better?
Thanks and any help is regarded.
share|improve this question
is your user directly hitting Solr or is there a web app in the middle? – Mauricio Scheffer Apr 6 '11 at 13:05
1 Answer
For partial matching you can use ngrams. When the user selects "Not Exact Match" you can use the dismax handler and set all ngram fields as 'qf' in your request. For reference
share|improve this answer
Your Answer
discard
By posting your answer, you agree to the privacy policy and terms of service.
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "http://stackoverflow.com/questions/5563988/solr-query-by-specific-type-exact-match-or-not-exact-match-option",
"source_domain": "stackoverflow.com",
"snapshot_id": "crawl=CC-MAIN-2013-20",
"warc_metadata": {
"Content-Length": "40205",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:SVIZVKWIJPSWNA6OQQSFKJYQF6ZG2TRL",
"WARC-Concurrent-To": "<urn:uuid:37000142-313a-4f4b-9a04-2fea1459a27c>",
"WARC-Date": "2013-06-20T06:22:32Z",
"WARC-IP-Address": "198.252.206.16",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:3QNEAGPIBQ5OGKVUA767PJTVIIRNAKHA",
"WARC-Record-ID": "<urn:uuid:a701ede7-8b0a-46ab-8254-0e1f1334a53b>",
"WARC-Target-URI": "http://stackoverflow.com/questions/5563988/solr-query-by-specific-type-exact-match-or-not-exact-match-option",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:df7ab606-ea5c-45aa-9217-a7b391af6016>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-60-113-184.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2013-20\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for Spring 2013\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
15,
147,
148,
255,
256,
462,
463,
496,
497,
525,
636,
637,
646,
647,
823,
824,
850,
851,
863,
864,
866,
874,
875,
953,
954
],
"line_end_idx": [
15,
147,
148,
255,
256,
462,
463,
496,
497,
525,
636,
637,
646,
647,
823,
824,
850,
851,
863,
864,
866,
874,
875,
953,
954,
1044
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1044,
"ccnet_original_nlines": 25,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.35840708017349243,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.017699120566248894,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.190265491604805,
"rps_doc_frac_unique_words": 0.5913978219032288,
"rps_doc_mean_word_length": 4.354838848114014,
"rps_doc_num_sentences": 15,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.415524482727051,
"rps_doc_word_count": 186,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.061728399246931076,
"rps_doc_frac_chars_top_3gram": 0.048148151487112045,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -107.68903350830078,
"rps_doc_books_importance_length_correction": -107.68903350830078,
"rps_doc_openwebtext_importance": -69.69264221191406,
"rps_doc_openwebtext_importance_length_correction": -56.769718170166016,
"rps_doc_wikipedia_importance": -48.08645248413086,
"rps_doc_wikipedia_importance_length_correction": -48.08645248413086
},
"fasttext": {
"dclm": 0.9297544360160828,
"english": 0.9081667065620422,
"fineweb_edu_approx": 0.9884682893753052,
"eai_general_math": -0.000009420000424142927,
"eai_open_web_math": 0.0469856895506382,
"eai_web_code": -0.000009890000001178123
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.778",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "1",
"label": "Leftover HTML"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,729,794,620,474,120,700 |
{"docs":{"name":"42 Api","info":"\n\u003cp\u003eThis is the second version of the 42‘s API.\u003c/p\u003e\n","copyright":"","doc_url":"/apidoc/2.0","api_url":"/api","resources":[{"doc_url":"/apidoc/2.0/scale_teams","api_url":"/api","name":"Scale teams","short_description":"A defence of a \u003ca href='#teams'\u003eteam\u003c/a\u003e (on a \u003ca href='#projects'\u003eproject\u003c/a\u003e), involving an evaluator","full_description":"","version":"2.0","formats":null,"metadata":null,"methods":[{"doc_url":"/apidoc/2.0/scale_teams/create","name":"create","apis":[{"api_url":"/v2/scale_teams","http_method":"POST","short_description":null,"deprecated":null}],"formats":null,"full_description":"\n\u003cp\u003eWith this call, the evaluator is set as the token’s user_id. If you want to set an evaluation for a particular user, use the \u003ca href=\"/apidoc/2.0/scale_teams/multiple_create.html\"\u003emultiple_create\u003c/a\u003e call\u003c/p\u003e\n","errors":[],"params":[{"name":"scale_team","full_name":"scale_team","description":"","required":false,"allow_nil":true,"validator":"Must be a Hash","expected_type":"hash","metadata":null,"show":true,"validations":[],"params":[{"name":"team_id","full_name":"scale_team[team_id]","description":"\n\u003cp\u003eThe team id.\u003c/p\u003e\n","required":true,"allow_nil":false,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"scale_id","full_name":"scale_team[scale_id]","description":"\n\u003cp\u003eThe scale id.\u003c/p\u003e\n","required":true,"allow_nil":false,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"comment","full_name":"scale_team[comment]","description":"\n\u003cp\u003eThe comment. Maximum length is 1024.\u003c/p\u003e\n","required":true,"allow_nil":false,"validator":"Must be String","expected_type":"string","metadata":null,"show":true,"validations":[]},{"name":"flag","full_name":"scale_team[flag]","description":"\n\u003cp\u003eThe flag.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be String","expected_type":"string","metadata":null,"show":true,"validations":[]},{"name":"final_mark","full_name":"scale_team[final_mark]","description":"\n\u003cp\u003eThe final mark.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"truant_id","full_name":"scale_team[truant_id]","description":"\n\u003cp\u003eThe truant id.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"answers_attributes","full_name":"scale_team[answers_attributes]","description":"\n\u003cp\u003eThe answers attributes.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be an Array of nested elements","expected_type":"array","metadata":null,"show":true,"validations":[],"params":[{"name":"question_id","full_name":"scale_team[answers_attributes][question_id]","description":"\n\u003cp\u003eThe question id. Must be unique in the scope of a given scalable entity.\u003c/p\u003e\n","required":true,"allow_nil":false,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"value","full_name":"scale_team[answers_attributes][value]","description":"\n\u003cp\u003eThe value.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]},{"name":"id","full_name":"scale_team[answers_attributes][id]","description":"\n\u003cp\u003eThe id.\u003c/p\u003e\n","required":false,"allow_nil":true,"validator":"Must be Fixnum","expected_type":"numeric","metadata":null,"show":true,"validations":[]}]}]}],"examples":[{"verb":"POST","path":"/v2/scale_teams","versions":["2.0"],"query":null,"request_data":{"scale_team":{"begin_at":"2017-11-27 09:00:00 UTC","scale_id":"1","team_id":"68"}},"response_data":{"id":2,"scale_id":1,"comment":null,"created_at":"2017-11-22T13:44:01.281Z","updated_at":"2017-11-22T13:44:01.281Z","feedback":null,"feedback_rating":null,"final_mark":null,"flag":{"id":1,"name":"Ok","positive":true,"icon":"check-4","created_at":"2017-11-22T13:41:01.837Z","updated_at":"2017-11-22T13:41:01.837Z"},"begin_at":null,"correcteds":[{"id":125,"login":"sebulseb","url":"https://api.intra.42.fr/v2/users/sebulseb"}],"corrector":{},"truant":{},"filled_at":null,"scale":{"id":1,"evaluation_id":1,"name":"Utah ducks","is_primary":true,"comment":"Perferendis maiores dreamcatcher. Pickled five dollar toast truffaut quis fashion axe.","introduction_md":"Direct trade asperiores aut odit. Eius meh qui nihil reprehenderit. Before they sold out vegan molestias. Brooklyn rerum non architecto mumblecore franzen post-ironic.","disclaimer_md":"Ipsa expedita gluten-free. Laboriosam ennui actually literally aut trust fund.","guidelines_md":"Tumblr ethical eaque blanditiis eligendi. Dolores facere maiores hashtag pour-over architecto.","created_at":"2017-11-22T13:41:27.388Z","correction_number":3,"duration":1800,"manual_subscription":true,"languages":[{"id":3,"name":"Romanian","identifier":"ro","created_at":"2017-11-22T13:40:59.468Z","updated_at":"2017-11-22T13:41:26.139Z"}]},"team":{"id":68,"name":"sebulseb's group","url":"https://api.intra.42.fr/v2/teams/68","final_mark":null,"project_id":1,"created_at":"2017-11-22T13:41:37.418Z","updated_at":"2017-11-22T13:44:01.294Z","status":"waiting_for_correction","terminating_at":null,"users":[{"id":125,"login":"sebulseb","url":"https://api.intra.42.fr/v2/users/sebulseb","leader":true,"occurrence":0,"validated":true,"projects_user_id":68}],"locked?":true,"validated?":null,"closed?":true,"repo_url":null,"repo_uuid":"intra-uuid-5af5ca8d-e0dc-4791-9cfc-ed657e1984e0-68","locked_at":"2017-11-22T13:41:37.471Z","closed_at":"2017-11-22T13:41:37.496Z","project_session_id":1},"feedbacks":[]},"code":"201","show_in_doc":1,"recorded":true}],"metadata":{"authentication":"user","required_scopes":["projects"],"roles":["advanced_tutor"]},"see":[],"headers":[],"show":true}],"headers":[]}]}}
|
{
"url": "https://api.intra.42.fr/apidoc/2.0/scale_teams/create.json",
"source_domain": "api.intra.42.fr",
"snapshot_id": "crawl=CC-MAIN-2020-16",
"warc_metadata": {
"Content-Length": "6809",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PU5EZZPBTS4ZYXQ6YCSTTKCGOXPOX3JO",
"WARC-Concurrent-To": "<urn:uuid:26f53565-601c-4a3a-85e4-66d7da16cd40>",
"WARC-Date": "2020-04-08T13:13:22Z",
"WARC-IP-Address": "163.172.250.12",
"WARC-Identified-Payload-Type": "application/json",
"WARC-Payload-Digest": "sha1:LDQPNOO7ZRI77HVGT4LO4KQ5PYDKSGW6",
"WARC-Record-ID": "<urn:uuid:01ff47e7-b350-4a7c-bf3f-ddeb00192b8c>",
"WARC-Target-URI": "https://api.intra.42.fr/apidoc/2.0/scale_teams/create.json",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8ccec0c7-6df8-4778-845a-e17b8fbeb13f>"
},
"warc_info": "isPartOf: CC-MAIN-2020-16\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for March/April 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-155.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0
],
"line_end_idx": [
6192
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 6192,
"ccnet_original_nlines": 0,
"rps_doc_curly_bracket": 0.009366930462419987,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.07963988929986954,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.018698060885071754,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5131579041481018,
"rps_doc_frac_unique_words": 0.790123462677002,
"rps_doc_mean_word_length": 27.030864715576172,
"rps_doc_num_sentences": 55,
"rps_doc_symbol_to_word_ratio": 0.0013850399991497397,
"rps_doc_unigram_entropy": 4.64944314956665,
"rps_doc_word_count": 162,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0013701800489798188,
"rps_doc_frac_chars_top_3gram": 0,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -499.28900146484375,
"rps_doc_books_importance_length_correction": -499.28900146484375,
"rps_doc_openwebtext_importance": -418.6937561035156,
"rps_doc_openwebtext_importance_length_correction": -418.6937561035156,
"rps_doc_wikipedia_importance": -400.07415771484375,
"rps_doc_wikipedia_importance_length_correction": -400.07415771484375
},
"fasttext": {
"dclm": 0.39481836557388306,
"english": 0.5330027937889099,
"fineweb_edu_approx": 1.2642687559127808,
"eai_general_math": 0.31856226921081543,
"eai_open_web_math": 0.13016164302825928,
"eai_web_code": 0.19156986474990845
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "1",
"label": "Leftover HTML"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
1,543,305,732,486,040,800 |
Click here to Skip to main content
15,394,939 members
Articles / Artificial Intelligence
Article
Posted 29 May 2020
Stats
11.9K views
357 downloads
2 bookmarked
Loading CSV and SQL Data into Pandas
Rate me:
Please Sign up or sign in to vote.
5.00/5 (12 votes)
29 May 2020CPOL4 min read
In this second part of the Data Cleaning with Python and Pandas series, now that we have a Jupyter Notebook set up and some basic libraries initialized, we need to load some data. To do this, we’ll load data from a CSV file, as well as from a local SQLite database.
The first step in any data analysis process is to ingest the dataset, evaluate how clean it is, and decide what we need to do to fix inherited issues.
Introduction
This article is part of the Data Cleaning with Python and Pandas series. It’s aimed at getting developers up and running quickly with data science tools and techniques.
If you’d like to check out the other articles in the series, you can find them here:
Once we have a Jupyter Notebook set up and some basic libraries initialized, we need to load some data. To do this, we’ll load data from a CSV file, as well as from a local SQLite database. We’ll then show some of the basic analytics and functions available in Pandas that you can use to display and perform basic analysis on the data.
We've created a complete Jupyter Notebook with the source data files for this series of modules, which you can download and install locally.
Image 1
Before we get started, make sure the customers.csv file and the remoteDB.db that goes along with this series are copied into the same directory as the Notebook we saved.
Loading Data from CSV
Let's have a look at loading data into Pandas from a CSV file first. The customers.csv file we added to the same directory as the notebook will be loaded to keep things simple, but you could also load it remotely as well. Add a new input line to your notebook containing the following command:
Image 2
pd.read_csv("customers.csv")
This command uses the Pandas library to load and display our customers.csv file.
Based on the lines displayed, you’ll immediately see some potential issues with the data, displayed as a NaN. You’ll also see the output generated as a table.
In Pandas, a table is referred to as a DataFrame, which is a two-dimensional data structure similar to a spreadsheet.
Let's move this into a variable and display the first five rows by modifying the code line to:
SQL
# Read data from the CSV files
customers = pd.read_csv("customers.csv")
print(customers.head(5))
(Note that here and throughout the article, you’ll see the results of running the code immediately following the code.)
Image 3
This will read our CSV into a variable and display the first five rows of our data structure.
Loading Data from SQLite
Now let’s load some additional data into Pandas from a SQLite database. We’ll use the sqlite3 library to load and read from the database. You can use a similar process with regular databases as well as with different Python libraries, but SQLite is serverless and requires only the single database file we copied in earlier. Let’s access this file as a database.
To start, we’ll modify our first code block to include another Python library:
Image 4
SQL
import sqlite3 as sql
Then, below where we read customers from the CSV files, add the following code:
Image 5
SQL
con = sql.connect("remoteDB.db")
products = pd.read_sql_query("SELECT * from products", con)
purchases = pd.read_sql_query("SELECT * from purchases", con)
con.close()
print(products.head(5))
print(purchases.head(5))
If we step through this code, the first line connects to the database file, remoteDB.db. The next two lines use Pandas to create a DataFrame from the return of each SQL query. In this example, there are two tables, "products" and "purchases". Finally, the last line in this block closes the connection to the SQL database.
We then print a copy of the first five lines of each variable. The heads of these two data sets look pretty good, so we’ll have to see if there are any further issues with them later.
Image 6
Basic Data Analysis
Before moving on, let's do a quick, basic analysis of our datasets. Create a new code block and enter the following code:
SQL
print(customers.shape)
print(customers.dtypes)
print(customers.describe(include="all"))
Here are some results:
Image 7
For each of the three tables, this code will produce some basic statistics for the data we loaded.
• The shape method shows the number of rows and columns for each data frame.
• The dtypes method shows the types of data involved.
• The describe method (with the include="all" modifier) shows statistical information about the data, such as a count of valid values, the number of unique values, the frequency of the values, and so on.
Notice that some of the counts don't match the totals. This is because of missing information in the cells, which we’ll need to find and correct. Our dataset includes customer and product information, with purchases, over the course of a few months, so there’s a lot of different information this defines for us.
Summary
We loaded data from our CSV file and our SQL server using the Pandas DataFrame data structure. We also took a quick look at some basic analysis functions that showed handy information about our datasets.
Now, let’s move on to data cleaning by exploring some of the options for finding and dealing with missing values.
This article is part of the series 'Data Cleaning with Python and Pandas View All
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Share
About the Author
Glenn Prince
Architect
United States United States
Hi! I'm a Solution Architect, planning and designing systems based in Denver, Colorado. I also occasionally develop web applications and games, as well as write. My blog has articles, tutorials and general thoughts based on more than twenty years of misadventures in IT.
Comments and Discussions
-- There are no messages in this forum --
|
{
"url": "https://www.codeproject.com/Articles/5269218/Loading-CSV-and-SQL-Data-into-Pandas",
"source_domain": "www.codeproject.com",
"snapshot_id": "crawl=CC-MAIN-2022-33",
"warc_metadata": {
"Content-Length": "81719",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:KH6TSZMA5CGOMASPUPXT3WVWXPK6N7HQ",
"WARC-Concurrent-To": "<urn:uuid:613218db-8596-4fd3-89b7-a334adb099ce>",
"WARC-Date": "2022-08-14T13:06:11Z",
"WARC-IP-Address": "76.74.234.210",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:MEBWHXYMBRMXTCTTWRC4K6GP4IRAOXIP",
"WARC-Record-ID": "<urn:uuid:eea34579-44ff-453e-aeed-08e5368a9a80>",
"WARC-Target-URI": "https://www.codeproject.com/Articles/5269218/Loading-CSV-and-SQL-Data-into-Pandas",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:c0c78ca8-eebb-4047-84f2-a366c4244ad8>"
},
"warc_info": "isPartOf: CC-MAIN-2022-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-141\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
35,
54,
89,
97,
116,
117,
123,
124,
136,
150,
163,
164,
201,
202,
211,
246,
264,
290,
556,
707,
708,
721,
722,
891,
892,
977,
978,
1314,
1315,
1456,
1457,
1465,
1466,
1636,
1637,
1659,
1660,
1954,
1955,
1963,
1964,
1993,
1994,
2075,
2076,
2235,
2236,
2354,
2355,
2450,
2451,
2455,
2486,
2527,
2552,
2553,
2673,
2674,
2682,
2683,
2777,
2778,
2803,
2804,
3167,
3168,
3247,
3248,
3256,
3257,
3261,
3283,
3284,
3364,
3365,
3373,
3374,
3378,
3411,
3471,
3533,
3545,
3546,
3570,
3595,
3596,
3919,
3920,
4104,
4105,
4113,
4114,
4134,
4135,
4257,
4258,
4262,
4285,
4309,
4350,
4351,
4374,
4375,
4383,
4384,
4483,
4484,
4563,
4619,
4825,
4826,
5139,
5140,
5148,
5149,
5353,
5354,
5468,
5469,
5551,
5552,
5560,
5561,
5679,
5680,
5686,
5687,
5704,
5705,
5718,
5728,
5756,
6027,
6028,
6053,
6054,
6056
],
"line_end_idx": [
35,
54,
89,
97,
116,
117,
123,
124,
136,
150,
163,
164,
201,
202,
211,
246,
264,
290,
556,
707,
708,
721,
722,
891,
892,
977,
978,
1314,
1315,
1456,
1457,
1465,
1466,
1636,
1637,
1659,
1660,
1954,
1955,
1963,
1964,
1993,
1994,
2075,
2076,
2235,
2236,
2354,
2355,
2450,
2451,
2455,
2486,
2527,
2552,
2553,
2673,
2674,
2682,
2683,
2777,
2778,
2803,
2804,
3167,
3168,
3247,
3248,
3256,
3257,
3261,
3283,
3284,
3364,
3365,
3373,
3374,
3378,
3411,
3471,
3533,
3545,
3546,
3570,
3595,
3596,
3919,
3920,
4104,
4105,
4113,
4114,
4134,
4135,
4257,
4258,
4262,
4285,
4309,
4350,
4351,
4374,
4375,
4383,
4384,
4483,
4484,
4563,
4619,
4825,
4826,
5139,
5140,
5148,
5149,
5353,
5354,
5468,
5469,
5551,
5552,
5560,
5561,
5679,
5680,
5686,
5687,
5704,
5705,
5718,
5728,
5756,
6027,
6028,
6053,
6054,
6056,
6097
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 6097,
"ccnet_original_nlines": 137,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3797963857650757,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.019577130675315857,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.1761942058801651,
"rps_doc_frac_unique_words": 0.3672260642051697,
"rps_doc_mean_word_length": 4.74037504196167,
"rps_doc_num_sentences": 67,
"rps_doc_symbol_to_word_ratio": 0.0007830900140106678,
"rps_doc_unigram_entropy": 5.236115455627441,
"rps_doc_word_count": 1013,
"rps_doc_frac_chars_dupe_10grams": 0.07913368940353394,
"rps_doc_frac_chars_dupe_5grams": 0.1291128695011139,
"rps_doc_frac_chars_dupe_6grams": 0.12119950354099274,
"rps_doc_frac_chars_dupe_7grams": 0.09537693113088608,
"rps_doc_frac_chars_dupe_8grams": 0.09537693113088608,
"rps_doc_frac_chars_dupe_9grams": 0.09537693113088608,
"rps_doc_frac_chars_top_2gram": 0.00937109999358654,
"rps_doc_frac_chars_top_3gram": 0.006663890089839697,
"rps_doc_frac_chars_top_4gram": 0.01374427042901516,
"rps_doc_books_importance": -527.1360473632812,
"rps_doc_books_importance_length_correction": -527.1360473632812,
"rps_doc_openwebtext_importance": -282.5916748046875,
"rps_doc_openwebtext_importance_length_correction": -282.5916748046875,
"rps_doc_wikipedia_importance": -194.56585693359375,
"rps_doc_wikipedia_importance_length_correction": -194.56585693359375
},
"fasttext": {
"dclm": 0.026862140744924545,
"english": 0.9080053567886353,
"fineweb_edu_approx": 2.572596549987793,
"eai_general_math": 0.7243326306343079,
"eai_open_web_math": 0.22696977853775024,
"eai_web_code": 0.2291707992553711
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.758",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,144,082,553,070,776,000 |
US8635277B2 - Mediated lending of digital items - Google Patents
Mediated lending of digital items Download PDF
Info
Publication number
US8635277B2
US8635277B2 US13/075,013 US201113075013A US8635277B2 US 8635277 B2 US8635277 B2 US 8635277B2 US 201113075013 A US201113075013 A US 201113075013A US 8635277 B2 US8635277 B2 US 8635277B2
Authority
US
United States
Prior art keywords
user
digital
lending
digital item
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active, expires
Application number
US13/075,013
Other versions
US20120254303A1 (en
Inventor
Karthik G. Anbalagan
Tom Killalea
Emily Margaret Anderson
Valeria A. Pakhomova
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Amazon Technologies Inc
Original Assignee
Amazon Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Amazon Technologies Inc filed Critical Amazon Technologies Inc
Priority to US13/075,013 priority Critical patent/US8635277B2/en
Assigned to AMAZON TECHNOLOGIES, INC. reassignment AMAZON TECHNOLOGIES, INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: ANBALAGAN, KARTHIK G., ANDERSON, EMILY MARGARET, KILLALEA, TOM, PAKHOMOVA, VALERIA A.
Priority claimed from PCT/US2012/030982 external-priority patent/WO2012135367A2/en
Publication of US20120254303A1 publication Critical patent/US20120254303A1/en
Application granted granted Critical
Publication of US8635277B2 publication Critical patent/US8635277B2/en
Active legal-status Critical Current
Adjusted expiration legal-status Critical
Links
Images
Classifications
• GPHYSICS
• G06COMPUTING; CALCULATING; COUNTING
• G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
• G06Q30/00Commerce, e.g. shopping or e-commerce
• G06Q30/02Marketing, e.g. market research and analysis, surveying, promotions, advertising, buyer profiling, customer management or rewards; Price estimation or determination
• G06Q30/0241Advertisement
• GPHYSICS
• G06COMPUTING; CALCULATING; COUNTING
• G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
• G06Q30/00Commerce, e.g. shopping or e-commerce
• G06Q30/06Buying, selling or leasing transactions
• GPHYSICS
• G06COMPUTING; CALCULATING; COUNTING
• G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
• G06Q30/00Commerce, e.g. shopping or e-commerce
• G06Q30/06Buying, selling or leasing transactions
• G06Q30/0645Rental, i.e. leasing
• GPHYSICS
• G06COMPUTING; CALCULATING; COUNTING
• G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
• G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
• G06Q50/01Social networking
Abstract
Digital items may be lent from one user to another. A lending system may facilitate matching users that have a digital item to lend with users that wish to borrow a digital item. Each user may have a reputation associated with his or her lending behavior that is represented as a lending metric. The lending metric may show whether a given user is primarily a lender or borrower of digital items. Heavy borrowers that do not engage in commensurate lending may be penalized. Multiple users that lend and borrow digital items from one another may be connected in a social network. The nature of a relationship in the social network may and the lending metrics of users are factors used to make lending decisions.
Description
BACKGROUND
A large and growing population of people enjoys entertainment through consumption of digital content items, such as music, movies, images, books and other types of digital content. Many people today consume digital content through a wide variety of electronic devices. Among these electronic devices are electronic book readers, cellular telephones, personal digital assistants (PDAs), portable media players, tablets, netbooks, and the like.
As more content is made available in digital form, the economic landscape for content creation, production, and distribution is evolving. This is particularly the case for music, movies, and electronic books (or “eBooks”). Such content items may be distributed online to electronic devices, without production of a portable physical medium, such as a tape cassette, CD, DVD, or physical paper-based book. As a result, many of the transaction costs associated with traditional channels of distribution on physical media are being reduced or eliminated entirely. This leads to the possibility of new economic and social models involving selling, lending, and borrowing of digital items.
BRIEF DESCRIPTION OF THE DRAWINGS
The detailed description is set forth with reference to the accompanying figures. In the figures, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. The use of the same reference numbers in different figures indicates similar or identical items or features.
FIG. 1 illustrates an architecture of computers and networks in which various models for lending of digital items and calculating lending metrics may be implemented.
FIG. 2 shows a social network of multiple users that may lend and/or borrow digital items from one another.
FIG. 3 shows a lending and borrowing history associated with a particular user and representation of a lending metric for that user based upon the lending and borrowing history.
FIG. 4 illustrates the loan of a copy of a digital item from a lender device to a borrower device.
FIG. 5 shows multiple lists of digital items associated with different lenders and borrowers.
FIG. 6 is a block diagram illustrating selected modules in the computing systems employed in the various devices and architectures of FIGS. 1-5.
FIG. 7 is a flow diagram of an example process of modifying a lending metric based on lending and borrowing behavior.
FIG. 8 is a flow diagram of an example process of facilitating lending of digital items that and increasing a lending metric of the lender.
FIG. 9 is a flow diagram of an example process of recommending a borrower to loan a digital item upon the owner of the digital item consuming or abandoning the digital item.
FIG. 10 is a flow diagram of an example process of facilitating lending of a digital item to a first user that responds to a notice of a lending opportunity and providing a commission payment to the lender if a user that is not able to borrow the digital item instead purchases the digital item.
FIG. 11 is a flow diagram of an example process of facilitating lending of a digital item to a potential borrower that responds to an indication that the digital item is available.
FIG. 12 is a flow diagram of an example process of storing annotations of a borrowed digital item in association with the user that borrowed the digital item and made the annotations.
DETAILED DESCRIPTION
This disclosure describes various architectures and techniques in which digital items, such as electronic books (or “eBook”), may be loaned and borrowed. The architectures provide a functional environment to permit transfer of such digital items, as well as tracking of the lending behavior as a “lending metric.” As one scenario, a user may lend a digital item, such as an eBook, to another user and receive an increase in his or her lending metric. Conversely, the user may also borrow a digital item from another user in which case the user's lending metric is decreased.
In another scenario, a user may wish to lend a digital item to a “friend” or “follower” in a social network. A recommendation may be provided to the user automatically upon finishing the digital item (e.g., after reading an entire eBook) to lend his or her digital item to another user in the social network. The system that generates the recommendations may be configured to recommend lending to users based on distance or reputation in the social network or to users with high lending metrics more so than other users.
In another scenario, the user may have digital items to lend and may also wish to borrow certain digital items. A loan-matching infrastructure may identify another user with complementary lendable items and borrowing desires. The loan matching may additionally function as a mechanism for introducing users that are in the same social network but not yet connected to one another in that social network, or it may serve to strengthen the relationship between users who are already connected.
As a further scenario, the architecture may enable a user with a lendable digital item to broadcast and/or narrowcast the availability of the digital item to just friends or to many other users. One of multiple users that respond to the broadcast/narrowcast may be selected based on speed of response, lending metric, social network relationship, and the like. For digital items that are able to be lent only a limited number of times, this technique of soliciting many responses may assist the user in deciding which user or users are allowed to borrow the digital item.
In a further scenario, or in conjunction with any of the above scenarios, the recipient of a loaned digital item may annotate or “markup” the digital item with comments, notes, etc. The lender of the digital item may have no interest in this other user's annotations and may prefer to receive his or her digital item returned without the annotations of another. Therefore, annotations made to a loaned digital item may be stored in association with the user that made those annotations (e.g., stored as part of a user account, linked to a user ID, etc.). The annotations may persist even after the digital item has been returned and the borrower may view his or her annotations separate from the digital item (e.g., when he or she does not have access to a copy). The user that generated the annotations (e.g., the borrower) may designate those annotations as publicly available so that anyone who consumes the same digital item may choose to view those public annotations. Additionally, the annotations may be automatically associated with any copy of the digital item that becomes available to the borrower. For example, if the borrower later purchases a copy of the same digital item he or she previously borrowed and annotated, those previous annotations will appear in the purchased copy.
The digital items may be manifest in many different ways including, for example, as text-based items, audio items, video items, multimedia items, graphical items, and so forth. For discussion purposes, the architecture and techniques are described in the context of eBook reader devices and electronic books. The terms “electronic book” and/or “eBook,” as used herein, include electronic or digital representations of printed works (or portions of printed works), as well as digital content that may include text, multimedia, hypertext and/or hypermedia. Examples of printed and/or digital works include, but are not limited to, books, magazines, newspapers, periodicals, journals, reference materials, telephone books, textbooks, anthologies, instruction manuals, proceedings of meetings, forms, directories, maps, web pages, etc. However, certain concepts described herein are also applicable to other types of digital content items, such as music, audio books, video, and other content items that people watch, listens to, consume, or otherwise experience.
Further, eBooks are just one form of a common work. The common work may represent the text of the book regardless of the format. For example, an eBook may also be released in other forms, such as paperback, hardcover, and audio. Although a rights holder such as a publisher, author, distributor etc. may have rights such as a copyright in the common work, multiple copies of that work may be owned by various end users. If the work is manifest in digital form (e.g., eBook), digital rights management (DRM) or other technological features may prevent lending or limit a number of times that the digital copy of the common work may be lent. Thus, unlike paperback or hardback versions of a book, the ability to lend an eBook (or other digital item) may be a limited resource that has a high value because of the scarceness of “lends” associated with the eBook.
Illustrative Architecture
FIG. 1 shows an illustrative architecture 100 of computers and networks in which digital items, such as electronic books (or “eBook”), may be loaned and/or borrowed. A lender 102 interacts with a lender device 104 to consume digital items 106 that the lender 102 has previously purchased or otherwise owns. In this illustration, the lender device 104 is embodied as an electronic book reader device that stores one or more digital items 106 such as eBooks. A lending system 108 may be implemented in whole or in part on the lender device 104. The lending system 108 allows the lender 102 to lend digital items 106 to other users. The lending module 108 is discussed in greater detail below.
The lender device 104 is equipped with wireless or other communications technology to connect with a network 110. The network 110 is representative of any one or combination of multiple different types of networks, such as the Internet, cable networks, cellular networks, wireless networks (e.g., Wi-Fi, cellular, etc.) and wired networks.
A lending broker 112 shown here as a server computer connected to the network 110 may function in facilitating lending of digital items between the lender 102 and other users. The lending system 108 may also be implemented in whole or in part on the lending broker 112. The lending broker 112 may also perform additional functions related to digital items such as online or “cloud” storage of digital items. Similarly, the lending broker 112 may facilitate purchasing of digital items either from an online retailer maintained as part of the lending broker 112 or from another entity.
In implementations in which all of the lending system 108 is maintained on the lending broker 112, all lending and borrowing of digital items may be mediated by communications going through the lending broker 112. In other implementations in which the lending broker 112 is not part of the architecture 100, the lender device 104 and other user devices connected to the network 110 may manage lending and borrowing of digital items through a peer-to-peer arrangement. Other implementations in which various components of the lending system 108 are distributed across the lender device 104, the lending broker 112, and other user devices are also possible.
Other users connected to the network 110 may include multiple borrowers 114. The architecture 100 may include 1-N borrowers shown here as borrower 114(1), borrower 114(2), and borrower 114(N). Each of the borrowers may interact with a borrower device 116 for consuming and borrowing the digital items 106 lent by the lender 102. Any number of electronic devices may be used as the borrower devices 116. In some cases, as illustrated here, the borrower devices 116 may be different than the lender's device 104. Representative borrower devices 116 are illustrated as including another version of a dedicated eBook reader device 116(1), a notebook computing device 116(2), and a portable multi-function communication device 116(N). The notebook computing device 116(2) and the portable multi-function communication device 116(N) are implemented with a reader application to render eBooks, and audio player to play music or sound files, a video player to reproduce movies or videos, or other specialized applications to consume the digital items 106 borrowed from the lender 102.
Although three representative devices are shown, many other devices may be used, including desktop computers, tablets, PDAs, portable media players, entertainment devices, netbooks, gaming consoles, DVD players, media centers and the like. In some cases, the borrower devices 116 are capable of allowing the borrowers 114 to access the lending broker 112 over the network 110, browse various item titles, download samples, order items, receive lent items, authorize payment for items being purchased, and the like. In this manner, the lending system 108 accessed either locally or remotely facilitates purchase, lending and/or borrowing of eBooks and other digital items for the various devices 104 and 116.
All users in this architecture 100 may be both borrowers and lenders. The lender 102 may borrow digital items 106 from one of the borrowers 114 or from another source. The borrowers 114 may also lend digital items 106 to the lender 102 or to another borrower 114. For example, the multiple digital items 106 accessible by the lender 102 via the lender device 104 may include both items that the lender 102 owns, items that the lender 102 is currently borrowing from another, and items that the lender 102 has loaned out to one of the borrowers 114.
The various lending and borrowing transactions between the lender 102, the borrowers 114, and other users not shown here creates a network of relationships and interconnections with each digital item lent. These relationships may be overlaid on network or relationship map established as part of a social network (e.g., links to “friends,” users that are “followed” by other users, and the like) and/or the lending and borrowing by itself may connect users in a social network.
Illustrative Social Network
FIG. 2 shows a social network 200 of multiple users that may lend and/or borrow digital items from one another. The social network 200 may include the lender 102 shown in FIG. 1 and the multiple other users indicated as borrowers 114(1)-114(N). Although, this view of the social network 200 is centered around the lender 102 and is discussed in terms of the lender 102 lending a digital item to another user in the social network 200, any of the users may be a lender and/or borrower.
In a generalized configuration, the social network 200 comprises nodes (e.g., the lenders and borrowers) and edges between the nodes (e.g., relationships). The edges between the nodes (i.e., the connections between the lender and borrowers) may be directional. Some of the edges may be two-way and some may be one-way.
An example of a two-way edge or relationship may be a “friend” relationship between the lender 102 and the borrower 114(2). An example of a one-way edge or relationship may be a “follower” relationship such as shown between the lender 102 and borrower 114(1). The one-way relationship may indicate that information flows only one way. For example, the lender 102 and borrower 114(4) may receive information from the borrower 114(1) such as lists of digital items consumed or recommended, but the borrower 114(1) may not receive similar information from the lender 102 and the borrower 114(4). Thus, the social network 200 may be formed by a plurality of two-way “friend” relationships and/or one-way “follower” relationships between members of the social network 200. A two-way relationship may also be created by two one-way relationships. For example, borrower 114(4) following borrower 114(3) and conversely borrower 114(3) following borrower 114(4) may create a two-way relationship as shown in the social network 200.
Relationships between the lender 102 and the borrowers 114 in the social network 200 may also be characterized by levels of proximity or separation between the lender 102 and the borrowers 114. Here, users directly connected to the lender 102 (i.e., connected by an edge without an intervening node) are indicated as having primary connections (1′). Users that are connected to a user having a primary connection to the lender 102 are designated as having secondary (2′) connections that may be thought of as having a distance of 2. When a user is connected to the lender 102 over multiple paths (e.g., borrower 114(3)) the degree of separation may be determined by the shortest path. Users connected to another user having a secondary connection to the lender 102 have tertiary (3′) relationships, with a distance of 3, to the lender 102. Although only three levels of relationships are shown for the sake of simplicity, the social network 200 may include any number of relationship levels.
The degree of connectedness between the lender 102 and one of the borrowers 114 may be used by the lender 102 or by the lending system 108 to choose who receives the loan of a digital item. The degree of connectedness between the lender 102 and one of the borrowers 114 may be determined by the level of proximity or separation and by a directionality of the connection. A two-way relationship may be interpreted as a stronger relationship than a one-way relationship.
In one implementation, the lender 102 may decide that he or she only wishes to lend to immediate friends and therefore limits the potential recipients of a digital item to only those users who have a primary relationship in the social network 200. Alternatively, the lending system 108 may desire to push the lender 102 to expand his or her pool of lending/borrowing partners, and thus, suggest lending a digital item to a borrower 114 that does not have any connected to the lender 102. These “unconnected” borrowers 114 may be part of the same social network 200, but not connected to the lender 102. Alternatively, users that have only an attenuated connection to the lender 102, such as ten degrees or more removed, may be considered “unconnected” to the lender 102.
As discussed earlier, the connections or relationships between the lender 102 and the borrowers 114 in the social network 200 may be preexisting and independent of any lending of digital items. Friends, followers, and the like may be established through a social networking website or other system. The social network 200 relationships may be correlated with digital item lending through usernames, email addresses, etc.
In some implementations, the lending and borrowing activity itself may create the social network 200. For example a social networking module 202 may connect two users in the social network 200 when one lends a digital item to another. Connections may also be formed by borrowing. For example, the connection 204 may be generated by the social networking module 202 in response to the lender 102 lending an eBook to the borrower 114(7). This connection 204 is shown as a two-way connection and that may imply that the borrower 114(7) has also lent an eBook, or other digital item, to the lender 102.
Different subsets of users within the social network 200 may be defined by a shared characteristic. For example, users closest to the lender 102 in the social network 200 may include all those users having a primary connection such as borrowers 114(1), 114(2), and 114(7). Conversely, users that are farthest away from the lender 102 may comprise another subset. In this example that would include the unconnected borrowers 114(6), 114(8), and 114(N). Other types of subsets may include user with a high centrality in the social network 200 (i.e., connected to a large number of other users). Interaction with users having a high centrality may be useful for rapidly spreading information, loaned digital items, advertisements, etc., throughout the social network 200. For example, borrower 114(4) with direct connections to four other users has the highest centrality in the illustrative social network 200. A level of centrality may be represented as a number of primary connections to that user. Additionally, follower/followed relationships may define a subset of users. Thus, the followers of borrower 114(1) (e.g., lender 102 and borrower 114(4)) may be a subset of users
Illustrative Lending and Borrowing
FIG. 3 shows a lending and borrowing history 300 associated with a particular user and representation of a lending metric for that user based upon the lending and borrowing history 300. The lending and borrowing history 300 is shown in FIG. 3 as a table with rows representing lending or borrowing transactions of a digital item and columns representing characteristics associated with or derived from those transactions. However, this is merely an illustrative data structure and any other technique for storing or organizing similar data is also possible.
Each digital item may be identified by an item number 302 or other type of unique identifier. Digital items such as eBooks may be identified by an international standard book number (ISBN). A transaction type 304 of either lending or borrowing is associated with each entry in the lending and borrowing history 300. The other party 306 to the transaction (i.e., the user that borrows the digital item or the user that lends the digital item) is recorded as a user name or other identifier. Tracking of the other party 306 to lending and borrowing transactions can reveal patterns and relationships such as frequent lending and borrowing between two users. It can also be analyzed to determine a number of unique recipients (i.e., different users) for loans originating from a user.
Information about the digital item itself may be contained in the lending and borrowing history 300. This information may include a price 308, a release date 310, a rank 312 either through user popularity, reviews, and the like, and a level of demand 314. The demand 314 may be determined based on how many users wish to borrow this digital item and how many copies are available to lend.
Each transaction in the lending and borrowing history 300 may also indicate whether or not the digital item was consumed or not by a lender at the time the digital item was loaned. When a lender purchases a digital item and lends it to another before he has consumed it himself, that loan may be assigned a greater value or significance than the loan of a digital item that the lender has already consumed. In the borrowing history 300, transaction records for the digital item 322 show “no” in the consumed 316 column indicating that the other party 306 (i.e., JONESVA) lent this item before consuming it herself. Consumption may be detected by the lender device 104 or other device for consuming digital items.
Ultimately, each borrowing or lending transaction may be assigned a lending metric value 318. The lending metric may represent the net effect of lending or borrowing on the community of users able to lend and borrow digital items. Contributions to the community or activities that generally increase the flow of loaned digital items may be associated with a positive number. Gifting a digital item to another user, as opposed to merely lending, is one example of an activity that contributes to the flow of digital items between users. Giving a digital item as a gift may earn the “gifter” a larger increase in his or her lending metric that lending that same digital item. Other activities that detract or consume digital items that are available to be loaned may be represented as a negative number. In a basic example, lending a digital item may be associated with +1 lending metric and borrowing may be associated with −1.
Thus, the lending metric may be thought of as a type of “goodwill” or positive “karma” that is increased by lending and decreased by borrowing. This metric may serve many purposes within a lending/barring community such as the social network 200 shown in FIG. 2. For example, a user may be incentivized to lend more by a desire to obtain a higher lending metric. Additionally, various rewards or benefits may be provided to those with high lending metrics. Those users that primarily borrow without lending (e.g., “leeches”) may also be readily identified by their lending metric.
In this example, the first transaction 320 is the loan of a digital item with the item number 23R90. This may represent one of the digital items 106 shown in FIG. 1. The net change to the lending metric value 318 for this transaction is +3. Although lending one digital item may be assigned a default value of +1, various characteristics associated with the digital item or the circumstances of the loan may modify the lending metric value 318. Here, the lending metric value 318 may be increased from +1 to +3 in part because of the recent release date 310, in part because of the relatively high rank 312, and in part because this digital item is experiencing the highest level of demand 314. For example, the digital item 23R90 may be a new and popular novel released as an eBook.
The second transaction 322 shown in the lending and borrowing history 300 represents borrowing a digital item. This item is notable for its relatively high price 308 and high demand 314. Also, the other party 306 loaning this item, noted here as JONESVA, has not yet consumed 316 this digital item. For example, this digital item may be a collection of movies. For this transaction, the net change to the lending metric value 318 for the user is −2. The baseline change of −1 is increased, made more negative, due in part to the high price 308, and in part to the high demand 314. The lending metric value 318 may also be changed more because the lender has not yet viewed the movie collection as represented by the “no” in the consumed column 316.
The next transaction 324 represents the loan of a digital item to the other party 306 TSMITH that also received a loan of a digital item in transaction 320. Since this loan is not to a unique recipient, the amount the lending metric value 318 is increased may be less than +1 shown here as an increase of only +0.9. Those the modification of the lending metric may be bias to encourage lending to many different borrowers.
The final transaction 326 shown in this illustrative lending and borrowing history 300 represents borrowing a digital item that the lender (i.e., KAREN) obtained for free. For example, this may be a digital version of an older magazine that is now available in the public domain. Alternatively, the free item may be something that other users pay for, but the user KAREN obtained for free such as a promotional copy. The loan of a free item may be considered a less valuable transaction than the loan of an expensive item, particularly an expensive digital item that may only be loaned a limited number of times. Thus, in some implementations, transactions involving free items may be excluded from determining a number of loaned and borrow digital items, and thus, assigned a lending metric value 318 of zero. The lending metric value 318 for this transaction is shown as −0, wherein the negative may show that this is a borrowing transaction and differentiate it from +0 associated with lending a free digital item. Although only a few examples are provided herein, any combination of weighting and consideration of the various transaction characteristics 302-316 may be used to derive a lending metric value 318 for a given transaction.
The totality or summation of the lending metric values 318 from the purchase and lending history of a given user may be represented as a single current lending metric 328. Here, the current lending metric 328 is shown as associated with the lender 102. One technique for calculating the lending metric 328 associated with a user (as opposed to the lending metric value 318 associated with a transaction) is the difference between the number of digital items lent by the user minus the number items borrowed by the user. Thus, the user that lent 4 items and borrowed 2 items would have a lending metric 328 of 2. Similarly, lending 102 items and borrowing 100 items would also result in a lending metric of 2.
As evidence from the above example, giving lending and borrowing equal weight may lead to the same lending metric 328 for frequent lenders and borrowers as well as for infrequent lenders and borrowers. To promote and to recognize high levels of participation in a lending and borrowing community the amount the lending metric decreases when a digital item is borrowed may be less than the amount the lending metric increases when a digital item is lent. Lending may be “rewarded” more than borrowing is “penalized.” For example, lending one eBook may lead to an increase of +1 in a user's lending metric 328, but borrowing one eBook may decrease the user's lending metric 328 by only −0.9. Thus, the user that has lent 4 items and borrowed 2 items would have a lending metric 328 of 2.2. However, the user that lent 102 items and borrowed 100 items would have a lending metric of 12. With the differential weighting of lending and borrowing it is not only the net difference between loans and borrows but also the total number that determines a user's current lending metric 328.
The current lending metric 328 associated with a user such as the lender 102 in this example, may be shown only to the lender 102 or it may be presented to other users in a profile of the lender 102. By exposing the current lending metric 328 to others, peer pressure may provide an additional incentive to lend digital items. In some implementations, the lender's 102 lending metric 328 may be shown only to other users connected to the lender 102 in a social network and not shown to users that are not connected to the lender through the social network. For example, in the social network 200 shown in FIG. 2, each of the borrowers 114(1)-(5) and 114(7) that are connected to the lender 102 are able to view the lender's 102 lending metric 328, but the borrowers 114(6), 114(8), and 114(N) are not able to view the lending metric 328. Different levels of privacy and public dissemination of a lending metric are also possible.
Presentation of the current lending metric 328 may also include presenting the number of digital items lent by the user and the number of the items borrowed by the user in addition to the net lending metric 328. For example, the lending and borrowing history 300 with the weighted lending metric values 318 results in a net lending metric 328 of 1.9. When displayed to the lender 102 or other users the current lending metric 328 may also show that 2 digital items were loaned and 2 digital items were borrowed.
Presentation of the lending metric 328 may also include presentation of a non-numeric representation 330 of the lending metric 328. Here, a plus sign is shown as the non-numerical representation 330 of the lending metric 328. Both the calculation of a current lending metric 328 and options for display or presentation of that lending metric 328 may be implemented by a lending metric module 332 that is part of the lending system 108 shown in FIG. 1.
The non-numerical representation of the lending metric 328 may take any form such as a badge or icon associated with a user profile. In some user interfaces, the non-numerical representation 330 may be a sound. The non-numerical representation 330 may be based on the numerical value of the lending metric 328. For example, table 334 shows correspondence between icons and corresponding numerical values for lending metrics. Lending metrics 328 of 10 or greater may be indicated by a star 336. Lending metrics greater 328 more than 0 and less than 10 may be represented by a plus sign 338. Lending metrics 328 less than or equal to 0 may be represented by a triangle 340.
FIG. 4 shows illustrates the loan of a copy of a digital item 400 from the lender device 104 to the borrower device 116. Before the loan 402 at a time point T1 a first copy of the digital item 400(1) is present on the lending device 104. During the loan 404 at time point T2 the digital item 400(1) is present on the borrower device 116. After the loan 406 at time point T3 the digital item 400(1) is again available for consumption on the lender device 104.
Transfer of data representing the digital item 400(1) itself, or of rights to access this copy of the digital item 400(1), is represented by arrows 408 and 410. Transfer of the digital item 400(1) and mediation of the terms of the loan may be managed by a lending module 412 found in the lending system 108.
During the loan 404 at time point T2 the copy of the digital item 400(1) may remain on local memory of lender device 104, but be deactivated so that the lender 102 is prevented from consuming this copy of the digital item 400(1) during the duration of the loan to the borrower 114. Alternatively, the transfer represented by arrow 408 may delete the digital item 400(1) from the lender device 104. Thus, in some implementations, the lender 102 may not be able to access the digital items that are being loaned out. In other implementations, the lender 102 may retain limited or unlimited rights to access the digital items while they are being loaned.
Return of the copy of the digital item 400(1) to the lender device 104 may be implemented by transferring data corresponding to the copy of the digital item 400(1) back to the lender device 104 as shown by arrow 410. Alternatively, the inactivated copy at T2 404 may be reactivated. In some implementations a deactivated or inaccessible copy of the digital item 400(1) may remain on the borrower device 116. Thus, when the borrower 114 later purchases his own copy of the digital item 400, access may be quick without any download latency because only an access code, DRM token, or the like needs to be transferred to the borrower device 116.
Digital items, unlike tangible items such as paperback books, may only be eligible for lending a limited number of times. Some digital items may be lendable only once ever. Borrowing may also be restricted, for example a given user may only be able to borrow a digital item once from any source and then is prevented from borrowing that same digital item in the future. Other digital items may be able to be loaned or borrowed more than once or even an unlimited number of times. The number of times the digital item can be loaned or borrowed may be enforced by the lending module 412 through the use of DRM or similar technology to prevent copying or transfer of data from one device to another. The owner of a particular copy of a digital item may choose to limit the number of times that the digital item may be lent.
The limited number of times that he digital item can be lent or borrowed may also be specified by an entity having rights in the digital item. This “rights holders” may include at least an author and/or a publisher. In general, a rights holder may be any person or entity that holds or has rights to reproduce, distribute, import, export, create derivatives, perform or display publicly, sell or transmit the content. In some instances, there may be more than one rights holder for the content (e.g., a publisher may have rights to distribute the content in certain countries, while the author retains the rights to distribute the content in other countries; or publisher A may have the rights to distribute a book in printed form and publisher B may have the rights to distribute a book in eBook form). Examples of rights holders for various types of digital content include, but are not limited to, authors, publishers, music labels, movie studios, artists, songwriters, performers, heirs, and delegates.
The ability of a rights holder to specify a number of times that a digital item can be lent may lead to different pricing for copies of a digital item depending on how many “loans” are purchased with the digital item. For example one copy of the digital item 400 owned by the lender 102, copy 400(1), may have been purchased for $12.95 and be able to be loaned once. However, another copy of the same digital item 400 owned by user 410 and stored on user device 412, copy 400(2), may have been purchased for a lower price of $9.99, but not include the ability to loan this copy 400(2). While every copy of digital item 400 may be the same in that each contains the same content (e.g., same text, same audio, same video, etc.) each copy is also distinct in that some copies may be lendable while others may not.
Thus, the ability to loan a digital item and being granted permission to borrow a digital item may be valuable commodities that can be brokered in a marketplace and even monetized. For example, the value of borrowing a copy of digital item 400 may be based the on difference in prices of a lendable, 400(1) for $12.95, and non-lendable, 400(2) for $9.99, versions of the digital item 400.
In some scenarios, the lender 102 may loan digital item 400(1) for either a finite period or unlimited time to the borrower 114. When initiating a loan of the digital item 400(1) the lender 102 may interact with a user interface (UI) on the lender device 104. The lending UI may include an entry box in which the lender 200 may enter an identity of the party to whom the digital item 400(1) is being loaned (e.g., borrower 114). The lending recipient may be identified by an email address, although other conventions may be employed (e.g., person's name, account number, personal identifiers, etc.). The UI may also include options for specifying a duration of the loan. The options may permit selection of a finite period such as a number of days to loan the item, or an indefinite period. Other options may be presented, as well as other duration units (e.g., hours, weeks, months, etc.). Upon expiration of the predetermined loan, the lending module 412 may automatically prevent the borrower 114 from accessing the digital item 400(1) on the borrower device 116. Thus, unlike a conventional book there is no need to repeatedly ask a friend to return a loaned eBook. In some implementations, the borrower 114 may receive a warning indication when the end of the loan period is drawing near.
Illustrative Lists of Digital Items
FIG. 5 shows multiple lists 500 of digital items associated with different lenders and borrowers. The lender 102 is associated with a list of digital items that he or she owns 502, a list of digital items that he or she hopes to borrow 504 and a wish list 506 of digital items that he or she hopes to purchase or perhaps receive as gifts. Other users shown here as the borrower 114(1) and the borrower 114(N) may also be associated with their respective lists.
The list 502 of digital items owned by the lender 102 includes two eBooks, two songs, and one movie. Digital items may be stored on the lender device 104 or stored elsewhere such as in the “cloud” and accessible by the lender device 104. Each of the digital items may be lendable as indicated by an “x” next to the name of the digital item. For example, eBook 1, eBook 2, and song 2 are all lendable.
The second list 504 of the items that the lender 102 hopes to borrow includes items that are desirable enough to the lender 102 he or she wishes to borrow them but they are not digital items that lender 102 necessarily wishes to purchase or own. This illustrative list 504 includes two eBooks, two movies, and one magazine.
The third list 506 shown here is a wish list of digital items that the lender 102 wishes to purchase or otherwise own. The wish list 506 includes one movie, one eBook, and three songs. Analysis of the digital items included in these lists may provide inside them to the tastes and consumption patterns of the lender 102. The lists of items that are owned 502 and of items that the lender 102 hopes to borrow 504 may also facilitate matching lenders and borrowers with one another.
The borrower 114(1) also has associated lists of owned digital items 508, lists of digital items he or she hopes to borrow 510, and a wish list 512. Inclusion of a digital item such as eBook 1 into the hope to borrow list 510 may allow the lending system 108 to infer that the borrower 114(1) is requesting a loan of eBook 1. Fortunately for the borrower 114(1), the lender 102 has a lendable copy of eBook 1.
The borrower 114(1) also has a lendable copy of eBook 22 which the lender 102 hopes to borrow. Therefore, these two users may loan the respective digital items to one another. By trading “loans” users may be incentivized to lend a digital item because that allows borrowing of a desired digital item.
An additional user, borrower 114(N) also has associated lists of owned digital items 514, digital items that he or she hopes to borrow 516, and a wish list 518. The list of items owned 528 by borrower 114(N) includes a lendable copy of song 1. This is different from the copy of song 1 owned by the lender 102 because the copy owned by the borrower 114(N) still has the ability to be loaned to another. Thus, the borrower 114(1) may differentiate between the lender 102 and the borrow 114(N) because, although both own a copy of song 1, only the borrower 114(N) is able to lend that song.
If there are multiple other users for which a single item match exists (e.g. loan of one item in return for being allowed to borrow one item) the lending system 108 may select a lending or exchange partner based on the ability to exchange a third digital item for a fourth digital item. For example, the lender 102 owns lendable copies of eBook 2 and song 2 which are both included in the hope to borrow list 516 of the borrower 114(N). Borrower 114(N) in turn owns lendable copies of eBook 7 and eBook 22 which the lender 102 hopes to borrow. Although all four of the digital items need not be exchanged at one time, the ability to make further matches in the future makes a borrower 114(N) a more attractive exchange partner for lender 102 than borrower 114(1).
Although the wish lists 506, 512, and 518 contain digital items that the respective users hope to purchase, inclusion of an item in one of the wish lists 506, 512, and 518 may be interpreted as an indication that the user desires to borrow the digital item. For example, inclusion of magazine 7 in the wish list 518 of borrower 114(N) may lead to lending of a copy of magazine 7 owned by borrower 114(1) to borrower 114(N).
Similarity of consumption patterns between two different users may suggest that those two users could be lending/borrowing partners in the future. Users with similar tastes and consumption patterns of digital items may be more likely to own, or later obtain, a digital item one of the other users hopes to borrow. For example, comparison of the similarity of digital items in the hope to borrow list 504 of the lender 102 with the hope to borrow lists 510 and 516 may show greater similarity between the lender 102 and borrower 114(1) because both users include eBook 7 in their respective hope to borrow lists 504 and 510.
Illustrative Lending System
FIG. 6 shows selected modules in a representative computing device 600 that may be used to functionally support practices of lending and borrowing digital items, as described above with respect to FIGS. 1-5. The computing device 600 may represent any of the lender device 104, the lending broker 112, and/or the borrower device 116 shown in architecture 100. In a basic configuration, the computing device 600 includes a processing unit 602 and a memory 604.
The memory 604 is an example of a computer-readable storage medium and may include volatile and nonvolatile memory and/or removable and non-removable media implemented in any type or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data. Such memory includes, but is not limited to, RAM, ROM, EEPROM, flash memory, CD-ROM, digital versatile disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, RAID storage systems or any other tangible medium which can be used to store the desired information and which can be accessed by a computing device. The memory 604 may store an operating system 606 and the lending system 108 introduced in FIG. 1.
The computing device 600 may also include one or more communication interfaces 608 to facilitate communication with external, remote computing sources over various networks such as network 110 or with other local devices. The communication interface(s) 608 support both wired and wireless connection to various networks, such as cellular networks, radio, Wi-Fi networks, short range networks (e.g., Bluetooth), infrared (IR), and so forth. The communication interface(s) 222 are one example of communication media. Communication media may typically be embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism. Communication media is to be distinguished from computer-readable storage media.
The computing device 600 may further be equipped with various input/output (I/O) components 610. Such components may include various user interface controls (e.g., touch screen(s), buttons, joystick, keyboard, etc.), a display, audio speaker, a microphone or audio input, connection ports, and the like.
The lending system 108 stored in the memory 604 includes one or more modules that are executable by the processing unit 602 to facilitate various aspects of lending digital items to other users. Components and modules of the lending system 108 may be located all on a single device or spread across multiple devices such as the lender device 104, the lending broker 112, and one or more borrower devices 116.
A request module 612 in the lending system 108 receives a request from a user to borrow a digital item. The request may be an explicit indication by the user (e.g., checking a “lend to me” box next to the title of a digital item) or an implicit indication inferred by the request module 612. For example, the request may be inferred by the request module 612 when the user includes the digital item in a list of multiple digital items such as a hope-to-own list or a wish list like those shown in FIG. 5.
As well as soliciting digital items to be loaned, the lending system 108 may also support solicitation of borrowers for a digital item with an offer module 614. The offer module 614 may generate an offer to lend a digital item. The offer may be available only for a limited time, and thus, the offer may include a time period for indicating acceptance of the offer. The offer module 614 also sends the offer to a plurality of potential borrowers. The time period for accepting the offer may be specified by an owner of the digital item to wishes to lend. For example, an owner of digital item may request responses from other users interested in borrowing the digital item during a one hour or one day window of time.
The offer may be sent only to potential borrowers that the owner of the digital item explicitly designates. For example these potential borrowers may be friends of the owner of the digital item connected through a social network such as shown in FIG. 2. The offer itself may be sent by e-mail or any other communication means including being sent through communication channels established in the social network.
A matching module 616 in the lending system 108 may assist a first user to find a second user who wishes to borrow something from the first user and you have something that the first user wishes to borrow in return. The matching module 616 a function by receiving an indication from a user of a first digital item that the user desires to borrow and one or more second digital items to lend. Based on this information, the matching module 616 may identify matching users that have the first digital item to lend and a desire to borrow one of the one or more second digital items.
In some situations there may be more users that desire to borrow a particular digital item than there are copies of that digital item to lend. In such situations, the lending system 108 may use a queuing module 618 to maintain a waiting list for loaned copies of the digital item. The queuing module 618 may place a request received from the request module 612 into a queue to receive a loan of the requested digital item. A default behavior of the queuing module 618 may be first-in-first-out so that users in a queue receive a loan of the digital item in the order that each user entered the queue.
The queuing module 618 may also prevent certain users from even obtaining a place in the queue. For example, a user that has a lending metric less than a threshold level may be prevented from placing a request in the queue. A lending metric requirement to enter a queue for popular digital items may serve as an additional incentive to lend rather than only borrow digital items. The queuing module 618 may also modify the position of in the queue of a request from a user based on the lending metric associated with that user. This may allow users with a higher lending metric to move up the queue faster and it may also keep lenders with a lower lending metric towards the bottom of the queue. In some implementations, when the user has a lending metric that is more than a threshold level the request from the user may move to the top the queue and the user will become the next person to receive a loan of the digital item. This type of priority treatment may be a kind of reward for those users that contribute by lending a high number of digital items to other users.
In addition or instead of placing all of the potential borrowers in a queue, all possible recipients for the loan of a digital item may be filtered based on some number of characteristics to reduce the number of users competing to borrow the digital item. This filtering may be implemented by a filtering module 620. For example, when there are multiple users that have items to lend as well as items that each desires to borrow, represented here by the lists shown in FIG. 5, there may be multiple matches between the user pairs. The filtering module 620 may assist the users in deciding who to “pair up” with by identifying one of the multiple users that has matching lending and borrowing desires as an exchange partner based on characteristics of each of the matching users.
The characteristics may be specified by the user, or lender, that initiates a search for an exchange partner or by the lending system 108. When the lending and borrowing occurs between users that are members of a social network, the proximity of the user and the matching users in the social network may be used to identify exchange partners. For example, matching users having a closer proximity in the social network may be preferred exchange partners over those with a more distant relationship. From the perspective of the lender 102 as shown in FIG. 2, one of the borrowers with a primary connection may be a preferred exchange partner rather than one of the borrowers at a secondary, tertiary, or greater level of distance from the lender 102. Conversely, the lending system 108 may be biased to introduce users to others that are outside of the immediate social group and thus prefer making matches with other users whose proximity in the social network is low.
Other characteristics besides social network distance such as actual geographic distance between the users may be considered when the filtering module 620 assists in making a match. For example, data associated with the users such as an address may be stored as part of a user profile. All of the actual addresses may not be revealed to other users, geographic proximity may be used if one of the users wants to exchange digital items with another user of the lending system 108 who happens to live in the same city, state, country, etc.
The filtering module 620 may also filter potential matches or exchange partners for loans of digital items based on lending metrics associated with each of the matching users. This filtering may be initiated by the first user seeking an exchange partner but desiring to avoid loaning to someone who primarily borrows and has a low lending metric. Similarly, the lending system 108 operating automatically to filter possible matching users, may select the user with the highest lending metric out of two users that are equally good matches based on other characteristics. Thus, this may be another way to incentivize and reward behavior that leads to an increase in a lending metric.
Additionally, a selection module 622 may function similar to the filtering module 620 in that both modules assists in selecting one user from a plurality of potential borrowers. The selection module 622 determines characteristics associated with each of the plurality of potential borrowers that respond to an offer to lend a digital item. If the offer is time-limited (e.g., only responses received within the first hour are considered) only potential borrowers that respond during the time period are considered and those who responded late may be ignored or informed that the period for responding has ended. Once characteristics have been determined for each of the timely responders, the selection module 622 may select one of the potential borrowers to lend the digital item based on the characteristics of each of the potential borrowers.
The characteristics considered by the selection module 622 may be the same or similar to the characteristics considered by the filtering module 620. For example, the characteristics may include a lending metric of the potential borrowers, a degree of association with the owner of the digital item in a social network, a geographic distance, and the like. Any characteristic or combination of characteristics that are discernible from a user profile may be used such as age, gender, number of digital items owned, type of device on which digital items are consumed, etc.
After a “best” potential recipient for the loan of a digital item has been identified by one of the techniques above, the loan may be implemented automatically or the option to loan to this “best” recipient may be presented as a recommended option to the lender. The recommendation may be generated and delivered by a recommendation module 624. The recommendation may consist of a message (e.g., text, pop-up window, etc.) that, for example, suggests lending eBook 22 to user TSMITH. The recommendation module 624 may also generate a user interface that allows for acceptance and implementation of the recommended loan.
In situations of matching loans, where the loan of one digital item is reciprocated by being lent a different digital item, the recommendation module 624 may generate a recommendation to borrow the first digital item from the identified exchange partner and lend the digital item desired by the exchange partner to that exchange partner. The recommendation module 624 may also provide multiple options. For example, the lender 102 as shown in FIG. 5 may be given the options of lending eBook 1 to borrower 114(1) and receiving a loan of eBook 22 or lending eBook 2 to borrower 114(N) and receiving eBook 7 in return.
The actual transfer of data from one device to another or transfer of rights to access a digital item is implemented by a lending module 412. The lending module 412 facilitates lending a digital item to a selected one of a plurality of potential borrowers. When a user loans a digital item, the lending module 412 collects data pertaining to the transaction. The data includes an identity and metadata of the digital item, identities of the lender and recipient, identities of the electronic devices used by the lender and recipient, and duration of the loan.
The lending module 412 may also play a role in establishing and/or enforcing digital rights management. For instance, lending module 412 may dictate and enforce what access rights the lender retains for the digital item that is on loan to another user. In one implementation, the digital item may be temporarily removed from the lender device 104 and transferred to the borrower device 116 or alternatively transferred to the lending broker 112. In another implementation, the digital item may be retained on the lender device 104, but disabled from use. In still other implementations, the digital item may be fully or partially accessible to the lender 102 even while it is on loan.
If the user hoping to borrow a digital item has been waiting in a queue, the lending module 412 may provide the user with access to the digital item when the request from the user reaches the top of the queue. Also, for lending/borrowing transactions that are an exchange between two users, the lending module 412 facilitates lending the first digital item from the exchange partner to the user and lending the desired one of the second digital items from the user to the exchange partner.
User is waiting in a queue to borrow a digital item may also wish to know their position in the queue and approximate length of the wait. This information may be provided by a notification module 626 that notifies users of the position of their loan request in the queue and of a number of other user requests in front of them in the queue. The position in the queue may be based on the number of users waiting to borrow a particular digital item and the number of lendable copies of the digital item that are available. For example, dividing the number of requests in the queue by the number of lendable copies may determine an effective queue position. Thus, being 100th in a queue to borrow one of 10 copies may be the same as being 10th in a queue to borrow digital item for which only a single copy is available.
The notification module 626 may also estimate an amount of time until the request from the user reaches the top of the queue. This estimate may be based upon average times it takes a user in general to consume the digital item and/or more specific information about consumption speeds of the users earlier in the queue. The time estimate may be more relevant than a number of users earlier in the queue. For example, having a request that is 50th in line to listen to a three-minute-long song may actually be a shorter wait than being 2nd in line to borrow a two-hundred page eBook.
The estimated amount of waiting time may also be based on the actual progress of the user or users consuming the digital item. For example, if the digital item is an eBook, then the estimated wait time for users in the queue may decrease as the current borrower gets closer to the end of the eBook.
Users consuming a borrowed digital item, whether additional users are waiting in a queue for the same item or not, may be allowed to borrow that digital item only for a limited amount of time. This time limitation may be similar to the limits imposed by a library lending conventional books or a video shop lending movies.
A timing module 628 may assist in monitoring and regulating the creation that a borrower has access to a loaned digital item. The timing module 628 may also determine a consumption rate of the digital item based on the rate that the user has consumed to the digital item thus far. For example, if the user has read 100 pages of an eBook in four days, the consumption rate is 25 pages per day. The consumption rate may also be based on the users past consumption rate for different but similar digital items. For example, the timing module 628 may have previously determined that the user typically reads textbooks at the rate of 10 pages per day.
The timing module 628 may also include forecasting features that can determine if the user is likely to consume the entire digital item before expiration of the predetermined time period for the loan. Based on the amount of the digital item remaining, the amount of the loan period remaining, and the user's consumption rate, the timing module 628 may predict the likelihood that the user will finish the digital item in time. If it appears likely that the user will not finish the digital item during the duration of the loan, the timing module 628 may generate a warning or other type of indication for the user indicating that the user will probably not consume the entire digital item before expiration of the predetermined time period.
This indication may include notification of a consumption speed that is sufficient to consume the entire digital item before expiration of the predetermined time period. For example, the timing module 628 may divide the quantity of the digital item remaining to be consumed (e.g., pages of an eBook yet to be read) by the number of days left in the loan period to derive a recommended consumption speed (e.g., pages per day). The possibility that a user may be in the middle of a digital item when his or her access to the item expires also presents a marketing opportunity. Thus, the indication generated by the timing module 628 may additionally include an offer to buy a copy of the digital item and possibly present a convenient UI for consummating the purchase. In some implementations, the indication which includes an offer to buy the digital item may further include a discount or coupon that allows the borrower to purchase the digital item at a reduced price.
The changes to lending metrics associated with lenders and borrowers of digital items are tracked and modified by a lending metrics module 332. As explained above, the lending metrics module 332 increases the lending metric associated with a user when the user lends a digital item to another and decreases the lending metric associated with the user when the user receives access to a borrowed digital item. The amount of increase or decrease may depend on any one or combination of characteristics of the digital item. For example, the price, rank, rating, and level of demand associated with a digital item made all effect the change in lending metric that accompanies borrowing or lending that item. Generally, more expensive, more desirable, higher ranked, and digital items for which is a greater demand are associated with a greater change in lending metric. In other words, a user can get more good “karma” for lending something expensive that other users really want.
Also, as discussed above, lending or borrowing of free items may be excluded from calculations of a lending metric. Repeated lending to the same recipient may provide decreasing benefits to a user's lending metric. Doing so might encourage users to lend digital items not only to their close friends or family members, but to other users in the larger community of digital item consumers.
The use of a lending metric introduces an element of fairness or equity into the relationship between lenders and borrowers of digital items. Users may become frustrated with the lending system 108 if those that consume without contributing can reap all of the same benefits as those that frequently place digital items into the community by lending.
A handicapping module 630 may also serve to increase the perception of fairness or equity and a lender offers multiple social borrowers the chance to borrow a digital item by effectively leveling the playing field between respondents to the offer. Recall that the offer module 614 may generate an offer to loan a digital item to the first user that responds. Thus, someone who spends a lot of time in front of his or her consumption device may be the first person to notice such an offer and be able to borrow the digital item because he or she responded first. It may be perceived as unfair by other users if one or only a few users that are frequently quick to reply are the only users who receive the loan of a digital item through the first-to-reply mechanism initiated by the offer module 614.
In order to increase fairness and level the playing field, the handicapping module 630 may make it more difficult for these “frequent winners” to be counted as the first to respond to an offer. For example, if a digital item is lent to the first potential borrower to respond to an offer, the time of the response may be the deciding criterion. Typically, the time may be determined by a clock on one of the relevant computing devices. However, the true time may be modified by the handicapping module 630 based on a number of times that a potential borrower was previously the first one to respond to an offer. Of course the earlier offers were likely for different digital items, but the consideration may be a desire to provide users who do not spend all day with their eyes glued to a monitor a chance to be effectively considered the “first” to respond to an offer to lend. Thus, every time a user is the first one to respond to an offer, his or her subsequent response times for later offers may be delayed by some period of time. For example, each time a potential borrower is first to respond that adds one minute to any subsequent response times. After being first three times, all subsequent responses are effectively delayed three minutes. Other relationships between a number of times “being first” and magnitude of delay are also possible.
Each of the users that is not selected as a recipient, either because they were not the first to respond or because they did not meet some other criteria, and thus, are not selected as the one of the plurality of potential borrowers who is allowed to borrow the digital item may receive a consolation message generated by a messaging module 632. These users have already affirmatively indicated an interest in consuming the digital item by responding to an offer to borrow that digital item, and thus, this provides a marketing opportunity.
The consolation message generated by the messaging module 632 may include an invitation to buy a copy of the digital item and provide a link, button, or other UI element that allows convenient purchase of the digital item. The consolation message may also include a discount for purchasing a copy of the digital item. Thus, in one scenario, a user may receive a link in a message sent from a friend in a social network stating “Come and get it! First one to respond can borrow my digital copy of The Red Pony” and upon following the link be presented with an offer to borrow The Red Pony if he or she was the first to respond or alternatively for everyone who was not the first, receive a consolation message providing an opportunity to purchase a copy of that eBook.
All of the marketing opportunities provided when a user is unable to borrow a digital item can potentially lead to sales of copies of that digital item. The owner of the digital item that was the genesis for one of these marketing opportunities may receive a referral fee or commission when a copy of that digital item is sold due to the owner's lending activity. The lending system 108 includes a commission module 634 that computes the referral fee to be awarded. The fee may be a monetary amount, such as a portion of the sale proceeds. The fee may alternatively be in the form of credit or discounts to future purchases made by the lender. Further, the fee may be some form of non-monetary awards, such as an increase in his or her lending or metric points that may be redeemable for various awards. For example, the commission module 634 provide the owner of a digital item a portion of a purchase price when one of the plurality of potential borrowers buys a copy of the digital item in response to the consolation message generated by the messaging module 632.
An annotation module 636 may facilitate the recording and storage of annotations made to digital items. When a digital item is annotated by the user that owns the copy of the digital item, those annotations may become part of the item and borrowers may receive the digital item together with the annotations.
However, a lender may wish to lend out his or her digital items and receive them back free from annotations made by a borrower. In one implementation, borrowers may be prevented from annotating borrowed items. However, in another implementation borrowers may be allowed to annotate digital items that they have on loan, but those annotations may be stored separately from the digital item.
The annotation module 636 may differentiate annotations made by an owner or by a borrower and store imitations made by the borrower in association with that users profile and not in association with the loaned copy of the digital item. The borrower may be able to access and review his or her annotations even after returning the digital item to the owner. Also, the annotation module 636 may automatically “re-associate” those annotations with the same or different copy of the digital item when it becomes available to the borrower. For example, if a user borrows an eBook, makes annotations, and decides that he or she likes the eBook so much that he or she wants to own a copy, those annotations may be automatically associated with the “new” eBook as soon as the borrower completes the purchase.
The lending system 108 may also include a social networking module 202. The social networking module 202 maintains a record of the relationships in a social network such as shown in FIG. 2. Furthermore, the social networking module 202 also establishes connections between users in the social network when digital items are lent and/or borrowed. For example, loaning a digital item to another user in the social network may create a one-way connection, for example, designating the recipient as a follower of the lender. If the two users are exchange partners trading “loans” of digital items, each has borrowed a digital item from the other and this transaction may create a two-way connection that can be thought of as the two exchange partners being followers of each other, mutual friends, or whatever metaphor is appropriate for the social network.
Illustrative Processes
FIG. 7 shows a process 700 of modifying a lending metric based on lending and borrowing behavior. The process 700 (as well as the processes shown in FIGS. 8-12) is illustrated as a collection of blocks in a logical flow graph, which represent a sequence of operations that can be implemented in hardware, software or a combination thereof. In the context of software, the blocks represent computer-executable instructions that, when executed by one or more processors, perform the recited operations. Generally, computer-executable instructions include routines, programs, objects, components, data structures and the like that perform particular functions or implement particular abstract data types. The order in which the operations are described is not intended to be construed as a limitation, and any number of the described blocks can be combined in any order and/or in parallel to implement the process.
The process 700 may be performed by the lending system 108 in the architecture 100 of FIG. 1. Additionally, all or part of process 700 may be performed by the lending metric module 332.
At 702, a number of digital items lent by a user is determined. The digital items may include eBooks and/or other types of digital items. In some implementations, the number is an integer number such as “10” if the user has loaned ten digital items
At 704, a number of unique recipients for the digital items lent by the user is determined. For example, a user that lends only to his or her two best friends will show only two unique recipients regardless of how many digital items he or she lends. The number of unique users may affect a lending metric associated with the user. In some implementations, more unique users may result in a higher lending metric.
At 706, a lending metric associated with the user is increased based on the number of digital items lent by the user as determined at 702. The increase in the lending metric may also be modified by characteristics associated with the digital items.
At 708, a number of digital items borrowed by the user is determined. This number may also be an integer number such as “7” if the user has borrowed seven digital items. In some implementations, the number of digital items lent and borrowed as determined at 702 and 708 may represent “global” behavior between the user and any other user. In other implementations, the digital items lent by the user and the digital items borrowed by the user are digital items lent to and borrowed from a single other user. By limiting the consideration to only transactions between two users, each of the two users can readily assess if the net balance of the relations is positive or negative in terms of access to digital items.
At 710, the lending metric is decreased based on the number of digital items borrowed by the user as determined at 708. An amount the lending metric is increased for lending a digital item is not necessarily the same as an amount the lending metric is decreased for borrowing the digital item. In some implementations, an amount the lending metric decreases when one digital item is borrowed by the user is less than an amount the lending metric increases when one digital item is lent by the user. The lending metric may be calculated as the number of digital items lent by the user minus the number of digital items borrowed by the user.
At 712, it is determined if the lending metric exceeds a threshold. In this example, lending increases the lending metric, so a user that lends more relative to borrowing is more likely to exceed the threshold. In some implementations, there may be multiple thresholds and exceeding each threshold may lead to a different result. If the lending metric of the user exceeds the threshold, process 700 may process along the “yes” branch to 714.
At 714, an award is provided to the user. The award may be monetary or non-monetary. A non-monetary award may include a discount, points, tokens, access to content such as free digital items, the ability to borrow digital items without a decrease in associated lending metric, or any other type of incentive to encourage additional lending of digital items.
Returning to 712, if the lending metric does not exceed the threshold, process 700 proceeds along the “no” branch to 716. Process 700 also arrives at 716 from 714. At 716, the lending metric is presented. The lending metric may ultimately be presented whether or not the lending metric exceeds the threshold at 712.
Presenting the lending metric may include presenting the numerical difference between the number of digital items lent and the number of digital items borrowed. Each digital item may be given more or less weight in determining the lending metric based on characteristics of the digital item. The number of digital items lent by the user and the number of digital items borrowed by the user may be presented with the lending metric. For example, assuming all digital items are weighted as 1, a user that has lent 100 digital items and borrowed 98 digital items may have a lending metric of 2 displayed together with 100—loaned and 98—borrowed. One way of representing this lending metric is 2(100/98). A different user that has borrowed two digital items, but not lent any digital items may have a lending metric that is shown as −2(0/2).
The lending metric may alternatively or additionally be presented as non-numerical representation based on the numerical value of the lending metric. For example, a lending metric about 10 may be represented as one gold star, when the lending metric exceeds 25 that representation may be two gold stars. A negative lending metric may be represented by an unhappy face, etc. The lending metric may be displayed on a profile page of the user or available only to other users that are connected to the user through a social network. Also, the lending metric may be displayed to any other user that may lend or borrow a digital item from this user.
FIG. 8 shows a process 800 of facilitating lending of digital items and increasing a lending metric of the lender. Process 800 may be implemented in part by the lending system 108.
At 802, the availability of a digital item for borrowing from a first user is indicated. The indication may be provided to only one potential borrower. For example, the first user may selectively direct the indication to a friend. In other implementations, the indication is provided to two or more potential borrowers. This includes broadcasting the indication to all other users in the lender/borrower community.
However, the indication may be sent to a more selective group than all other users, yet a larger group than just a single other user. For example, the potential borrowers that receive the indication may be users that have a characteristic specified by the first user. The characteristic may be anything associated with the user's identities or profiles including, lending metric, position in a social network, geographic location, age, gender, digital item preferences or consumption history, type of device used to consume digital items, etc.
At 804, an indication that a second user desires to borrow the digital item from the first user is received. The indication may be communicated by email, through a social network, or by any other technique. For example, placing the digital item in a list of digital items that the potential borrower wishes to borrow is one way for the second user to indicate that he or she desires to borrow the digital item. In some implementations the indication may not be presented to the first user, but rather received only by the first user's computing device.
At 806, lending of the digital item from the first user to the second user is facilitated. The lending module 412 may facilitate the loan.
At 808, in response to facilitating the lending at 806, the lending metric associated with the first user is increased. The lending metric may be increased more if the first user has not yet consumed the digital item. Recently released digital items as well as expensive or popular digital items may cause a larger increase in the lending metric. The increase in the lending metric may be implemented by the lending metric module 332.
FIG. 9 shows a process 900 of recommending a borrower to loan a digital item upon the owner of the digital item completing consumption of the digital item. Process 900 may be implemented by the lending system 108.
At 902, it is determined that an owner of a digital item has finished consuming the digital item. This determination may be performed by a device such as a dedicated eBook reader device that renders digital items, such as eBooks, for consumption. For example, after viewing the last page of a section of an eBook, an eBook reader device may determine that the owner is finished reading the eBook. If it is determined that the owner abandoned the eBook (i.e., has expressed an intention to not read it any further) that may also be interpreted as finishing the eBook.
At 904, potential borrowers of the digital item that are connected to the lender in a social network and that indicate a desire to borrow the digital item are identified. The social network may be a social network that is not directly connected with lending and borrowing of digital items. However, in some implementations, the social network may be formed by lending and borrowing digital items. For example, each loan a digital item creates a connection between the user that loaned an item and the user that borrowed the item. The indication of the desire to borrow the digital item may be manifested by direct communication to the owner of the digital item, by placing the digital item in a list of digital items that the potential borrower wishes to borrow, in a list of digital items that the potential borrower wishes to purchase, or by another technique.
At 906, one of the potential borrowers is selected based on a characteristic of the potential borrower. The characteristic of the potential borrower may be a level of centrality in the social network that is above a threshold level. A user with high centrality in a social network is connected to a large number of other users and the centrality may suggest a level of influence such that anything the user is consuming, even a borrowed content item, may become more popular merely because it is consumed by this user with a high centrality.
The characteristic used to select a borrower from the potential borrowers may include the potential borrower having a similar consumption pattern of digital items as the owner. These consumption patterns may be observed or inferred from analysis of lists of content items associated with the owner and with the potential borrower as shown in FIG. 5. A user that likes the same things may be someone with whom the owner wishes to develop a lending/borrowing relationship.
The characteristic may additionally or alternatively include past lending and borrowing activity between the owner and the potential borrower. If the owner has borrowed may digital items from another user in the past, the owner may want to repay that by lending a digital item to that user. The characteristic may also include a lending metric of the potential borrower. Potential borrowers with high lending metrics may be selected before potential borrowers with low lending metrics.
The hardware devices associated with the potential borrower may also be a characteristic used to select the potential borrower. For example, if the digital item is an eBook, potential borrowers without a dedicated eBook reader device may be selected so that receiving the loan of the eBook may motivate purchase of a dedicated eBook reader device. In some implementations, the eBook or other digital item may be consumed on many types of devices such as general purpose computers so that purchase of a specialized rendering device is not necessary.
At 908, a recommendation that the owner lend the digital item to the selected one of the potential borrowers is generated. The recommendation module 624 may generate this recommendation. In order to appear as a natural continuation of the digital item, the recommendation may be generated in a same format as content of the digital item. For example, if the digital item is an eBook, then the recommendation may be generated as text in the same font and layout as the eBook and appear as the last page of the eBook. The recommendation may be a message along the lines of: “Now that you have finished reading this eBook, would you like to lend it to your friend Simon?”
At 910, a loan of the digital item from the owner to the potential borrower, now actual borrower, is facilitated. Making the loan increases a lending metric of the owner. Receiving the loan decreases a lending metric of the potential, now actual, borrower.
FIG. 10 shows a process 1000 of facilitating lending of a digital item to a first user that responds to a notice of a lending opportunity and providing a commission payment to the lender if a user that is not able to borrow the digital item instead purchases the digital item. Process 1000 may be implemented by the lending system 108 using the offer module 614, the messaging module 632, and the commission module 634.
At 1002, a notice of a borrowing opportunity to borrow a digital item is distributed to a plurality of potential borrowers. In some implementations, the notice may be provided over a social network from a member of the social network to his or her followers in the social network. The potential borrowers may included only those users that are connected to the owner of the digital item through the social network with primary, secondary, tertiary, or more distance connections.
Each of the potential borrowers may also be specified by the owner of the digital item. For example, the owner may select five friends he or she knows are interested in the digital item and choose to distribute the notice of a borrowing opportunity to those five people. By lending to the first one that responds, the owner has avoided the hard decision of choosing who gets to borrow the digital item. This may be a more difficult decision if a number of times that the digital item may be lent is limited either by the owner or by a rights holder (e.g., publisher).
At 1004, a response time for ones of the plurality of potential borrowers that respond to the notice is determined. Depending on the context in which the borrowing opportunity is presented, the response times may be in seconds, minutes, hours, or a longer length of time. For example, a first potential borrower to respond may respond in 1:06 and the second potential borrower to respond may respond in 1:10.
The true response times may be modified so that users who have recently been first to respond to an earlier notice are handicapped. For example, an amount of time is added to a response time for a one of the potential borrowers that previously had a shortest response time in response to a previous notice of a borrowing opportunity to borrow a different digital item. Adding this additional amount of time, or handicap, generates a modified response time that is slower than the actual response time. Conversely, potential borrowers that are always slow or have never been first may be advantaged by modified response times that are faster than their actual response times.
At 1006, lending of the digital item to the one of the plurality of potential borrowers that responds to the notice having a shortest response time is facilitated. The quickest one to click back or otherwise respond to the notice gets to borrow the digital item. The modified response times may be used to differentially handicap and assist the potential borrowers based on past results.
At 1008, a consolation message is provided to the ones of the plurality of potential borrowers that responded to the notice having a response time longer than the shortest response time. These potential borrowers may not know that someone else has already been selected to borrow the content item at the time they respond. Thus, when responding to the notice each of these potential borrowers is hoping to borrow the digital item.
The consolation message may include an offer to sell a copy of the digital item. Thus, the slower potential borrowers may click on a link to borrow the digital item and receive a message indicating that someone else was faster, but offering a way to buy the digital item instead. The consolation message may also include a discount price for the copy of the digital item.
At 1010, it is determined if any of the plurality of potential borrowers that respond to the notice having a response time longer than the shortest response time purchase a copy of the digital item in response to the consolation message. If not, process 1000 follows the “no” branch and may end.
If one of the potential borrowers that did not get the loan does make a purchase in response to the consolation message, process 1000 follows the “yes” branch to 1012 and a portion of the purchase price of the copy of the digital item is provided to the owner of the digital item. In this implementation, users are incentivized to offer loans of digital items to others that are likely to buy a copy if they receive a consolation message. This may generate a type of user-driven advertising in which one potential borrower is able to borrow and consume the digital item for free, but some number of other potential borrowers choose to purchase a copy of the digital item.
FIG. 11 shows a process 1100 of facilitating lending of a digital item to a highest ranked potential borrower that responds to an indication that the digital item is available. Process 1100 may be implemented in whole or part by the lending system 108.
At 1102, indication is received from a lender of a digital item that is available to lend. The indication may be sent by any type of communication technology and indicate intended recipients for the communication. For example, the lender 102 may interact with the lender device 104 to specific the digital item and a plurality of other users to whom the lender is willing to lend. In some implementations, the indication may be received by the offer module 614.
At 1104, a plurality of responses from a plurality of potential borrowers that wish to borrow the digital item are received. Less than all of the potential borrowers who receive the offer may respond. For example, if the indication is sent to every other user connected to the network 110 in architecture 100 it is possible that only a small percentage of the potential borrowers will respond to the offer. However, if the digital item is eligible for lending only once or a few times, it may be necessary to further reduce the number of potential borrowers.
At 1106, the plurality of potential borrowers are ranked. In some implementations, the ranking may be performed by the filtering module 620 and/or the selection module 622.
At 1108, lending of the digital item from the lender to a highest ranked one of the plurality of potential borrowers is facilitated. The lending module 412 may facilitate the lending in some implementations. Lending may involve transferring data associated with the digital item to the borrower. Lending may additionally or alternatively involve providing the borrower, or borrower's device, with access to the content item stored remotely such as on the lending broker 112.
In one implementation, the ranking of the potential borrowers is based on a time that each of the responses are received. This may cause the first potential borrower to respond to be the highest ranked potential borrower. However, other arrangements are also possible such as the slowest potential borrower to respond, the potential borrower who responds closest to a predetermined time (which may or may not be disclosed to the potential borrowers), or any other time-based ranking scheme.
In another implementation, the ranking of the potential borrowers is based on a lending metric associated with each of the potential borrowers. For example, out of all the potential borrowers who respond, the one having the highest lending metric becomes the highest ranked one of the plurality of potential borrowers. Thus, a high lending metric serves as a benefit because the high lending metric increases a user's chances of be being selected to receive the loan of this digital item. Having a high lending metric as a deciding criterion may also balance lending and borrowing between users because the potential borrower with the highest lending metric is likely a user that frequently loans digital items to others, so that could be balanced out at least partially by loaning a digital item to this user.
Combinations of speed and lending metric may also be used to rank the potential borrowers. For example, the highest ranked potential borrower may be the first user with a lending metric above a certain threshold to respond.
The lending metric used to determine a ranking of the potential borrowers may be determined from past lending and borrowing activity between the owner of the digital item and the one of the potential borrowers. The owner may care less about how much each of the potential borrowers lends to others in general and instead wishes to loan this digital item to the potential borrower that has lent the most to him or her in the past. Thus, instead of considering a “global” lending metric, a “personal” lending metric based just on transactions between the owner and one of the potential borrowers may be used.
In a further implementation, the ranking of the potential borrowers is based on a connection between the lender and each of the plurality of potential borrowers in a social network. Potential borrowers with the closest connections (e.g., primary connections) may have the highest ranking Alternatively, potential borrowers with the most distant connections, or with no connection at all (e.g., “unconnected” members of the social network) to the owner may be the highest ranked. The distance and type of connection in the social network may be determined by the social networking module 202.
Combinations of any of the above considerations may also be used to arrive at a highest ranked potential borrower. For example, the highest ranked potential borrower may be the potential borrower with the highest lending metric with respect to the owner who also has a primary connection to the owner in the social network (e.g., the one of the close friends who has lent the most to the owner in the past).
The lending metric of the potential borrowers may also be combined with any of the other considerations to prevent a potential borrower having a lending metric below a threshold as being ranked as the highest ranked one of the plurality of potential borrowers. This may prevent “leeches” from receiving the loan of a digital item without regard to a response speed or position in a social network.
In a further implementation, the ranking of the potential borrowers is based on a number of times each of the potential borrowers was previously the highest ranked one of the plurality of potential borrowers with respect to a different digital item that was previously available to lend. This modification to the ranking may make it more difficult for the same user to be repeatedly identified as the highest ranked potential borrower. The handicapping module 630 may implement this modification to the ranking. For example, if a potential borrower would otherwise be ranked first (e.g., based on speed, social network connection, lending metric, etc.) he or she may be demoted a rank for each time that he or she was previously ranked first.
At 1110, a consolation message for ones of the plurality of potential borrowers that are not the highest ranked one of the plurality of potential borrowers is generated. The messaging module 646 may, in some implementations, generate the consolation message. The consolation message may be similar to the consolation messages generated at 1008 in process 1000.
At 1112, a lending metric associated with an owner of the digital item is increased when the digital item is lent to the highest ranked one of the plurality of potential borrowers. The amount of the increase may depend in part on characteristics of the digital item as discussed above.
At 1114, a lending metric associated with the highest ranked one of the plurality of potential borrowers is decreased when the digital item is borrowed. The decrease may be the same amount as the increase at 1112, but in an opposite direction. The decrease may alternatively be a different amount than the increase in the lending metric at 1112. Similar to the increase, the decrease in the lending metric of the borrower may depend in part on characteristics of the digital item. Both the increase at 1112 and the decrease at 1114 may be implemented by the lending metric module 332.
FIG. 12 shows a process 1200 of storing annotations of a borrowed digital item in association with the user that borrowed the digital item and made the annotations. Process 1200 may be implemented in whole or part by the lending system 108 such as by the annotation module 636 of the lending system 108.
At 1202, a recipient for a copy of a digital item is identified. The recipient may be identified through any of the previously discussed techniques or simply designated by the lender of the digital item such as through entry of the recipient's email address. For example, the recipient may be identified based on a characteristic of the recipient.
At 1204, lending the copy of the digital item from the lender to the recipient is facilitated. As discussed above, the lending module 412 may facilitate the loan of this digital item. The loaned copy may be the specific data representing the copy of the digital item, out of all the copies of the same common work, owned by the lender.
At 1206, annotations of the digital item generated by the recipient while consuming the digital item are stored. The annotations may be stored in association with the recipient such as part of the recipient's user profile. The annotations may also be stored separately from the copy of the digital item. When the digital item is an eBook or other textual document, the annotations may include such things as margin notes, underlining, highlighting, etc.
At 1208, return of the copy of the digital item to the lender without the annotations generated by the recipient is facilitated. Thus, the lender gets back an unmarked copy of his or her digital item, but the annotations remain for the borrower to access. Data representing the copy of the digital item may be transferred back to a device of the lender without transfer of data representing the annotations. Alternatively, the lender may gain access to the copy of the digital item stored in the cloud or remote storage, but not gain access to the borrower's annotations, thus the copy of the digital item as perceived by the lender does not include the annotations.
At 1210, it is determined if the recipient has obtained access to another (or the same) copy of the digital item. For example, the recipient may purchase his or her own copy of the digital item after borrowing the lender's copy. The recipient may also borrow another copy of the same digital item from a different lender or even borrow the same copy from the lender a second time.
However, if the recipient has not obtained another copy of the digital item, process 1200 follows the “no” branch to 1212. At 1212, the annotations are presented to the recipient when the recipient is unable to access the same or a different copy of the digital item. The recipient may see his or her notes, underlines, and such separate from the digital item.
If the recipient does obtain another, or the same, copy of the digital item, then process 1200 follows the “yes” branch to 1214. At 1214, the annotations are automatically associated with the copy of the digital item upon the recipient accessing the copy of the digital item. Thus, a “new” copy of the digital item purchased by the recipient will include all the annotations that the recipient made to the copy borrowed from the lender. Also, if the recipient borrows the same copy from the lender one more time, the recipient's annotations will be automatically re-associated with that copy while it is accessible to the recipient.
Conclusion
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the claims.
Claims (41)
What is claimed is:
1. A non-transitory computer-readable storage media storing computer-readable instructions that, when executed, instruct a processor to perform acts comprising:
determining a number of digital items lent by a user;
increasing a lending metric associated with the user based at least in part on the number of digital items lent by the user, wherein the increasing the lending metric associated with the user is based at least in part on at least one characteristic of each of the digital items lent by the user;
determining a number of digital items borrowed by the user; and
decreasing the lending metric based at least in part on the number of digital items borrowed by the user, wherein the decreasing the landing metric is based at least in part on at least one characteristic of each of the digital items borrowed by the user.
2. The non-transitory computer-readable storage media of claim 1, wherein the digital items comprise electronic books.
3. The non-transitory computer-readable storage media of claim 1, wherein the lending metric comprises the number of digital items lent by the user minus the number of digital items borrowed by the user.
4. The non-transitory computer-readable storage media of claim 1, wherein an amount the lending metric decreases when one digital item is borrowed by the user is less than an amount the lending metric increases when one digital item is lent by the user.
5. The non-transitory computer-readable storage media of claim 1, wherein the determining a number of digital items lent by the user and the determining a number of digital items borrowed by the user excludes free digital items.
6. The non-transitory computer-readable storage media of claim 1, wherein the determining a number of digital items lent by the user further comprises determining a number of unique recipients for the digital items lent by the user and the lending metric associated with the user is based at least in part on the number of unique recipients.
7. The non-transitory computer-readable storage media of claim 1, wherein the digital items lent by the user and the digital items borrowed by the user are digital items lent to and borrowed from a single other user.
8. The non-transitory computer-readable storage media of claim 1, further comprising providing an award to the user when the lending metric exceeds a threshold value.
9. The non-transitory-readable storage media of claim 8, wherein the award comprises a non-monetary award.
10. The non-transitory computer-readable storage media of claim 1, further comprising presenting the lending metric.
11. The non-transitory computer-readable storage media of claim 10, wherein the presenting the lending metric comprises presenting the number of digital items lent by the user and the number of digital items borrowed by the user.
12. The non-transitory computer-readable storage media of claim 10, wherein the presenting the lending metric comprises presenting the lending metric in a profile of the user.
13. The non-transitory computer-readable storage media of claim 10, wherein the presenting the lending metric comprises presenting a non-numerical representation of the lending metric, the non-numerical representation based at least in part on a the numerical value of the lending metric.
14. The non-transitory computer-readable storage media of claim 1, further comprising presenting the lending metric to other users connected to the user in a social network and not presenting the metric to other users that are not connected to the user in the social network.
15. The non-transitory computer-readable storage media of claim 14, wherein connections are formed between users in the social network when one of the users lends a digital item to or borrows a digital item from another one of the users.
16. The non-transitory computer-readable storage media of claim 14, wherein the social network comprises other users that are followers of the user or other users that are followed by the user, and wherein the user is connected to the followed users and the following users in the social network.
17. A computer-implemented method, comprising:
under control of one or more processors configured with specific executable instructions,
indicating availability of a digital item for borrowing from a first user who is associated with a lending metric;
receiving an indication that a second user desires to borrow the digital item from the first user;
facilitating lending of the digital item from the first user to the second user; and
responsive to the facilitating, increasing the lending metric associated with the first user by an amount that is at least in part based on at least one characteristic of the loaned digital item.
18. The computer-implemented method of claim 17, wherein the digital item is eligible for lending a limited number of times.
19. The computer-implemented method of claim 18, wherein the limited number of times is specified by an entity having rights in the digital item.
20. The computer-implemented method of claim 17, wherein indicating availability of the digital item for borrowing comprises providing an indication to a single potential borrower.
21. The computer-implemented method of claim 17, wherein indicating availability of the digital item for borrowing comprises providing an indication to two or more potential borrowers.
22. The computer-implemented method of claim 21, wherein the two or more potential borrowers comprise other users having a characteristic specified by the first user.
23. The computer-implemented method of claim 17, wherein the first user is prevented from consuming the digital item during the duration of the lending of the digital item from the first user to the second user.
24. The computer-implemented method of claim 17, wherein the at least one characteristic of the digital item comprises a purchase price of the digital item, a rating of the digital item, a rank of the digital item, a number of users waiting to borrow the digital item, an amount of time since the digital item was released, or a status of the digital item as consumed or not consumed by the first user.
25. A non-transitory computer-readable storage media storing computer-readable instructions that, when executed, instruct a processor to perform acts comprising:
indicating that a digital item of a first user is available for borrowing from the first user;
receiving an indication that a second user desires to borrow the digital item from the first user;
determining if the second user has previously borrowed the digital item from the first user or from another user;
at least partly in response to determining that the second user has not previously borrowed the digital item, sending information to at least one of a device of the first user and a device of the second user related to lending of the digital item from the first user to the second user; and
at least partly in response to determining that the second user has previously borrowed the digital item, at least one of:
sending, to the device of the first user, information related to refraining from lending of the digital item to the second user; and
refraining from indicating, in subsequent indications to the second user, that the digital item of the first user is available for borrowing.
26. The non-transitory computer-readable storage media of claim 25, the acts further comprising, based at least in part on receiving an indication of the lending of the digital item from the first user to the second user, increasing a lending metric of the first user and decreasing a lending metric of the second user.
27. The non-transitory computer-readable storage media of claim 25, the acts further comprising, at least at least partly in response to the determining that the second user has previously borrowed the digital item, generating a consolation message for the second user to indicate that the second user was not selected for the lending of the digital item to the second user.
28. A computing system comprising:
one or more processors;
memory accessible by the one or more processors;
a request module stored in the memory and executable by the one or more processors to receive a request from a user to borrow a digital item;
a queuing module stored in the memory and executable by the one or more processors to place the request from the user in a queue to receive a loan of the digital item;
a lending module stored in the memory and executable by the one or more processors to provide the user with access to the digital item when the request from the user reaches a top of the queue; and
a lending metric module stored in the memory and executable by the one or more processors to decrease a lending metric associated with the user by an amount that is at least in part based on a characteristic of the borrowed digital item when the user receives access to the digital item.
29. The computing system of claim 28, wherein the digital item comprises one of an electronic book, an audio item, a video item, a multimedia item, or a graphical item.
30. The computing system of claim 28, wherein the request is inferred by the request module when the user includes the digital item in a list of multiple digital items.
31. The computing system of claim 28, wherein:
the queuing module prevents the user from placing a request in the queue when the lending metric associated with the user is less than a threshold level; or
the lending module refrains from providing the user with access to the digital item when the lending metric associated with the user is less than the threshold level.
32. The computing system of claim 31, wherein the position of the request from the user in the queue is based at least in part on a number of copies of the digital item available to borrow and a number of user requests in the queue.
33. The computing system of claim 28, wherein the queuing module is configured to modify or set a position in the queue of the request from the user based at least in part on the lending metric associated with the user.
34. The computing system of claim 33, wherein the queuing module is configured to move the request from the user to the top of the queue or place the request from the user to the top of the queue when the lending metric associated with the user is more than a threshold level.
35. The computing system of claim 28, further comprising a notification module stored in the memory and executable by the one or more processors to notify the user of a position of the request from the user in the queue.
36. The computing system of claim 28, further comprising a timing module stored in the memory and executable by the one or more processors to prevent the user from accessing the digital item upon expiration of a predetermined time period.
37. The computing system of claim 36, wherein the timing module determines a consumption rate at which that the user consumes the digital item and, based at least in part on the consumption rate, determines if the user will consume the entire digital item before expiration of the predetermined time period.
38. The computing system of claim 37, wherein the timing module generates an indication for the user when the timing module determines that the user will not consume the entire digital item before expiration of the predetermined time period.
39. The computing system of claim 38, wherein the indication informs the user of a consumption speed sufficient to consume the entire digital item before expiration of the predetermined time period.
40. The computing system of claim 38, wherein the indication offers the user a discount for purchase of the digital content item.
41. The non-transitory storage media of claim 1, wherein the at least one characteristic of each of the digital items lent by the user and the at least one characteristic of each of the digital items borrowed by the user comprises a purchase price of the digital item, a rating of the digital item, a rank of the digital item, a number of users waiting to borrow the digital item, an amount of time since the digital item was released, a status of the digital item as consumed or not consumed by the first user, or a number of times the digital work is available for lending.
US13/075,013 2011-03-29 2011-03-29 Mediated lending of digital items Active 2031-12-18 US8635277B2 (en)
Priority Applications (1)
Application Number Priority Date Filing Date Title
US13/075,013 US8635277B2 (en) 2011-03-29 2011-03-29 Mediated lending of digital items
Applications Claiming Priority (2)
Application Number Priority Date Filing Date Title
US13/075,013 US8635277B2 (en) 2011-03-29 2011-03-29 Mediated lending of digital items
PCT/US2012/030982 WO2012135367A2 (en) 2011-03-29 2012-03-28 Mediated lending of digital items
Publications (2)
Publication Number Publication Date
US20120254303A1 US20120254303A1 (en) 2012-10-04
US8635277B2 true US8635277B2 (en) 2014-01-21
Family
ID=46928724
Family Applications (1)
Application Number Title Priority Date Filing Date
US13/075,013 Active 2031-12-18 US8635277B2 (en) 2011-03-29 2011-03-29 Mediated lending of digital items
Country Status (1)
Country Link
US (1) US8635277B2 (en)
Cited By (3)
* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150193743A1 (en) * 2014-01-06 2015-07-09 NewComLink Inc. Settlement facilitation hub
US20170270473A1 (en) * 2016-03-18 2017-09-21 Goodees, Inc. Systems and methods for securely searching and exchanging database relationships between registered inventory
US9904900B2 (en) 2015-06-11 2018-02-27 Bao Tran Systems and methods for on-demand transportation
Families Citing this family (11)
* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9176934B2 (en) 2005-05-06 2015-11-03 Leo Baschy User interface for nonuniform access control system and methods
US9202068B2 (en) * 2006-03-29 2015-12-01 Leo M. Baschy User interface for variable access control system
US20130054692A1 (en) * 2011-08-30 2013-02-28 Google Inc. Organizing and Tracking Belongings Using Social Graph Information
US9436928B2 (en) 2011-08-30 2016-09-06 Google Inc. User graphical interface for displaying a belonging-related stream
US20130054709A1 (en) * 2011-08-30 2013-02-28 Google Inc. System and Method for Displaying a Belonging-Related Stream
US8504906B1 (en) * 2011-09-08 2013-08-06 Amazon Technologies, Inc. Sending selected text and corresponding media content
KR101204348B1 (en) * 2012-04-05 2012-11-23 (주)이니셜커뮤니케이션즈 Method, server and computer-readable recording medium for providing user-customized information using e-book service
US20130290395A1 (en) * 2012-04-26 2013-10-31 Empire Technology Development Llc Multimedia application rental and billing
US9558333B2 (en) * 2012-10-29 2017-01-31 Aol Inc. Systems and methods for facilitating the sharing of digital bundles of services between users
US9326030B2 (en) * 2013-07-30 2016-04-26 Google Inc. Systems and methods for triggering user notifications of media content items
US20200311785A1 (en) * 2019-03-29 2020-10-01 Sony Interactive Entertainment LLC Automated virtual asset catalog for computer applications
Citations (54)
* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4656624A (en) * 1985-05-03 1987-04-07 At&T Bell Laboratories Operator communication arrangements for operator assistance systems
US5732216A (en) 1996-10-02 1998-03-24 Internet Angles, Inc. Audio message exchange system
US5925081A (en) * 1996-12-19 1999-07-20 Caterpillar Inc. System and method for managing access to a load resource having a loading machine
US6233682B1 (en) 1999-01-22 2001-05-15 Bernhard Fritsch Distribution of musical products by a web site vendor over the internet
US20010033659A1 (en) 2000-01-13 2001-10-25 Scott Eisenberg System and method for granting electronic rights using the signature of distributable physical media
US20020091634A1 (en) * 2001-01-11 2002-07-11 Trace Eubanks System and method for deferring payments
US6704733B2 (en) 2000-10-25 2004-03-09 Lightning Source, Inc. Distributing electronic books over a computer network
US20040174980A1 (en) * 2003-03-06 2004-09-09 Sbc Properties, L.P. System and method for providing customer activities while in queue
US20040199545A1 (en) * 2001-08-14 2004-10-07 Frederico Wagner Networked disposal and replenishment apparatus
US20040215554A1 (en) 2002-12-30 2004-10-28 Fannie Mae System and method for verifying loan data at delivery
US20040268418A1 (en) 2003-06-30 2004-12-30 Gray James Harold Interactive content with enhanced network operator control
US20050004837A1 (en) 2003-01-22 2005-01-06 Duane Sweeney System and method for compounded marketing
US20050021750A1 (en) 2003-06-16 2005-01-27 Friendster Inc., A California Corporation System, method and apparatus for connecting users in an online computer system based on their relationships within social networks
US6873840B1 (en) 2000-11-08 2005-03-29 Hewlett-Packard Development Company, L.P. Resource access/return system
US20050289032A1 (en) * 2004-06-29 2005-12-29 International Business Machines Corporation System and method for tracking the return of loaned or rented items
US20060129780A1 (en) * 2004-12-14 2006-06-15 Andrew Dunshea Memory pacing
US20060143134A1 (en) * 2004-12-25 2006-06-29 Nicol So Method and apparatus for sharing a digital access license
US20060149572A1 (en) * 2004-12-30 2006-07-06 Superborrownet, Inc. System and method for asset sharing
US20060179129A1 (en) 2005-02-10 2006-08-10 Clayton Richard M Hotcontent update for a target device
US20060178905A1 (en) * 2001-08-31 2006-08-10 Mona Ayers System and method for managing product sales data for external reports
US20070019019A1 (en) * 2005-07-22 2007-01-25 Takashi Yoshikawa Image forming apparatus, printout control server, and computer readable recording medium on which a printout managing program is recorded
US20070061704A1 (en) 2005-09-14 2007-03-15 Microsoft Corporation Dynamic anchoring of annotations to editable content
US20070162502A1 (en) 2005-12-29 2007-07-12 United Video Properties, Inc. Media library in an interactive media guidance application
US7249107B2 (en) 2001-07-20 2007-07-24 Microsoft Corporation Redistribution of rights-managed content
US20070198426A1 (en) 2004-03-04 2007-08-23 Yates James M Method and apparatus for digital copyright exchange
US20070201701A1 (en) 2006-02-10 2007-08-30 Nagracard S.A. Prepaid access control method
US20070201702A1 (en) 1992-12-09 2007-08-30 Discovery Communications, Inc. Electronic book security and copyright protection system
US20070276817A1 (en) * 2004-11-30 2007-11-29 Arnaud Massonnie Open System For Dynamically Generating A Network Of Contacts
US20070288107A1 (en) * 2006-05-01 2007-12-13 Javier Fernandez-Ivern Systems and methods for screening submissions in production competitions
US20080046976A1 (en) * 2006-07-25 2008-02-21 Facebook, Inc. Systems and methods for dynamically generating a privacy summary
US20080065514A1 (en) * 2006-09-08 2008-03-13 Snitsig, Inc. Personal inventory management and item exchange network
US20080104624A1 (en) 2006-11-01 2008-05-01 Motorola, Inc. Method and system for selection and scheduling of content outliers
US20080148069A1 (en) 2000-10-24 2008-06-19 Nds Limited Transferring electronic content
US20080189367A1 (en) 2007-02-01 2008-08-07 Oki Electric Industry Co., Ltd. User-to-user communication method, program, and apparatus
US20080201376A1 (en) 2003-10-01 2008-08-21 Musicgremlin, Inc. Method for sharing content with several devices
US20080201225A1 (en) 2006-12-13 2008-08-21 Quickplay Media Inc. Consumption Profile for Mobile Media
US20090024925A1 (en) 2007-07-18 2009-01-22 Andrew Stevens System and method for creating and distributing derivative media work
US20090052778A1 (en) 2007-05-29 2009-02-26 Edgecomb Tracy L Electronic Annotation Of Documents With Preexisting Content
US7546524B1 (en) 2005-03-30 2009-06-09 Amazon Technologies, Inc. Electronic input device, system, and method using human-comprehensible content to automatically correlate an annotation of a paper document with a digital version of the document
US20090260067A1 (en) * 2008-04-15 2009-10-15 Hyrax Media Ltd Method and system for legitimate lending and sharing of digital copyrighted content items over a data network
US20090282438A1 (en) * 2008-05-09 2009-11-12 At&T Knowledge Ventures, L.P. Community Content Ratings System
US20090319288A1 (en) 2008-06-24 2009-12-24 Yahoo Inc. Suggesting contacts for social networks
US20090323640A1 (en) * 2008-06-26 2009-12-31 Qualcomm Incorporated Fair resource sharing in wireless communications
US20100088314A1 (en) * 2008-10-07 2010-04-08 Shaobo Kuang Method and system for searching on internet
US20100086130A1 (en) * 2007-01-17 2010-04-08 Peking University Founder Group Co., Ltd. Digital Content Rights Management Method and System
US20100095201A1 (en) 1999-08-10 2010-04-15 Sharp Kabushiki Kaisha Electronic book contents recording medium with electronic book contents recorded thereon, electronic book transmission apparatus and electronic book display apparatus
US20100106659A1 (en) 1994-11-23 2010-04-29 Contentguard Holdings, Inc. System and method for enforcing usage rights associated with digital content
US20100131385A1 (en) 2008-11-25 2010-05-27 Opanga Networks, Llc Systems and methods for distribution of digital media content utilizing viral marketing over social networks
US20100138867A1 (en) 2008-12-02 2010-06-03 Ling Jun Wong Audiovisual user interface based on learned user preferences
US7756753B1 (en) * 2006-02-17 2010-07-13 Amazon Technologies, Inc. Services for recommending items to groups of users
US20100217811A1 (en) * 2007-05-18 2010-08-26 Websense Hosted R&D Limited Method and apparatus for electronic mail filtering
US20100262515A1 (en) 2008-04-18 2010-10-14 Brewer Steven D Interinstitutional loan of electronic content
US20110166928A1 (en) 2010-01-06 2011-07-07 Sharitable, Llc Method of Sharing Possessions among Friends Connected through a Social Network
US8073733B1 (en) 2008-07-30 2011-12-06 Philippe Caland Media development network
Patent Citations (55)
* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4656624A (en) * 1985-05-03 1987-04-07 At&T Bell Laboratories Operator communication arrangements for operator assistance systems
US20070201702A1 (en) 1992-12-09 2007-08-30 Discovery Communications, Inc. Electronic book security and copyright protection system
US20100106659A1 (en) 1994-11-23 2010-04-29 Contentguard Holdings, Inc. System and method for enforcing usage rights associated with digital content
US5732216A (en) 1996-10-02 1998-03-24 Internet Angles, Inc. Audio message exchange system
US5925081A (en) * 1996-12-19 1999-07-20 Caterpillar Inc. System and method for managing access to a load resource having a loading machine
US6233682B1 (en) 1999-01-22 2001-05-15 Bernhard Fritsch Distribution of musical products by a web site vendor over the internet
US20100095201A1 (en) 1999-08-10 2010-04-15 Sharp Kabushiki Kaisha Electronic book contents recording medium with electronic book contents recorded thereon, electronic book transmission apparatus and electronic book display apparatus
US20010033659A1 (en) 2000-01-13 2001-10-25 Scott Eisenberg System and method for granting electronic rights using the signature of distributable physical media
US20080148069A1 (en) 2000-10-24 2008-06-19 Nds Limited Transferring electronic content
US6704733B2 (en) 2000-10-25 2004-03-09 Lightning Source, Inc. Distributing electronic books over a computer network
US6873840B1 (en) 2000-11-08 2005-03-29 Hewlett-Packard Development Company, L.P. Resource access/return system
US20020091634A1 (en) * 2001-01-11 2002-07-11 Trace Eubanks System and method for deferring payments
US7249107B2 (en) 2001-07-20 2007-07-24 Microsoft Corporation Redistribution of rights-managed content
US20040199545A1 (en) * 2001-08-14 2004-10-07 Frederico Wagner Networked disposal and replenishment apparatus
US20060178905A1 (en) * 2001-08-31 2006-08-10 Mona Ayers System and method for managing product sales data for external reports
US20040215554A1 (en) 2002-12-30 2004-10-28 Fannie Mae System and method for verifying loan data at delivery
US20050004837A1 (en) 2003-01-22 2005-01-06 Duane Sweeney System and method for compounded marketing
US20040174980A1 (en) * 2003-03-06 2004-09-09 Sbc Properties, L.P. System and method for providing customer activities while in queue
US20050021750A1 (en) 2003-06-16 2005-01-27 Friendster Inc., A California Corporation System, method and apparatus for connecting users in an online computer system based on their relationships within social networks
US20040268418A1 (en) 2003-06-30 2004-12-30 Gray James Harold Interactive content with enhanced network operator control
US20080201376A1 (en) 2003-10-01 2008-08-21 Musicgremlin, Inc. Method for sharing content with several devices
US20070198426A1 (en) 2004-03-04 2007-08-23 Yates James M Method and apparatus for digital copyright exchange
US20050289032A1 (en) * 2004-06-29 2005-12-29 International Business Machines Corporation System and method for tracking the return of loaned or rented items
US20070276817A1 (en) * 2004-11-30 2007-11-29 Arnaud Massonnie Open System For Dynamically Generating A Network Of Contacts
US20060129780A1 (en) * 2004-12-14 2006-06-15 Andrew Dunshea Memory pacing
US20060143134A1 (en) * 2004-12-25 2006-06-29 Nicol So Method and apparatus for sharing a digital access license
US20060149572A1 (en) * 2004-12-30 2006-07-06 Superborrownet, Inc. System and method for asset sharing
US20060179129A1 (en) 2005-02-10 2006-08-10 Clayton Richard M Hotcontent update for a target device
US7546524B1 (en) 2005-03-30 2009-06-09 Amazon Technologies, Inc. Electronic input device, system, and method using human-comprehensible content to automatically correlate an annotation of a paper document with a digital version of the document
US8132094B1 (en) 2005-03-30 2012-03-06 Amazon Technologies, Inc. Electronic input device and method for processing an electronically-executable instruction in an annotation of a document
US20070019019A1 (en) * 2005-07-22 2007-01-25 Takashi Yoshikawa Image forming apparatus, printout control server, and computer readable recording medium on which a printout managing program is recorded
US20070061704A1 (en) 2005-09-14 2007-03-15 Microsoft Corporation Dynamic anchoring of annotations to editable content
US20070162502A1 (en) 2005-12-29 2007-07-12 United Video Properties, Inc. Media library in an interactive media guidance application
US20070201701A1 (en) 2006-02-10 2007-08-30 Nagracard S.A. Prepaid access control method
US7756753B1 (en) * 2006-02-17 2010-07-13 Amazon Technologies, Inc. Services for recommending items to groups of users
US20070288107A1 (en) * 2006-05-01 2007-12-13 Javier Fernandez-Ivern Systems and methods for screening submissions in production competitions
US20080046976A1 (en) * 2006-07-25 2008-02-21 Facebook, Inc. Systems and methods for dynamically generating a privacy summary
US20080065514A1 (en) * 2006-09-08 2008-03-13 Snitsig, Inc. Personal inventory management and item exchange network
US20080104624A1 (en) 2006-11-01 2008-05-01 Motorola, Inc. Method and system for selection and scheduling of content outliers
US20080201225A1 (en) 2006-12-13 2008-08-21 Quickplay Media Inc. Consumption Profile for Mobile Media
US20100086130A1 (en) * 2007-01-17 2010-04-08 Peking University Founder Group Co., Ltd. Digital Content Rights Management Method and System
US20080189367A1 (en) 2007-02-01 2008-08-07 Oki Electric Industry Co., Ltd. User-to-user communication method, program, and apparatus
US20100217811A1 (en) * 2007-05-18 2010-08-26 Websense Hosted R&D Limited Method and apparatus for electronic mail filtering
US20090052778A1 (en) 2007-05-29 2009-02-26 Edgecomb Tracy L Electronic Annotation Of Documents With Preexisting Content
US20090024925A1 (en) 2007-07-18 2009-01-22 Andrew Stevens System and method for creating and distributing derivative media work
US20090260067A1 (en) * 2008-04-15 2009-10-15 Hyrax Media Ltd Method and system for legitimate lending and sharing of digital copyrighted content items over a data network
US20100262515A1 (en) 2008-04-18 2010-10-14 Brewer Steven D Interinstitutional loan of electronic content
US20090282438A1 (en) * 2008-05-09 2009-11-12 At&T Knowledge Ventures, L.P. Community Content Ratings System
US20090319288A1 (en) 2008-06-24 2009-12-24 Yahoo Inc. Suggesting contacts for social networks
US20090323640A1 (en) * 2008-06-26 2009-12-31 Qualcomm Incorporated Fair resource sharing in wireless communications
US8073733B1 (en) 2008-07-30 2011-12-06 Philippe Caland Media development network
US20100088314A1 (en) * 2008-10-07 2010-04-08 Shaobo Kuang Method and system for searching on internet
US20100131385A1 (en) 2008-11-25 2010-05-27 Opanga Networks, Llc Systems and methods for distribution of digital media content utilizing viral marketing over social networks
US20100138867A1 (en) 2008-12-02 2010-06-03 Ling Jun Wong Audiovisual user interface based on learned user preferences
US20110166928A1 (en) 2010-01-06 2011-07-07 Sharitable, Llc Method of Sharing Possessions among Friends Connected through a Social Network
Non-Patent Citations (9)
* Cited by examiner, † Cited by third party
Title
Liu, et al., "Digital Rights Management for Content Distribution", Australasian Information Security Workshop, Dec. 2003, Adelaide, Australia, Retrieved online on Aug. 15, 2011 at http://portal.acm.org/citation.cfm?id=827987.827994, entire document.
Office action for U.S. Appl. No. 12/792,518 , mailed on Sep. 20, 2012, Freed et al., "Referring, Lending, and Reselling of Digital Items", 17 pages.
Office action for U.S. Appl. No. 12/792,518, mailed on Feb. 7, 2013, Freed et al., "Referring, Lending, and Reselling of Digital Items", 16 pages.
Office action for U.S. Appl. No. 13/075,036, mailed on Feb. 21, 2013, Anbalagan et al., "Lending Digital Items to Identified Recipients", 53 pages.
Office action for U.S. Appl. No. 13/075,054, mailed on Jan. 25, 2013, Anbalagan et al., "Identification of Borrowers for Digital Items", 13 pages.
PCT Search Report mailed Aug. 26, 2011 for PCT application No. PCT/US11/38696, 8 pages.
PCT Search Report mailed Jun. 20, 2012 for PCT application No. PCT/US12/30982, 8 pages.
Unlu, et al., "Functional Reference Model for Digital Rights Management Systems", Proceedings of the 15th ITS Conference, Dec. 2004, Retrieved online on Aug. 15, 2011 at http://userpage.fu-berlin.de/~jmueller/its/conf/berlin04/Papers/%DCnt%FC.pdf, entire document.
Unlu, et al., "Functional Reference Model for Digital Rights Management Systems", Proceedings of the 15th ITS Conference, Dec. 2004, Retrieved online on Aug. 15, 2011 at http://userpage.fu-berlin.de/˜jmueller/its/conf/berlin04/Papers/%DCnt%FC.pdf, entire document.
Cited By (3)
* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150193743A1 (en) * 2014-01-06 2015-07-09 NewComLink Inc. Settlement facilitation hub
US9904900B2 (en) 2015-06-11 2018-02-27 Bao Tran Systems and methods for on-demand transportation
US20170270473A1 (en) * 2016-03-18 2017-09-21 Goodees, Inc. Systems and methods for securely searching and exchanging database relationships between registered inventory
Also Published As
Publication number Publication date
US20120254303A1 (en) 2012-10-04
Similar Documents
Publication Publication Date Title
Kingsnorth Digital marketing strategy: an integrated approach to online marketing
Lou et al. Influencer marketing: how message value and credibility affect consumer trust of branded content on social media
Livingstone et al. Maximizing opportunities and minimizing risks for children online: The role of digital skills in emerging strategies of parental mediation
Chaffey et al. Digital business and e-commerce management
Jenkins et al. Spreadable media: Creating value and meaning in a networked culture
Bucher The friendship assemblage: Investigating programmed sociality on Facebook
US20160196620A1 (en) System and method for providing a referral network in a social networking environment
Afuah Business model innovation: concepts, analysis, and cases
US9076167B2 (en) Method and system for automated online merchant charity donations
JP2019023925A (en) Dollar depository receipt, electronic membership transaction, and repo transaction
TWI648690B (en) Social Network system sponsorships ratings and valuation methods, systems, computer program products
Searls The intention economy: when customers take charge
Gerber et al. Crowdfunding: Why people are motivated to post and fund projects on crowdfunding platforms
Larrimore et al. Peer to peer lending: The relationship between language features, trustworthiness, and persuasion success
TWI633510B (en) Method for selectively displaying information, method for determining truthfulness of information, and method for displaying information according to truthfulness
US10346883B2 (en) Privacy sensitive persona management tools
Looy Social media management
US8577741B1 (en) Methods and apparatus for generating recommendations for gifts
US10540692B2 (en) Presenting deals to a user of social networking system
Chintagunta et al. The effects of online user reviews on movie box office performance: Accounting for sequential rollout and aggregation across local markets
TWI494881B (en) Adaptive audiences for accessibility and privacy control setting claims in a social networking system
Libert et al. The network imperative: How to survive and grow in the age of digital business models
Chen Herd behavior in purchasing books online
Goldfarb et al. Digital economics
Doyle A dictionary of marketing
Legal Events
Date Code Title Description
AS Assignment
Owner name: AMAZON TECHNOLOGIES, INC., NEVADA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:ANBALAGAN, KARTHIK G.;ANDERSON, EMILY MARGARET;KILLALEA, TOM;AND OTHERS;SIGNING DATES FROM 20110324 TO 20110329;REEL/FRAME:026763/0316
STCF Information on status: patent grant
Free format text: PATENTED CASE
FPAY Fee payment
Year of fee payment: 4
|
{
"url": "https://patents.google.com/patent/US8635277B2/en",
"source_domain": "patents.google.com",
"snapshot_id": "crawl=CC-MAIN-2020-50",
"warc_metadata": {
"Content-Length": "365703",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:J5U7VZKOG7RZMFYHSJWUKYWFWD2LPW3H",
"WARC-Concurrent-To": "<urn:uuid:8a215958-32c5-44da-8bb2-6b7bb6e50e8e>",
"WARC-Date": "2020-11-26T13:35:36Z",
"WARC-IP-Address": "172.217.2.110",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:H42RSST6RTM3FQSCKS2XMA3KQ7H66BRF",
"WARC-Record-ID": "<urn:uuid:137d03f8-8a87-4ddd-b457-f5ac04419bfc>",
"WARC-Target-URI": "https://patents.google.com/patent/US8635277B2/en",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:2e26004f-0922-44a8-b7cd-c191207f62fd>"
},
"warc_info": "isPartOf: CC-MAIN-2020-50\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-12.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
65,
66,
113,
114,
119,
120,
139,
151,
336,
346,
349,
363,
382,
387,
395,
403,
416,
421,
436,
627,
643,
662,
675,
690,
710,
719,
740,
753,
777,
798,
971,
995,
1013,
1037,
1228,
1240,
1257,
1341,
1406,
1641,
1724,
1802,
1839,
1909,
1946,
1988,
1989,
1995,
1996,
2003,
2004,
2020,
2021,
2036,
2078,
2390,
2443,
2623,
2654,
2669,
2711,
3023,
3076,
3131,
3146,
3188,
3500,
3553,
3608,
3646,
3661,
3703,
4015,
4124,
4157,
4158,
4167,
4168,
4879,
4880,
4892,
4893,
4904,
4905,
5348,
5349,
6034,
6035,
6069,
6070,
6389,
6390,
6556,
6557,
6665,
6666,
6844,
6845,
6944,
6945,
7039,
7040,
7185,
7186,
7304,
7305,
7445,
7446,
7620,
7621,
7917,
7918,
8099,
8100,
8284,
8285,
8306,
8307,
8882,
8883,
9404,
9405,
9897,
9898,
10470,
10471,
11765,
11766,
12826,
12827,
13687,
13688,
13714,
13715,
14406,
14407,
14747,
14748,
15333,
15334,
15990,
15991,
17068,
17069,
17777,
17778,
18327,
18328,
18806,
18807,
18835,
18836,
19321,
19322,
19641,
19642,
20665,
20666,
21658,
21659,
22128,
22129,
22900,
22901,
23322,
23323,
23922,
23923,
25101,
25102,
25137,
25138,
25696,
25697,
26479,
26480,
26869,
26870,
27583,
27584,
28511,
28512,
29093,
29094,
29878,
29879,
30628,
30629,
31052,
31053,
32293,
32294,
33003,
33004,
34084,
34085,
35015,
35016,
35528,
35529,
35981,
35982,
36654,
36655,
37114,
37115,
37423,
37424,
38076,
38077,
38720,
38721,
39542,
39543,
40550,
40551,
41362,
41363,
41752,
41753,
43047,
43048,
43084,
43085,
43546,
43547,
43948,
43949,
44273,
44274,
44755,
44756,
45166,
45167,
45468,
45469,
46058,
46059,
46823,
46824,
47248,
47249,
47873,
47874,
47902,
47903,
48362,
48363,
49154,
49155,
49961,
49962,
50266,
50267,
50676,
50677,
51182,
51183,
51901,
51902,
52315,
52316,
52896,
52897,
53498,
53499,
54573,
54574,
55353,
55354,
56323,
56324,
56862,
56863,
57546,
57547,
58393,
58394,
58965,
58966,
59586,
59587,
60204,
60205,
60765,
60766,
61451,
61452,
61942,
61943,
62761,
62762,
63345,
63346,
63645,
63646,
63969,
63970,
64617,
64618,
65359,
65360,
66330,
66331,
67308,
67309,
67698,
67699,
68050,
68051,
68850,
68851,
70204,
70205,
70746,
70747,
71515,
71516,
72584,
72585,
72894,
72895,
73285,
73286,
74087,
74088,
74942,
74943,
74966,
74967,
75879,
75880,
76066,
76067,
76316,
76317,
76730,
76731,
76980,
76981,
77697,
77698,
78338,
78339,
78781,
78782,
79140,
79141,
79457,
79458,
80296,
80297,
80942,
80943,
81124,
81125,
81540,
81541,
82085,
82086,
82639,
82640,
82779,
82780,
83215,
83216,
83430,
83431,
83998,
83999,
84862,
84863,
85405,
85406,
85877,
85878,
86364,
86365,
86914,
86915,
87584,
87585,
87842,
87843,
88263,
88264,
88743,
88744,
89312,
89313,
89722,
89723,
90398,
90399,
90787,
90788,
91219,
91220,
91592,
91593,
91889,
91890,
92562,
92563,
92816,
92817,
93279,
93280,
93839,
93840,
94013,
94014,
94489,
94490,
94981,
94982,
95793,
95794,
96018,
96019,
96626,
96627,
97219,
97220,
97628,
97629,
98027,
98028,
98771,
98772,
99133,
99134,
99420,
99421,
100006,
100007,
100311,
100312,
100660,
100661,
100997,
100998,
101452,
101453,
102120,
102121,
102502,
102503,
102864,
102865,
103498,
103499,
103510,
103511,
103879,
103880,
103892,
103893,
103913,
104074,
104128,
104424,
104488,
104744,
104863,
105067,
105321,
105550,
105892,
106109,
106276,
106383,
106500,
106730,
106906,
107195,
107471,
107709,
108006,
108053,
108143,
108258,
108357,
108442,
108638,
108763,
108909,
109090,
109275,
109442,
109654,
110057,
110219,
110314,
110413,
110527,
110818,
110941,
111074,
111216,
111536,
111911,
111946,
111970,
112019,
112161,
112329,
112527,
112815,
112984,
113153,
113200,
113357,
113524,
113757,
113977,
114254,
114475,
114714,
115022,
115264,
115463,
115593,
116169,
116273,
116274,
116300,
116301,
116352,
116438,
116439,
116474,
116475,
116526,
116612,
116706,
116707,
116724,
116725,
116761,
116809,
116854,
116855,
116862,
116863,
116875,
116876,
116900,
116901,
116952,
117056,
117057,
117076,
117077,
117090,
117114,
117115,
117128,
117129,
117173,
117238,
117327,
117496,
117593,
117594,
117627,
117628,
117672,
117737,
117851,
117956,
118079,
118197,
118314,
118435,
118609,
118730,
118874,
119004,
119142,
119143,
119158,
119159,
119203,
119268,
119399,
119489,
119628,
119756,
119916,
120016,
120132,
120265,
120374,
120482,
120602,
120702,
120918,
121029,
121186,
121260,
121372,
121474,
121573,
121700,
121901,
122019,
122151,
122253,
122362,
122450,
122581,
122704,
122845,
122970,
123085,
123210,
123297,
123430,
123540,
123641,
123769,
123889,
124133,
124304,
124412,
124506,
124622,
124724,
124863,
125096,
125244,
125417,
125535,
125653,
125777,
125882,
126020,
126101,
126102,
126124,
126125,
126169,
126234,
126365,
126496,
126644,
126734,
126873,
127001,
127234,
127394,
127481,
127597,
127708,
127808,
127910,
128019,
128146,
128254,
128354,
128487,
128703,
128823,
128933,
129042,
129199,
129322,
129396,
129508,
129610,
129709,
129953,
130140,
130341,
130459,
130591,
130679,
130797,
130938,
131063,
131178,
131303,
131404,
131543,
131676,
131800,
131920,
132048,
132219,
132324,
132432,
132526,
132642,
132723,
132825,
132998,
133116,
133254,
133255,
133280,
133281,
133325,
133331,
133581,
133730,
133877,
134025,
134172,
134260,
134348,
134613,
134878,
134879,
134892,
134893,
134937,
135002,
135091,
135188,
135357,
135358,
135376,
135377,
135413,
135445,
135446,
135464,
135465,
135500,
135582,
135706,
135864,
135922,
136005,
136086,
136193,
136256,
136339,
136441,
136558,
136615,
136720,
136843,
137022,
137083,
137112,
137192,
137265,
137423,
137541,
137641,
137687,
137721,
137753,
137754,
137767,
137768,
137796,
137810,
137811,
137857,
137858,
138054,
138055,
138096,
138097,
138129,
138130,
138147,
138148
],
"line_end_idx": [
65,
66,
113,
114,
119,
120,
139,
151,
336,
346,
349,
363,
382,
387,
395,
403,
416,
421,
436,
627,
643,
662,
675,
690,
710,
719,
740,
753,
777,
798,
971,
995,
1013,
1037,
1228,
1240,
1257,
1341,
1406,
1641,
1724,
1802,
1839,
1909,
1946,
1988,
1989,
1995,
1996,
2003,
2004,
2020,
2021,
2036,
2078,
2390,
2443,
2623,
2654,
2669,
2711,
3023,
3076,
3131,
3146,
3188,
3500,
3553,
3608,
3646,
3661,
3703,
4015,
4124,
4157,
4158,
4167,
4168,
4879,
4880,
4892,
4893,
4904,
4905,
5348,
5349,
6034,
6035,
6069,
6070,
6389,
6390,
6556,
6557,
6665,
6666,
6844,
6845,
6944,
6945,
7039,
7040,
7185,
7186,
7304,
7305,
7445,
7446,
7620,
7621,
7917,
7918,
8099,
8100,
8284,
8285,
8306,
8307,
8882,
8883,
9404,
9405,
9897,
9898,
10470,
10471,
11765,
11766,
12826,
12827,
13687,
13688,
13714,
13715,
14406,
14407,
14747,
14748,
15333,
15334,
15990,
15991,
17068,
17069,
17777,
17778,
18327,
18328,
18806,
18807,
18835,
18836,
19321,
19322,
19641,
19642,
20665,
20666,
21658,
21659,
22128,
22129,
22900,
22901,
23322,
23323,
23922,
23923,
25101,
25102,
25137,
25138,
25696,
25697,
26479,
26480,
26869,
26870,
27583,
27584,
28511,
28512,
29093,
29094,
29878,
29879,
30628,
30629,
31052,
31053,
32293,
32294,
33003,
33004,
34084,
34085,
35015,
35016,
35528,
35529,
35981,
35982,
36654,
36655,
37114,
37115,
37423,
37424,
38076,
38077,
38720,
38721,
39542,
39543,
40550,
40551,
41362,
41363,
41752,
41753,
43047,
43048,
43084,
43085,
43546,
43547,
43948,
43949,
44273,
44274,
44755,
44756,
45166,
45167,
45468,
45469,
46058,
46059,
46823,
46824,
47248,
47249,
47873,
47874,
47902,
47903,
48362,
48363,
49154,
49155,
49961,
49962,
50266,
50267,
50676,
50677,
51182,
51183,
51901,
51902,
52315,
52316,
52896,
52897,
53498,
53499,
54573,
54574,
55353,
55354,
56323,
56324,
56862,
56863,
57546,
57547,
58393,
58394,
58965,
58966,
59586,
59587,
60204,
60205,
60765,
60766,
61451,
61452,
61942,
61943,
62761,
62762,
63345,
63346,
63645,
63646,
63969,
63970,
64617,
64618,
65359,
65360,
66330,
66331,
67308,
67309,
67698,
67699,
68050,
68051,
68850,
68851,
70204,
70205,
70746,
70747,
71515,
71516,
72584,
72585,
72894,
72895,
73285,
73286,
74087,
74088,
74942,
74943,
74966,
74967,
75879,
75880,
76066,
76067,
76316,
76317,
76730,
76731,
76980,
76981,
77697,
77698,
78338,
78339,
78781,
78782,
79140,
79141,
79457,
79458,
80296,
80297,
80942,
80943,
81124,
81125,
81540,
81541,
82085,
82086,
82639,
82640,
82779,
82780,
83215,
83216,
83430,
83431,
83998,
83999,
84862,
84863,
85405,
85406,
85877,
85878,
86364,
86365,
86914,
86915,
87584,
87585,
87842,
87843,
88263,
88264,
88743,
88744,
89312,
89313,
89722,
89723,
90398,
90399,
90787,
90788,
91219,
91220,
91592,
91593,
91889,
91890,
92562,
92563,
92816,
92817,
93279,
93280,
93839,
93840,
94013,
94014,
94489,
94490,
94981,
94982,
95793,
95794,
96018,
96019,
96626,
96627,
97219,
97220,
97628,
97629,
98027,
98028,
98771,
98772,
99133,
99134,
99420,
99421,
100006,
100007,
100311,
100312,
100660,
100661,
100997,
100998,
101452,
101453,
102120,
102121,
102502,
102503,
102864,
102865,
103498,
103499,
103510,
103511,
103879,
103880,
103892,
103893,
103913,
104074,
104128,
104424,
104488,
104744,
104863,
105067,
105321,
105550,
105892,
106109,
106276,
106383,
106500,
106730,
106906,
107195,
107471,
107709,
108006,
108053,
108143,
108258,
108357,
108442,
108638,
108763,
108909,
109090,
109275,
109442,
109654,
110057,
110219,
110314,
110413,
110527,
110818,
110941,
111074,
111216,
111536,
111911,
111946,
111970,
112019,
112161,
112329,
112527,
112815,
112984,
113153,
113200,
113357,
113524,
113757,
113977,
114254,
114475,
114714,
115022,
115264,
115463,
115593,
116169,
116273,
116274,
116300,
116301,
116352,
116438,
116439,
116474,
116475,
116526,
116612,
116706,
116707,
116724,
116725,
116761,
116809,
116854,
116855,
116862,
116863,
116875,
116876,
116900,
116901,
116952,
117056,
117057,
117076,
117077,
117090,
117114,
117115,
117128,
117129,
117173,
117238,
117327,
117496,
117593,
117594,
117627,
117628,
117672,
117737,
117851,
117956,
118079,
118197,
118314,
118435,
118609,
118730,
118874,
119004,
119142,
119143,
119158,
119159,
119203,
119268,
119399,
119489,
119628,
119756,
119916,
120016,
120132,
120265,
120374,
120482,
120602,
120702,
120918,
121029,
121186,
121260,
121372,
121474,
121573,
121700,
121901,
122019,
122151,
122253,
122362,
122450,
122581,
122704,
122845,
122970,
123085,
123210,
123297,
123430,
123540,
123641,
123769,
123889,
124133,
124304,
124412,
124506,
124622,
124724,
124863,
125096,
125244,
125417,
125535,
125653,
125777,
125882,
126020,
126101,
126102,
126124,
126125,
126169,
126234,
126365,
126496,
126644,
126734,
126873,
127001,
127234,
127394,
127481,
127597,
127708,
127808,
127910,
128019,
128146,
128254,
128354,
128487,
128703,
128823,
128933,
129042,
129199,
129322,
129396,
129508,
129610,
129709,
129953,
130140,
130341,
130459,
130591,
130679,
130797,
130938,
131063,
131178,
131303,
131404,
131543,
131676,
131800,
131920,
132048,
132219,
132324,
132432,
132526,
132642,
132723,
132825,
132998,
133116,
133254,
133255,
133280,
133281,
133325,
133331,
133581,
133730,
133877,
134025,
134172,
134260,
134348,
134613,
134878,
134879,
134892,
134893,
134937,
135002,
135091,
135188,
135357,
135358,
135376,
135377,
135413,
135445,
135446,
135464,
135465,
135500,
135582,
135706,
135864,
135922,
136005,
136086,
136193,
136256,
136339,
136441,
136558,
136615,
136720,
136843,
137022,
137083,
137112,
137192,
137265,
137423,
137541,
137641,
137687,
137721,
137753,
137754,
137767,
137768,
137796,
137810,
137811,
137857,
137858,
138054,
138055,
138096,
138097,
138129,
138130,
138147,
138148,
138170
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 138170,
"ccnet_original_nlines": 771,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.36788511276245117,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.022454310208559036,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.20331965386867523,
"rps_doc_frac_unique_words": 0.1116616427898407,
"rps_doc_mean_word_length": 5.042565822601318,
"rps_doc_num_sentences": 1030,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.827524662017822,
"rps_doc_word_count": 22201,
"rps_doc_frac_chars_dupe_10grams": 0.22294774651527405,
"rps_doc_frac_chars_dupe_5grams": 0.4435730278491974,
"rps_doc_frac_chars_dupe_6grams": 0.354819118976593,
"rps_doc_frac_chars_dupe_7grams": 0.2974720895290375,
"rps_doc_frac_chars_dupe_8grams": 0.2676551938056946,
"rps_doc_frac_chars_dupe_9grams": 0.2464582473039627,
"rps_doc_frac_chars_top_2gram": 0.0352746807038784,
"rps_doc_frac_chars_top_3gram": 0.02563644014298916,
"rps_doc_frac_chars_top_4gram": 0.014006249606609344,
"rps_doc_books_importance": -11645.654296875,
"rps_doc_books_importance_length_correction": -11645.654296875,
"rps_doc_openwebtext_importance": -6519.73046875,
"rps_doc_openwebtext_importance_length_correction": -6519.73046875,
"rps_doc_wikipedia_importance": -4726.7216796875,
"rps_doc_wikipedia_importance_length_correction": -4726.7216796875
},
"fasttext": {
"dclm": 0.0482519306242466,
"english": 0.887116014957428,
"fineweb_edu_approx": 2.1171681880950928,
"eai_general_math": 0.11524199694395065,
"eai_open_web_math": 0.09182106703519821,
"eai_web_code": 0.07748907804489136
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "658.8",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v1": {
"primary": {
"code": "11",
"label": "Legal/Regulatory"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "11",
"label": "Legal Notices"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "4",
"label": "Advanced Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "5",
"label": "Exceptionally Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-3,664,169,685,659,025,400 |
print image file from page link?
This tutorial about printing from javascript:
http://nice-tutorials.blogspot.com/2009/05/print-using-javascript.html
gave me an idea.
He talks about printing a hidden image on a page by creating a print preview window and letting the user print it out. I don't understand all of it, but I like the idea of sending an image straight to print preview.
I have a small image on my web page, and the user needs to be able to print a full size copy.
It would be nice to have a set up where the user clicks on the image, and the print preview comes up displaying a different image file (a larger version of what's on the page).
So something like:
<A <!-- javascript here to pop up print preview of full-size.jpg -->><IMG SRC="small-size.jpg"></A>
Is it possible to go straight to print preview like that, and if so, can you write it?
Thank you, Chris
St_Aug_Beach_BumAsked:
Who is Participating?
I wear a lot of hats...
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Michel PlungjanIT ExpertCommented:
Sure
<a href="bigimage.jpg" target="printwin"
onClick="return printIt(this)"><img src="thumbnail.jpg" border="0" /></a>
<script>
function printIt(link) {
var w=window.open("",link.target,"width=500,height=500");
if(w) {
w.document.write('<body onload="window.focus(); window.print()">'+
'<a href="#" onClick="window.close(); return false"><img title="Click to close" src="'+link.href+'" /></a>'+
'</body>');
w.document.close();
return false; // cancel link
}
return true; /* follow link, user has a popup blocker and needs to print the new window himself */
}
</script>
Open in new window
0
Experts Exchange Solution brought to you by
Your issues matter to us.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Start your 7-day free trial
St_Aug_Beach_BumAuthor Commented:
mplungjan,
I'm very sorry, I don't know why I didn't get back and get these points to you earlier.
0
Michel PlungjanIT ExpertCommented:
Np. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript
From novice to tech pro — start learning today.
|
{
"url": "https://www.experts-exchange.com/questions/24549639/print-image-file-from-page-link.html",
"source_domain": "www.experts-exchange.com",
"snapshot_id": "crawl=CC-MAIN-2018-39",
"warc_metadata": {
"Content-Length": "110354",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:24LYY5PAZDOPEHSWTUIRJDK4Q26W46U2",
"WARC-Concurrent-To": "<urn:uuid:45a0c61c-5d42-4986-94f0-f6984f7a1eba>",
"WARC-Date": "2018-09-26T02:33:37Z",
"WARC-IP-Address": "104.20.169.10",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:2IQMRXSEGVMHFDLBEUFNOO6KXYAOWJTQ",
"WARC-Record-ID": "<urn:uuid:d938e93e-c9ac-46f6-83bb-8be0ffddfd06>",
"WARC-Target-URI": "https://www.experts-exchange.com/questions/24549639/print-image-file-from-page-link.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:7dcf5daf-6e8a-4c4c-b675-3bbace9560fd>"
},
"warc_info": "isPartOf: CC-MAIN-2018-39\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2018\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-157-187-24.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
33,
34,
80,
81,
152,
153,
170,
171,
388,
389,
485,
486,
663,
664,
683,
684,
784,
785,
872,
873,
892,
915,
937,
961,
962,
1327,
1328,
1363,
1368,
1409,
1483,
1492,
1517,
1577,
1588,
1659,
1774,
1792,
1816,
1849,
1853,
1954,
1956,
1966,
1967,
1986,
1987,
1989,
1990,
2034,
2035,
2061,
2062,
2216,
2217,
2245,
2279,
2290,
2291,
2381,
2383,
2418,
2429,
2431,
2825,
2836,
2837
],
"line_end_idx": [
33,
34,
80,
81,
152,
153,
170,
171,
388,
389,
485,
486,
663,
664,
683,
684,
784,
785,
872,
873,
892,
915,
937,
961,
962,
1327,
1328,
1363,
1368,
1409,
1483,
1492,
1517,
1577,
1588,
1659,
1774,
1792,
1816,
1849,
1853,
1954,
1956,
1966,
1967,
1986,
1987,
1989,
1990,
2034,
2035,
2061,
2062,
2216,
2217,
2245,
2279,
2290,
2291,
2381,
2383,
2418,
2429,
2431,
2825,
2836,
2837,
2884
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2884,
"ccnet_original_nlines": 67,
"rps_doc_curly_bracket": 0.0013869600370526314,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.30236220359802246,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.022047240287065506,
"rps_doc_frac_lines_end_with_ellipsis": 0.014705879613757133,
"rps_doc_frac_no_alph_words": 0.24881890416145325,
"rps_doc_frac_unique_words": 0.5399060845375061,
"rps_doc_mean_word_length": 5.068075180053711,
"rps_doc_num_sentences": 44,
"rps_doc_symbol_to_word_ratio": 0.003149610012769699,
"rps_doc_unigram_entropy": 5.060670375823975,
"rps_doc_word_count": 426,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.02964334934949875,
"rps_doc_frac_chars_dupe_6grams": 0.013895319774746895,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.02779063954949379,
"rps_doc_frac_chars_top_3gram": 0.008337190374732018,
"rps_doc_frac_chars_top_4gram": 0.0203798096626997,
"rps_doc_books_importance": -229.42189025878906,
"rps_doc_books_importance_length_correction": -229.42189025878906,
"rps_doc_openwebtext_importance": -135.26034545898438,
"rps_doc_openwebtext_importance_length_correction": -135.26034545898438,
"rps_doc_wikipedia_importance": -103.87374877929688,
"rps_doc_wikipedia_importance_length_correction": -103.87374877929688
},
"fasttext": {
"dclm": 0.06436269730329514,
"english": 0.8633546233177185,
"fineweb_edu_approx": 1.0875115394592285,
"eai_general_math": 0.014879230409860611,
"eai_open_web_math": 0.0732526183128357,
"eai_web_code": 0.003779290011152625
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,165,446,801,120,157,700 |
12 is what percent of 14?
Answer: 12 is 85.714 percent of 14
Fastest method for calculating 12 is what percent of 14
Assume the unknown value is 'Y', and 12 of 14 can be written as:
Y = 12 / 14
By multiplying both numerator and denominator by 100 we will get:
Y = 12 / 14 x 100 / 100 = 85.714 / 100
Y = 85.714%
Answer: 12 is 85.714 percent of 14
If you want to use a calculator, simply enter 12÷14x100 and you will get your answer which is 85.714
You may also be interested in:
Here is a calculator to solve percentage calculations such as 12 is what percent of 14. You can solve this type of calculation with your own values by entering them into the calculator's fields, and click 'Calculate' to get the result and explanation.
is what percent of
?
%
Have time and want to learn the details?
Let's solve the equation for Y by first rewriting it as: 100% / 14 = Y% / 12
Drop the percentage marks to simplify your calculations: 100 / 14 = Y / 12
Multiply both sides by 12 to isolate Y on the right side of the equation: 12 ( 100 / 14 ) = Y
Computing the left side, we get: 85.714 = Y
This leaves us with our final answer: 12 is 85.714 percent of 14
Similar calculation
|
{
"url": "https://percentage-calculator.net/x-is-what-percent-of-y/12-is-what-percent-of-14.php",
"source_domain": "percentage-calculator.net",
"snapshot_id": "crawl=CC-MAIN-2020-50",
"warc_metadata": {
"Content-Length": "59532",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:GJK47OOHTEQWZE4URL4HVQGTEPTUJYVY",
"WARC-Concurrent-To": "<urn:uuid:a8f709ea-186e-4bb3-b65f-5420409dcb3d>",
"WARC-Date": "2020-11-30T19:35:09Z",
"WARC-IP-Address": "68.66.224.6",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:NASZ4VNGL2OOXP2TI2KTLCV4CXF5GON5",
"WARC-Record-ID": "<urn:uuid:4bd00115-2458-43ad-b815-a8940a712a38>",
"WARC-Target-URI": "https://percentage-calculator.net/x-is-what-percent-of-y/12-is-what-percent-of-14.php",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:083db621-aff7-4818-a894-30431ac94318>"
},
"warc_info": "isPartOf: CC-MAIN-2020-50\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-88.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
26,
27,
62,
63,
119,
120,
185,
186,
198,
199,
265,
266,
305,
306,
318,
319,
354,
355,
456,
457,
488,
489,
741,
742,
761,
763,
765,
766,
807,
808,
885,
886,
961,
962,
1056,
1057,
1101,
1102,
1167,
1168
],
"line_end_idx": [
26,
27,
62,
63,
119,
120,
185,
186,
198,
199,
265,
266,
305,
306,
318,
319,
354,
355,
456,
457,
488,
489,
741,
742,
761,
763,
765,
766,
807,
808,
885,
886,
961,
962,
1056,
1057,
1101,
1102,
1167,
1168,
1187
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1187,
"ccnet_original_nlines": 40,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3510638177394867,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03546098992228508,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3617021441459656,
"rps_doc_frac_unique_words": 0.4285714328289032,
"rps_doc_mean_word_length": 4.036866188049316,
"rps_doc_num_sentences": 13,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.10488748550415,
"rps_doc_word_count": 217,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.15410959720611572,
"rps_doc_frac_chars_dupe_6grams": 0.15410959720611572,
"rps_doc_frac_chars_dupe_7grams": 0.0890410989522934,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0719178095459938,
"rps_doc_frac_chars_top_3gram": 0.07534246891736984,
"rps_doc_frac_chars_top_4gram": 0.06849315017461777,
"rps_doc_books_importance": -85.11836242675781,
"rps_doc_books_importance_length_correction": -85.11836242675781,
"rps_doc_openwebtext_importance": -55.43727111816406,
"rps_doc_openwebtext_importance_length_correction": -55.39494323730469,
"rps_doc_wikipedia_importance": -27.295291900634766,
"rps_doc_wikipedia_importance_length_correction": -27.295291900634766
},
"fasttext": {
"dclm": 0.3866809606552124,
"english": 0.9299189448356628,
"fineweb_edu_approx": 2.689882755279541,
"eai_general_math": 0.841917872428894,
"eai_open_web_math": 0.7389132976531982,
"eai_web_code": 0.010966300033032894
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "513.2",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,432,966,073,180,036,000 |
Windows 7 RDP in a workgroup
#1
I have two machines running Windows 7 pro in a workgroup. PC A RDP's to PC B over port 3398 and has been working for months. As of this week the connection has failed access denied over port 3398. Nothing has changed as far as I know.
Any thoughts?
kemical
Windows Forum Admin
Staff member
Premium Supporter
#2
Have you checked for malware?
#3
I have not, I will be checking tonight. Thank you.
Trouble
Noob Whisperer
#4
In your OP you sited port 3398. I don't know if that is a typo (if so you typo'd it twice). The default listening port for RDP is 3389 not 3398 and is controlled here in the Windows Registry;
(left pane) HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Terminal Server\WinStations\RDP-Tcp
(right pane) PortNumber REG_DWORD 0x00000d3d (3389)
SOURCE: How to change the listening port for Remote Desktop
If for some reason you have changed the default port number on either machine, it needs to be reflected in you mstsc call to that machine like;
192.168.1.222:3398
Also you might want to review this regarding the use of port 3398 and perhaps choose another higher port number if it is your intent to use something other than the default port number, something like 8888 or 8886 etc., I've used both successfully in the past.
#5
Yes, I noticed I swapped the last two numbers. I was able to fix it by removing PC B from the workgroup then adding it back. Don't know why but it started working again. Thanks.
Trouble
Noob Whisperer
#6
Good to hear that you were able to resolve your problem and thanks for posting back and updating your thread.
Sounds like it may have been a problem with the NetBIOS cache on one of or both machine(s). The NetBIOS mechanism attempts to resolve friendly names (computer host names) to IP Adresses and can often take some time to refresh itself with up to date accurate information. Sometimes you can use the ping command to force an update by pinging the ip address (using the -a switch to determine the host name) and then the host name. You can then view the local machines NetBIOS name cache content by typing
nbtstat -c
at the command prompt
Usually using IP addresses instead of host names when connecting through RDP is more reliable and using static IP address assignments is even more reliable yet.
Thanks for joining our community and we hope to continue to see you around.
Regards
Randy
#7
Thank you for that explanation. I totally understand that know!
Thanks again.
This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.
Top
|
{
"url": "https://windowsforum.com/threads/windows-7-rdp-in-a-workgroup.71770/",
"source_domain": "windowsforum.com",
"snapshot_id": "crawl=CC-MAIN-2018-26",
"warc_metadata": {
"Content-Length": "62149",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:ETQEEQ5N5SMSVSWREJ6EYQNNG3NF6SNJ",
"WARC-Concurrent-To": "<urn:uuid:6e2ce17a-c1f5-4037-9735-7043b844dc91>",
"WARC-Date": "2018-06-19T18:38:04Z",
"WARC-IP-Address": "104.196.9.116",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:FCVDPJM4EY3VHZ3E666XCYAOVIW77L6G",
"WARC-Record-ID": "<urn:uuid:8560b33e-40bc-4d8d-a55f-f100f84e8d59>",
"WARC-Target-URI": "https://windowsforum.com/threads/windows-7-rdp-in-a-workgroup.71770/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:5a54b8c8-4397-4154-af55-613b9b9c896f>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-169-43-15.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-26\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for June 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
29,
30,
33,
268,
282,
284,
285,
286,
294,
295,
315,
328,
346,
349,
379,
381,
382,
383,
386,
437,
439,
440,
441,
449,
450,
465,
468,
660,
759,
811,
812,
872,
1016,
1035,
1296,
1298,
1299,
1300,
1303,
1481,
1483,
1484,
1485,
1493,
1494,
1509,
1512,
1622,
2124,
2135,
2157,
2318,
2394,
2402,
2408,
2410,
2411,
2412,
2415,
2479,
2493,
2495,
2496,
2497,
2623
],
"line_end_idx": [
29,
30,
33,
268,
282,
284,
285,
286,
294,
295,
315,
328,
346,
349,
379,
381,
382,
383,
386,
437,
439,
440,
441,
449,
450,
465,
468,
660,
759,
811,
812,
872,
1016,
1035,
1296,
1298,
1299,
1300,
1303,
1481,
1483,
1484,
1485,
1493,
1494,
1509,
1512,
1622,
2124,
2135,
2157,
2318,
2394,
2402,
2408,
2410,
2411,
2412,
2415,
2479,
2493,
2495,
2496,
2497,
2623,
2626
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2626,
"ccnet_original_nlines": 65,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.40665432810783386,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05360443890094757,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.17744916677474976,
"rps_doc_frac_unique_words": 0.5232815742492676,
"rps_doc_mean_word_length": 4.576496601104736,
"rps_doc_num_sentences": 31,
"rps_doc_symbol_to_word_ratio": 0.012938999570906162,
"rps_doc_unigram_entropy": 5.0921406745910645,
"rps_doc_word_count": 451,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.015503879636526108,
"rps_doc_frac_chars_top_3gram": 0.01162790972739458,
"rps_doc_frac_chars_top_4gram": 0.019379839301109314,
"rps_doc_books_importance": -224.67266845703125,
"rps_doc_books_importance_length_correction": -224.67266845703125,
"rps_doc_openwebtext_importance": -140.49276733398438,
"rps_doc_openwebtext_importance_length_correction": -140.49276733398438,
"rps_doc_wikipedia_importance": -88.53675842285156,
"rps_doc_wikipedia_importance_length_correction": -88.53675842285156
},
"fasttext": {
"dclm": 0.028914330527186394,
"english": 0.9399868845939636,
"fineweb_edu_approx": 1.0754354000091553,
"eai_general_math": 0.041707221418619156,
"eai_open_web_math": 0.19110602140426636,
"eai_web_code": 0.0033503801096230745
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.445",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.162",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,355,098,325,952,706,000 |
ultrabowser ultrabowser - 1 year ago 48
Java Question
Java best practice: filename of File as argument constructor
Should I make a constructor take on a
File
or a
String
with a filename when I want to read the content the new file is supposed to contain from a file?
public GraphModel(File file) throws IOException {
this();
readFromFile(file);
}
versus
public GraphModel(String filename) throws IOException {
this();
readFromFile(new File(filename));
}
Is there a best way that is obvious?
Answer Source
Imho it's not important. I've often overloaded the constructor and let the constructor with the String parameter call the one with the File parameter to allow for both. Which won't work of course if you want to call the parameterless constructor as well. Otherwise it's like
public final class GraphFile {
private final File file;
GraphFile(String fileName) {
this(new File(fileName));
}
GraphFile(File file) {
this.file=file;
}
public GraphModel read() throws IOException {
return whatEverReadsYourGraphModel(file);
}
}
|
{
"url": "https://codedump.io/share/NflFpsTNskBd/1/java-best-practice-filename-of-file-as-argument-constructor",
"source_domain": "codedump.io",
"snapshot_id": "crawl=CC-MAIN-2017-34",
"warc_metadata": {
"Content-Length": "39086",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:RLVBC4C2O55UAYEEP3UWU63LZB5EWZXE",
"WARC-Concurrent-To": "<urn:uuid:85e5e6af-1da9-49d0-917c-299a7166f4d4>",
"WARC-Date": "2017-08-18T14:38:52Z",
"WARC-IP-Address": "84.22.103.185",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:P5WF373YJ7QE55IV2IE3R6YQCDWAFN7A",
"WARC-Record-ID": "<urn:uuid:16279251-cfbb-4a1b-a6ba-8b269312b72d>",
"WARC-Target-URI": "https://codedump.io/share/NflFpsTNskBd/1/java-best-practice-filename-of-file-as-argument-constructor",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3ab6936e-2d6f-42c2-9228-64348e6f12f0>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-164-5-158.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-34\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for August 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
40,
54,
55,
116,
117,
155,
156,
161,
166,
173,
270,
271,
321,
329,
349,
351,
352,
353,
360,
361,
417,
425,
459,
461,
462,
463,
500,
501,
515,
516,
791,
792,
823,
824,
853,
854,
887,
921,
927,
928,
955,
979,
985,
986,
1036,
1086,
1092
],
"line_end_idx": [
40,
54,
55,
116,
117,
155,
156,
161,
166,
173,
270,
271,
321,
329,
349,
351,
352,
353,
360,
361,
417,
425,
459,
461,
462,
463,
500,
501,
515,
516,
791,
792,
823,
824,
853,
854,
887,
921,
927,
928,
955,
979,
985,
986,
1036,
1086,
1092,
1093
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1093,
"ccnet_original_nlines": 47,
"rps_doc_curly_bracket": 0.010978960432112217,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3140096664428711,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01449275016784668,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2415458858013153,
"rps_doc_frac_unique_words": 0.6083915829658508,
"rps_doc_mean_word_length": 5.671328544616699,
"rps_doc_num_sentences": 7,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.222833633422852,
"rps_doc_word_count": 143,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0628853291273117,
"rps_doc_frac_chars_top_3gram": 0.05178792029619217,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -112.45094299316406,
"rps_doc_books_importance_length_correction": -112.45094299316406,
"rps_doc_openwebtext_importance": -57.42924499511719,
"rps_doc_openwebtext_importance_length_correction": -47.9316520690918,
"rps_doc_wikipedia_importance": -38.05213165283203,
"rps_doc_wikipedia_importance_length_correction": -38.05213165283203
},
"fasttext": {
"dclm": 0.8366002440452576,
"english": 0.7817935347557068,
"fineweb_edu_approx": 1.375981330871582,
"eai_general_math": 0.3774242401123047,
"eai_open_web_math": 0.06331408023834229,
"eai_web_code": 0.2713078260421753
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1332",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,830,043,516,634,687,500 |
5
$\begingroup$
I would like build a web application using R. I am using Windows Vista and have an Apache server. I have tried Rpad, but I was not able to correctly configure it. How do I set up Rpad as I am not that well off with PHP and Apache server? Or are there other ways to use R on Apache server?
$\endgroup$
2
10
$\begingroup$
Here is the easiest way to do it that I found:
This implementation of PHP and R consists of only two files. One written in PHP, and the other an R script. The PHP returns a form which uses the GET method to send a variable N to the server. When the form is submitted, the PHP will then execute an R script from the shell using a combination of the PHP command exec() and the Rscript shell command. This command will pass the variable N to the R script. The R script will then execute and save a histogram plot of N normally distributed values to the filesystem. Finally, when the R script is complete, the PHP will return the HTML tag containing the saved images path. First, the PHP file
< ?php
// poorman.php
echo "< form action='poorman.php' method='get'>";
echo "Number values to generate: < input type='text' name='N' />";
echo "< input type='submit' />";
echo "< /form>";
if( isset($_GET['N']))
{
$N = $_GET['N'];
// execute R script from shell
// this will save a plot at temp.png to the filesystem
exec("Rscript my_rscript.R $N");
// return image tag
$nocache = rand();
echo("< img src='temp.png?$nocache' /> ");
}
?>
and the R script
# my_rscript.R
args <- commandArgs(TRUE)
N <- args[1]
x <- rnorm(N,0,1)
png(filename="temp.png", width=500, height=500)
hist(x, col="lightblue")
dev.off()
Here are some more you are welcome to try:
1. http://danpolant.com/r-integration-with-php/
2. http://steve-chen.net/document/r/r_php
$\endgroup$
2
• $\begingroup$ +1, I can confirm that this works and it is very simple. I used it in my pretty complicated project: jQuery+PHP+R. $\endgroup$
– mpiktas
Feb 4 '11 at 6:53
• 1
$\begingroup$ Above answer copy and pasted from here: r-bloggers.com/integrating-php-and-r $\endgroup$
– b_dubb
Jun 16 '15 at 21:46
8
$\begingroup$
If you ever think to switch to Linux, the best way would be to use RApache, which is an Apache module that embeds an R interpreter (mod_R) in the webserver
$\endgroup$
3
$\begingroup$
If you are looking for a way of executing chunks of R code from PHP, here is a library that might help:
https://github.com/kachkaev/php-r
use Kachkaev\PHPR\RCore;
use Kachkaev\PHPR\Engine\CommandLineREngine;
$r = new RCore(new CommandLineREngine('/usr/bin/R'));
$result = $r->run('1 + 1');
echo $result;
This will output:
> 1 + 1
[1] 2
$\endgroup$
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "https://stats.stackexchange.com/questions/4279/how-can-i-integrate-r-with-php/4283#4283",
"source_domain": "stats.stackexchange.com",
"snapshot_id": "crawl=CC-MAIN-2021-49",
"warc_metadata": {
"Content-Length": "136557",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:S4LD6MPG4ZCLNPDQDW2TSNNTGBZBTTDH",
"WARC-Concurrent-To": "<urn:uuid:80cb4cbe-53cb-49fc-b060-e64f78c5a822>",
"WARC-Date": "2021-12-07T12:51:33Z",
"WARC-IP-Address": "151.101.193.69",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:EOZWCKXSUBHLVUEPRYDO4AQ5TO5CGJ2I",
"WARC-Record-ID": "<urn:uuid:e7804243-affb-4b53-ae70-f3ddcd9cc157>",
"WARC-Target-URI": "https://stats.stackexchange.com/questions/4279/how-can-i-integrate-r-with-php/4283#4283",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:cf8ab8a2-fc03-4b40-a0a8-77307c104f97>"
},
"warc_info": "isPartOf: CC-MAIN-2021-49\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-203\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
2,
16,
17,
306,
307,
319,
321,
324,
338,
339,
386,
387,
1029,
1030,
1037,
1057,
1111,
1182,
1219,
1241,
1268,
1270,
1289,
1290,
1327,
1384,
1385,
1420,
1421,
1443,
1444,
1465,
1466,
1515,
1521,
1524,
1525,
1542,
1543,
1563,
1594,
1611,
1634,
1682,
1711,
1721,
1722,
1765,
1766,
1816,
1817,
1861,
1862,
1874,
1876,
2021,
2035,
2057,
2063,
2170,
2183,
2207,
2209,
2223,
2224,
2380,
2381,
2393,
2395,
2409,
2410,
2514,
2515,
2549,
2550,
2575,
2620,
2621,
2675,
2703,
2717,
2718,
2736,
2737,
2745,
2751,
2763,
2764
],
"line_end_idx": [
2,
16,
17,
306,
307,
319,
321,
324,
338,
339,
386,
387,
1029,
1030,
1037,
1057,
1111,
1182,
1219,
1241,
1268,
1270,
1289,
1290,
1327,
1384,
1385,
1420,
1421,
1443,
1444,
1465,
1466,
1515,
1521,
1524,
1525,
1542,
1543,
1563,
1594,
1611,
1634,
1682,
1711,
1721,
1722,
1765,
1766,
1816,
1817,
1861,
1862,
1874,
1876,
2021,
2035,
2057,
2063,
2170,
2183,
2207,
2209,
2223,
2224,
2380,
2381,
2393,
2395,
2409,
2410,
2514,
2515,
2549,
2550,
2575,
2620,
2621,
2675,
2703,
2717,
2718,
2736,
2737,
2745,
2751,
2763,
2764,
2854
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2854,
"ccnet_original_nlines": 88,
"rps_doc_curly_bracket": 0.0007007700041867793,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.27913668751716614,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0748201385140419,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3381294906139374,
"rps_doc_frac_unique_words": 0.5023584961891174,
"rps_doc_mean_word_length": 4.686320781707764,
"rps_doc_num_sentences": 33,
"rps_doc_symbol_to_word_ratio": 0.0014388499548658729,
"rps_doc_unigram_entropy": 4.945385456085205,
"rps_doc_word_count": 424,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.02466028928756714,
"rps_doc_frac_chars_top_3gram": 0.02013085037469864,
"rps_doc_frac_chars_top_4gram": 0.014091599732637405,
"rps_doc_books_importance": -319.6565856933594,
"rps_doc_books_importance_length_correction": -319.6565856933594,
"rps_doc_openwebtext_importance": -176.73867797851562,
"rps_doc_openwebtext_importance_length_correction": -176.73867797851562,
"rps_doc_wikipedia_importance": -118.1438217163086,
"rps_doc_wikipedia_importance_length_correction": -118.1438217163086
},
"fasttext": {
"dclm": 0.16897910833358765,
"english": 0.7432951927185059,
"fineweb_edu_approx": 2.499760627746582,
"eai_general_math": 0.18613237142562866,
"eai_open_web_math": 0.0834730863571167,
"eai_web_code": 0.3245605230331421
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.136",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "1",
"label": "Leftover HTML"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-5,528,387,813,473,457,000 |
#1105 mod_vcard: Storage error not handled differently from empty store
Reporter Zash
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
• Priority-Medium
• Type-Defect
• Status-Accepted
1. Zash on
What steps will reproduce the problem? 1. Request a vCard 2. The storage driver fails to read the data for whatever reason What is the expected output? <internal-server-error> What do you see instead? <item-not-found> What version of the product are you using? On what operating system? Affects every version since forever. Please provide any additional information below.
New comment
|
{
"url": "https://prosody.im/issues/1105",
"source_domain": "prosody.im",
"snapshot_id": "crawl=CC-MAIN-2018-17",
"warc_metadata": {
"Content-Length": "5461",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:I4ENHHD7PVMWXRHQRJB5GAFBNBJXOGMG",
"WARC-Concurrent-To": "<urn:uuid:7d85333d-3509-4b9a-a306-5bc7b7e5af3d>",
"WARC-Date": "2018-04-19T17:25:20Z",
"WARC-IP-Address": "89.16.173.64",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:UYPQYLEPATE7HU4ZUQHUXQ2RGJGS3WOT",
"WARC-Record-ID": "<urn:uuid:bf87343d-f1c0-4c7e-83bd-36222c882f1a>",
"WARC-Target-URI": "https://prosody.im/issues/1105",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:afeaa575-d63c-4f94-a0b0-f11ab2afdb88>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-152-23-81.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-17\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for April 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
72,
73,
87,
100,
108,
116,
130,
135,
155,
171,
191,
204,
205,
582,
583
],
"line_end_idx": [
72,
73,
87,
100,
108,
116,
130,
135,
155,
171,
191,
204,
205,
582,
583,
594
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 594,
"ccnet_original_nlines": 15,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.22499999403953552,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.28333333134651184,
"rps_doc_frac_unique_words": 0.8068181872367859,
"rps_doc_mean_word_length": 5.2727274894714355,
"rps_doc_num_sentences": 11,
"rps_doc_symbol_to_word_ratio": 0.008333330042660236,
"rps_doc_unigram_entropy": 4.140774250030518,
"rps_doc_word_count": 88,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0258620698004961,
"rps_doc_frac_chars_top_3gram": 0,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -56.25365447998047,
"rps_doc_books_importance_length_correction": -70.2475814819336,
"rps_doc_openwebtext_importance": -30.655559539794922,
"rps_doc_openwebtext_importance_length_correction": -44.64948654174805,
"rps_doc_wikipedia_importance": -15.771443367004395,
"rps_doc_wikipedia_importance_length_correction": -29.765371322631836
},
"fasttext": {
"dclm": 0.6804487109184265,
"english": 0.8296915292739868,
"fineweb_edu_approx": 1.050306797027588,
"eai_general_math": 0.004530610051006079,
"eai_open_web_math": 0.3260751962661743,
"eai_web_code": -0.00000965999970503617
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,642,330,851,348,047,000 |
Ricardo_衍的个人主页-最近动态列表-最代码 - 龙8国际娱乐pt老虎机
最代码位
最近动态列表
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览问答1月15日
如何实现java读取本地文件夹在前端生成树形结构...
浏览42评论0牛币1回答3web网站开发
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览问答1月15日
30岁怎么办,要养家,要糊口,压力不见减少。体力越来越不行...
浏览126评论0牛币1回答4其他
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2019年10月15日
精美的前端界面...
精美的网页前端电子商城网站模板 精美的网页前端电子商城网站模板
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览博客2019年9月1日
每修改一下代码再去run一次实在是很麻烦啦,接触springboot不久,但既然用这个框架的,它所包含的特性什么的还是要充分利用,不能浪费呀!springboot的热部署网上有太多的教案,在此呢,也只是真实记录一下自己在实际操作过程中的方法步骤。1、pom.xml配置:这是一定要配置的,忘记吃饭都不...
spring boot 热更新、热加载(idea使用) spring boot 热更新、热加载(idea使用) spring boot 热更新、热加载(idea使用)
浏览211评论1
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2019年9月1日
项目描述基于javaweb技术的私人牙科诊所病例管理系统运行环境jdk7+tomcat7+mysql+eclipse4.5+jsp项目技术(必填)java+servlet+html+jqueryjar包文件压缩包自带龙8国际娱乐官方网站库文件链接:https://pan.baidu.com/s/15_vn2I0B-...
jsp+servlet开发java web私人牙科诊所病例管理系统项目 jsp+servlet开发java web私人牙科诊所病例管理系统项目 jsp+servlet开发java web私人牙科诊所病例管理系统项目
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2019年3月14日
项目描述SpringBoot+Mybatis+thymeleaf的Java博客系统开源运行环境jdk7+tomcat7+mysql+IntelliJ IDEA+mavena+redis项目技术(必填)spring+spring mvc+mybatis+bootstrap+jquery+redis龙8国际娱乐官方网站...
SpringBoot+Mybatis+thymeleaf搭建开源个人博客系统 SpringBoot+Mybatis+thymeleaf搭建开源个人博客系统 SpringBoot+Mybatis+thymeleaf搭建开源个人博客系统
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览博客2019年3月10日
现在爬龙8国际娱乐官方网站越来越难,各种反爬,龙8国际娱乐pt老虎机的网站没做什么反爬,就随便介绍下:1.随便找点网站弄点免费的http代理ip,去爬一下,太龙8国际娱乐pt老虎机就不介绍了,目前最好用的代理ip是蘑菇代理具体说下,稍微有点爬虫技术含量的吧,怎么样伪装自己的爬虫程序,尽量避免反爬:1.请求头的user-agent参数必不可少,而且!!...
浏览109评论0
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月26日
100多套HTML静态网页模板
浏览1488评论3下载565牛币2前端技术
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月26日
项目描述项目为B/S结构开发,分为【登陆】、【信息】、【活动】、【其他】四大模块,其中信【信息】模块分为【个人信息】与 【班级通讯录】模块,【活动】模块分为【班级相册】、【班级公告】模块,【其他】模块分为【修改密码】与【退出、注销】 模块。1、登录模块:使用Ajax后台验证登陆。用户密码已进行SHA...
基于SSM框架的B/S项目开发—学校班级回忆录网站管理系统 基于SSM框架的B/S项目开发—学校班级回忆录网站管理系统 基于SSM框架的B/S项目开发—学校班级回忆录网站管理系统
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月26日
基于ASP.NET 运用SQL龙8国际娱乐官方网站库 实现学校社团管理 增删改查 前后台 登录 布局鲜明...
ASP.NET开发学校社团风采网站源代码下载
浏览597评论3下载112牛币2web网站开发
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月26日
项目描述:项目思路:(1)先布局再CSS控制 (2)骨架搭好了,初始化样式, &n...
html实战-制作静态网页 html实战-制作静态网页 html实战-制作静态网页
浏览767评论0下载144牛币3前端技术
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月26日
项目描述一个web前端开发的龙8国际娱乐pt老虎机的网页设计内容关于胡歌简介实现了二级菜单跳转 以及轮播图等技术附文档设计说明书运行环境Dreamwear+浏览器项目技术(必填)html+css+javascript+jquery是否原创(转载必填原文地址)此网页本人原创,有何问题可以私信询问.项目截图(必填)运行截...
html+css+jquery开发关于胡歌的web前端网站模板 html+css+jquery开发关于胡歌的web前端网站模板 html+css+jquery开发关于胡歌的web前端网站模板
浏览998评论0下载155牛币3前端技术
Ricardo_衍的gravatar头像
Ricardo_衍 LV6下载分享代码2018年12月2日
{代码...}项目描述本案例用dubbo+zookeeper+springboot+mybatis搭建分布式架构,一个服务消费,两个服务提供,并支持轮询、随机的负载均衡策略。 案例很龙8国际娱乐pt老虎机,结构很清晰,适合小白学习。案例没有炫彩的页面,只是单单的访问连接,我们玩的是架构,不是炫彩的前端技术。运行环境jdk7+tom...
dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡 dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡 dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡
Ricardo_衍的gravatar头像
Ricardo_衍 LV6下载分享代码2018年12月2日
{代码...}dubbo-spring-boot-mybatis-redis搭建的分布式服务框架demo;没有dubbo zookeeper redis的安装,请不要下载;项目安装:1、首先安装zookeeper+redis;2、dearbinge-data-provider服务提供者项目的资...
dubbo+spring boot+mybatis+redis分布式框架项目实例demo dubbo+spring boot+mybatis+redis分布式框架项目实例demo dubbo+spring boot+mybatis+redis分布式框架项目实例demo
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月2日
{代码...}项目描述本案例用dubbo+zookeeper+springboot+mybatis搭建分布式架构,一个服务消费,两个服务提供,并支持轮询、随机的负载均衡策略。 案例很龙8国际娱乐pt老虎机,结构很清晰,适合小白学习。案例没有炫彩的页面,只是单单的访问连接,我们玩的是架构,不是炫彩的前端技术。运行环境jdk7+tom...
dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡 dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡 dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年12月2日
{代码...}dubbo-spring-boot-mybatis-redis搭建的分布式服务框架demo;没有dubbo zookeeper redis的安装,请不要下载;项目安装:1、首先安装zookeeper+redis;2、dearbinge-data-provider服务提供者项目的资...
dubbo+spring boot+mybatis+redis分布式框架项目实例demo dubbo+spring boot+mybatis+redis分布式框架项目实例demo dubbo+spring boot+mybatis+redis分布式框架项目实例demo
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年10月21日
开发环境:idea+java8+tomcat7+mysql+maven3.3.9考虑到有同学可能需要maven版的整合 ,这里就使用maven整合了一份(其实是差不多的)非maven版本ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存普通版:正确,示意图:第一...
ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存,基于maven搭建 ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存,基于maven搭建 ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存,基于maven搭建
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年10月21日
1.服务提供商2.服务消费商3.启动1).运行提供商TestMain,先启动提供商服务,效果:2).运行消费者TestMain,调用服务,效果:...
dubbo项目搭建实例(自己学习做的,新生借鉴就可以) dubbo项目搭建实例(自己学习做的,新生借鉴就可以) dubbo项目搭建实例(自己学习做的,新生借鉴就可以)
Ricardo_衍的gravatar头像
Ricardo_衍 LV6浏览分享2018年10月15日
DUBBO是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,是阿里巴巴SOA服务化治理方案的核心框架,每天为2,000+个服务提供3,000,000,000+次访问量支持,并被广泛应用于阿里巴巴集团的各成员站点。官网:http://dubbo.iogithub下载地址:http...
阿里巴巴SOA服务化治理方案的核心框架dubbo入门demo演示实例 阿里巴巴SOA服务化治理方案的核心框架dubbo入门demo演示实例 阿里巴巴SOA服务化治理方案的核心框架dubbo入门demo演示实例
浏览764评论1下载56牛币6web网站开发
Ricardo_衍的gravatar头像
Ricardo_衍 LV6下载分享代码2018年9月19日
项目描述Springboot开发的用户管理系统SpringbootCRM运行环境jdk8+tomcat8+mysql+eclipse+maven项目技术spring+springboot+mybatis+shiro+thymeleaf+adminlte+bootstrap+jquery龙8国际娱乐官方网站库文件链接...
Springboot开发的客户关系管理系统SpringbootCRM Springboot开发的客户关系管理系统SpringbootCRM Springboot开发的客户关系管理系统SpringbootCRM
Ricardo_衍 LV6
Ricardo_衍的gravatar头像
ID:200361
牛币:29
月亮星星星星
简介:
注册时间:2017-07-10 00:26:34
最近登录:2020-02-17 18:25:23
0
代码
0
问题
0
关注
0
粉丝
7
收藏
0
博客
顶部客服微信二维码底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友
龙8国际娱乐pt老虎机
|
{
"url": "http://www.5weekend.com/user/3453462459992064.htm",
"source_domain": "www.5weekend.com",
"snapshot_id": "crawl=CC-MAIN-2020-10",
"warc_metadata": {
"Content-Length": "64727",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:ZYL72EBXJWPKXZSMLJV4INZKE4SG2BHX",
"WARC-Concurrent-To": "<urn:uuid:9b4f1311-16b0-4a6e-8ebf-2a7851530d4e>",
"WARC-Date": "2020-02-25T18:09:13Z",
"WARC-IP-Address": "205.164.46.148",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:VWOFI4QK3DOWTHUMFPVV5O6UBET2MLNX",
"WARC-Record-ID": "<urn:uuid:cf88d2da-be18-437d-a1ad-58fd98b26b44>",
"WARC-Target-URI": "http://www.5weekend.com/user/3453462459992064.htm",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:c83b46a5-02b8-4411-b82e-a3ca537b0460>"
},
"warc_info": "isPartOf: CC-MAIN-2020-10\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for February 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-123.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
42,
47,
54,
75,
98,
126,
147,
168,
191,
225,
242,
263,
292,
303,
338,
359,
386,
540,
628,
637,
658,
685,
847,
959,
980,
1008,
1170,
1291,
1312,
1340,
1520,
1529,
1550,
1579,
1597,
1619,
1640,
1669,
1823,
1917,
1938,
1967,
2023,
2048,
2072,
2093,
2122,
2196,
2242,
2263,
2284,
2313,
2476,
2576,
2597,
2618,
2648,
2818,
3026,
3047,
3077,
3228,
3367,
3388,
3416,
3586,
3794,
3815,
3843,
3994,
4133,
4154,
4183,
4337,
4506,
4527,
4556,
4632,
4720,
4741,
4770,
4924,
5033,
5056,
5077,
5107,
5269,
5378,
5393,
5414,
5415,
5425,
5426,
5432,
5433,
5440,
5441,
5445,
5470,
5495,
5497,
5500,
5502,
5505,
5507,
5510,
5512,
5515,
5517,
5520,
5522,
5525,
5537,
5565,
5566
],
"line_end_idx": [
42,
47,
54,
75,
98,
126,
147,
168,
191,
225,
242,
263,
292,
303,
338,
359,
386,
540,
628,
637,
658,
685,
847,
959,
980,
1008,
1170,
1291,
1312,
1340,
1520,
1529,
1550,
1579,
1597,
1619,
1640,
1669,
1823,
1917,
1938,
1967,
2023,
2048,
2072,
2093,
2122,
2196,
2242,
2263,
2284,
2313,
2476,
2576,
2597,
2618,
2648,
2818,
3026,
3047,
3077,
3228,
3367,
3388,
3416,
3586,
3794,
3815,
3843,
3994,
4133,
4154,
4183,
4337,
4506,
4527,
4556,
4632,
4720,
4741,
4770,
4924,
5033,
5056,
5077,
5107,
5269,
5378,
5393,
5414,
5415,
5425,
5426,
5432,
5433,
5440,
5441,
5445,
5470,
5495,
5497,
5500,
5502,
5505,
5507,
5510,
5512,
5515,
5517,
5520,
5522,
5525,
5537,
5565,
5566,
5577
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5577,
"ccnet_original_nlines": 115,
"rps_doc_curly_bracket": 0.001434460049495101,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.0032751099206507206,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05021834000945091,
"rps_doc_frac_lines_end_with_ellipsis": 0.16379310190677643,
"rps_doc_frac_no_alph_words": 0.6375545859336853,
"rps_doc_frac_unique_words": 0.49047619104385376,
"rps_doc_mean_word_length": 23.47142791748047,
"rps_doc_num_sentences": 41,
"rps_doc_symbol_to_word_ratio": 0.025109170004725456,
"rps_doc_unigram_entropy": 4.16445255279541,
"rps_doc_word_count": 210,
"rps_doc_frac_chars_dupe_10grams": 0.2629336714744568,
"rps_doc_frac_chars_dupe_5grams": 0.27814972400665283,
"rps_doc_frac_chars_dupe_6grams": 0.27814972400665283,
"rps_doc_frac_chars_dupe_7grams": 0.2629336714744568,
"rps_doc_frac_chars_dupe_8grams": 0.2629336714744568,
"rps_doc_frac_chars_dupe_9grams": 0.2629336714744568,
"rps_doc_frac_chars_top_2gram": 0.1095556914806366,
"rps_doc_frac_chars_top_3gram": 0.04564819857478142,
"rps_doc_frac_chars_top_4gram": 0.10225197672843933,
"rps_doc_books_importance": -390.498779296875,
"rps_doc_books_importance_length_correction": -390.498779296875,
"rps_doc_openwebtext_importance": -253.07937622070312,
"rps_doc_openwebtext_importance_length_correction": -253.07937622070312,
"rps_doc_wikipedia_importance": -127.6690902709961,
"rps_doc_wikipedia_importance_length_correction": -127.6690902709961
},
"fasttext": {
"dclm": 0.038886670023202896,
"english": 0.01268802024424076,
"fineweb_edu_approx": 2.3978488445281982,
"eai_general_math": 0.00001669000084802974,
"eai_open_web_math": 0.06880217790603638,
"eai_web_code": 0.9367800354957581
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "1",
"label": "Factual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
8,587,023,417,347,328,000 |
Linux’ta Paket Yöneticileri
Linux'ta Paket YöneticileriKullanıcıların sonradan yazılım ekleyebildiği bütün işletim sistemlerinde programları kolayca yönetebildiğimiz araçlar bulunur. Bunlara paket yönetici denir.
“Akıllı” olarak tabir ettiğimiz mobil sistemlerden grafiksel arayüzü olmayan sunucu sistemlere kadar her çeşit işletim sisteminde mutlaka bir paket yönetici bulunur. Çünkü paket yöneticiler sayesinde:
– Paket yükleme işlemleri kolaylaşır.
– Paket kaldırma işlemleri kolaylaşır.
– Var olan paketlerin güncelleme işlemleri kolaylaşır.
– Sistemde yüklü olan/olmayan paketleri listeleme işi kolaylaşır.
– Programların çalışması için gerekli olan diğer programların yönetimi kolaylaşır.
Yani paket yöneticilerinin işini özetleyecek olursak, sistemimizdeki programların yönetimini kolaylaştırır. Ve son zamanlarda bu işi, basit listeleme şeklinden kurtarıp mağaza sisteminde yapan uygulamalar geliştiriliyor.
En yaygın Linux dağıtımlarındaki paket yöneticileri hem grafiksel hem de komut arayüzü açısından inceleyelim.
Ubuntu Linux
Debian tabanlı olduğu için dpkg isimli paket yönetici sistemini kullanıyor. Ubuntu dağıtımı grafiksel açıdan çok iyi durumda olan bir paket yönetici ve bir komut arayüzü ile geliyor.
Ubuntu Linux, Debian tabanlı olmasına ve deb paket yapısını kullanmasına karşın genellikle Debian aynı deb paketi kullanamazsınız. Mağazanın dışından paket kurulumunda ubuntu-deb olması konusuna dikkat etmeniz gerekir.
Diğer bir can sıkan konu ise, üstte görüntüsünü paylaştığım uygulama, paketleri tanıtmaktan daha çok bir market mantığı ile çalışıyor. Dilerseniz sisteminize aşağıda bahsedeceğim Synaptic veya gdebi uygulamalarını kurabilirsiniz.
Apt aracının tek tık ile kurulum desteği mevcut. Bunun için harici protokol desteği olan bir internet tarayıcı ile şu adresi çağırmanız yeterli: apt:<paketismi>
Komut arayüzü ile kullanımda aptitude ve apt-get isimli iki farklı uygulama olsa da aralarında aşırı bir fark bulunmamakta.
Paketi internetten yüklemek için: apt-get install <paket ismi>
Paketi yerel kaynaktan yüklemek için: dpkg -i <paket adresi ve ismi>
Paketi kaldırmak için: apt-get remove <paket ismi>
Sistemin paket listesini güncellemek için: apt-get update
Sistemi güncellemek için: apt-get upgrade
Linux Mint
Linux Mint, Ubuntu tabanlı olduğu için aynen Ubuntu gibi dpkg paket yönetim sistemini kullanıyor ve kendi yazılım yöneticisi:
Yanında ek olarak Debian’da kullanılan grafiksel paket yöneticisi Synaptic ile birlikte geliyor:
Yerel kaynaktan paket yüklemek için gdebi isimli araç kurulu halde:
Komut arayüzü ve tarayıcı desteği ise Ubuntu ile birebir aynı.
Kubuntu
Ubuntu tabanlı dağıtımda grafiksel uygulama dışında her şey tamamen aynı. Muon isimli uygulama Ubuntu’ya göre daha sade ve hızlı.
Lubuntu
Ubuntu tabanlı dağıtımda grafiksel uygulama dışında her şey tamamen aynı. Lubuntu Yazılım Merkezi oldukça hızlı. Sistemde Synaptic ve gdebi de kurulu halde geliyor.
Xubuntu
Ubuntu tabanlı dağıtımda grafiksel uygulama da dahil her şey Ubuntu ile tamamen aynı.
Debian
Debian dağıtımı kendine ait olan dpkg paket yönetici sistemi ile deb paket yapısını kullanıyor. Synaptic paket yöneticisi paketleri yönetmek için kullanılan temel grafiksel uygulama. Ayrıca gdebi de kurulu halde geliyor.
Ubuntu Linux farklı bir deb yapısı kullandığı için depolar dışında edindiğiniz paketlerin ubuntu-deb olmamasına dikkat etmeniz gerekir.
Komut arayüzü ise Ubuntu’dan farklı değil.
openSUSE
Red Hat tarafından geliştirilmiş olan rpm paket yapısını kullanmasına karşın kendi şirketi Novell’e ait olan ZYpp isimli paket yönetim altyapısını kullanıyor.
Grafiksel arayüz olarak YaST Kontrol Merkezinde çok başarılı bir yazılım yöneticisi var:
Pek çok dağıtımın desteklediği packagekit’e ait metin arabirimli uygulama kurulu halde geliyor.
Paket yüklemek için: pkcon install <paket ismi>
Paketi kaldırmak için: pkcon remove <paket ismi>
Sistemin paket listesini güncellemek için: pkcon get-updates
Sistemi güncellemek için: pkcon update
Komut arayüzü ile kullanımda kendine ait zypper aracı kullanılıyor:
Paket yüklemek için: zypper install <paket ismi>
Paketi kaldımak için: zypper remove <paket ismi>
Sistemin paket listesini güncellemek için: zypper refresh
Sistemi güncellemek için: zypper update
Fedora
Kendi sponsor şirketi Red Hat tarafından geliştirilmiş olan rpm paket yapısını kullanan dağıtımın paket yönetim sistemi yum. Grafik arabirimi olarak Yazılım Merkezi isimli bir araç mevcut.
Komut arayüzünde eskiden yum kullanılıyorken artık dnf aracı kullanılıyor. Temel komutlar aynı:
Paket yüklemek için: dnf install <paket ismi>
Paketi kaldırmak için: dnf remove <paket ismi>
Sistemin paket listesini güncellemek için: dnf check-update
Sistemi güncellemek için: dnf upgrade
Mageia
Mandriva’dan çatallanmış olan dağıtım rpm paket yapısını kullanıyor. Ancak paket yönetim sistemi urpmi. Grafiksel olarak Yazılım Yöneticisi isminde güzel bir araç var.
Komut arayüzü ile urpmi aracı kullanılıyor:
Paket yüklemek için: urpmi <paket ismi>
Paketi kaldırmak için: urpme <paket ismi>
Sistemin paket listesini güncellemek için: urpmi.update -a
Sistemi güncellemek için: urpmi –auto-select
CentOS
Fedora’nın eski sürümlerinde kullanılan yum aracını kullanıyor. CentOS’un kendine ait bir grafiksel uygulaması yok ancak EPEL depolarını ekleyerek Fedora’nın uygulamasını kullanabilirsiniz. CentOS sunucu amaçlı kullanımı ön plana çıkardığı için bence de pek gerekli değil.
Paket yüklemek için: yum install <paket ismi>
Paketi kaldırmak için: yum remove <paket ismi>
Sistemin paket listesini güncellemek için: yum check-update
Sistemi güncellemek için: yum upgrade
Manjaro
Arch Linux tabanlı dağıtım Pamac isimli listeleme yapabilen grafiksel uygulama ile geliyor.
Komut arabiriminde ise Arch Linux’a ait pacman aracını kullanıyor. Paketler tar olarak paketlenmiş halde.
Arch
Dağıtımın kurulumu özelleştirilebilir olduğu için birkaç grafik arabirimli paket yöneticiden birini kurabilirsiniz. Pamac iyi bir seçim olacaktır.
Komut arabiriminde pacman isimli kendine özel paket yönetim sistemi kullanılıyor.
Paket yüklemek için: pacman -S <paket ismi>
Paketi kaldırmak için: pacman -R <paket ismi>
Sistemin paket listesini güncellemek için: pacman -Sy
Sistemi güncellemek için: pacman -Syu
PCLinuxOS
Red Hat’e ait rpm paket yapısını Debian’a ait apt aracı ile kullanabilmek için ikisinin birleşimi apt-rpm isimli paket yönetim sistemini kullanan dağıtım, grafiksel olarak Synaptic uygulamasını kullanıyor.
Komut arabirimi Debian’a ait apt:
Paketi internetten yüklemek için: apt-get install <paket ismi>
Paketi kaldırmak için: apt-get remove <paket ismi>
Sistemin paket listesini güncellemek için: apt-get update
Sistemi güncellemek için: apt-get upgrade
Kolay gelsin.
Yorumlar 3
Bir cevap yazın
E-posta hesabınız yayımlanmayacak.
|
{
"url": "https://www.linuxdunyam.com/2015/08/paket-yoneticileri.html",
"source_domain": "www.linuxdunyam.com",
"snapshot_id": "crawl=CC-MAIN-2019-13",
"warc_metadata": {
"Content-Length": "50974",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:LBDO3BMLEGTHU5YPBKRYXUSAXID4YBWK",
"WARC-Concurrent-To": "<urn:uuid:0e66b13a-ad6c-4b84-ab3c-7651a020d9aa>",
"WARC-Date": "2019-03-19T08:49:07Z",
"WARC-IP-Address": "31.31.198.4",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:D6IMNSNLS5U5633AZHRFEXUO2JFPM6U4",
"WARC-Record-ID": "<urn:uuid:9370df91-0fcb-4611-9e49-ca9568fa70f3>",
"WARC-Target-URI": "https://www.linuxdunyam.com/2015/08/paket-yoneticileri.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:e64c1df7-35ee-4787-b6b8-0d91759dec8f>"
},
"warc_info": "isPartOf: CC-MAIN-2019-13\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for March 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-69-221-252.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
28,
29,
214,
215,
416,
417,
455,
494,
549,
615,
698,
699,
920,
921,
1031,
1032,
1045,
1046,
1229,
1230,
1449,
1450,
1680,
1681,
1842,
1843,
1967,
1968,
2031,
2100,
2151,
2209,
2251,
2252,
2263,
2264,
2390,
2391,
2488,
2489,
2557,
2558,
2621,
2622,
2630,
2631,
2761,
2762,
2770,
2771,
2936,
2937,
2945,
2946,
3032,
3033,
3040,
3041,
3262,
3263,
3399,
3400,
3443,
3444,
3453,
3454,
3613,
3614,
3703,
3704,
3800,
3801,
3849,
3898,
3959,
3998,
3999,
4067,
4068,
4117,
4166,
4224,
4264,
4265,
4272,
4273,
4462,
4463,
4559,
4560,
4606,
4653,
4713,
4751,
4752,
4759,
4760,
4928,
4929,
4973,
4974,
5014,
5056,
5115,
5160,
5161,
5168,
5169,
5442,
5443,
5489,
5536,
5596,
5634,
5635,
5643,
5644,
5736,
5737,
5843,
5844,
5849,
5850,
5997,
5998,
6080,
6081,
6125,
6171,
6225,
6263,
6264,
6274,
6275,
6481,
6482,
6516,
6517,
6580,
6631,
6689,
6731,
6732,
6746,
6747,
6758,
6759,
6775,
6776
],
"line_end_idx": [
28,
29,
214,
215,
416,
417,
455,
494,
549,
615,
698,
699,
920,
921,
1031,
1032,
1045,
1046,
1229,
1230,
1449,
1450,
1680,
1681,
1842,
1843,
1967,
1968,
2031,
2100,
2151,
2209,
2251,
2252,
2263,
2264,
2390,
2391,
2488,
2489,
2557,
2558,
2621,
2622,
2630,
2631,
2761,
2762,
2770,
2771,
2936,
2937,
2945,
2946,
3032,
3033,
3040,
3041,
3262,
3263,
3399,
3400,
3443,
3444,
3453,
3454,
3613,
3614,
3703,
3704,
3800,
3801,
3849,
3898,
3959,
3998,
3999,
4067,
4068,
4117,
4166,
4224,
4264,
4265,
4272,
4273,
4462,
4463,
4559,
4560,
4606,
4653,
4713,
4751,
4752,
4759,
4760,
4928,
4929,
4973,
4974,
5014,
5056,
5115,
5160,
5161,
5168,
5169,
5442,
5443,
5489,
5536,
5596,
5634,
5635,
5643,
5644,
5736,
5737,
5843,
5844,
5849,
5850,
5997,
5998,
6080,
6081,
6125,
6171,
6225,
6263,
6264,
6274,
6275,
6481,
6482,
6516,
6517,
6580,
6631,
6689,
6731,
6732,
6746,
6747,
6758,
6759,
6775,
6776,
6810
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 6810,
"ccnet_original_nlines": 149,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.021857919171452522,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.003642990021035075,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.16939890384674072,
"rps_doc_frac_unique_words": 0.38278594613075256,
"rps_doc_mean_word_length": 6.727066993713379,
"rps_doc_num_sentences": 52,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.218083381652832,
"rps_doc_word_count": 883,
"rps_doc_frac_chars_dupe_10grams": 0.06700336933135986,
"rps_doc_frac_chars_dupe_5grams": 0.21010100841522217,
"rps_doc_frac_chars_dupe_6grams": 0.1730639636516571,
"rps_doc_frac_chars_dupe_7grams": 0.15488214790821075,
"rps_doc_frac_chars_dupe_8grams": 0.1387205421924591,
"rps_doc_frac_chars_dupe_9grams": 0.08518519252538681,
"rps_doc_frac_chars_top_2gram": 0.024242419749498367,
"rps_doc_frac_chars_top_3gram": 0.020202020183205605,
"rps_doc_frac_chars_top_4gram": 0.029629629105329514,
"rps_doc_books_importance": -408.18902587890625,
"rps_doc_books_importance_length_correction": -408.18902587890625,
"rps_doc_openwebtext_importance": -255.38238525390625,
"rps_doc_openwebtext_importance_length_correction": -255.38238525390625,
"rps_doc_wikipedia_importance": -260.1987609863281,
"rps_doc_wikipedia_importance_length_correction": -260.1987609863281
},
"fasttext": {
"dclm": 0.21031475067138672,
"english": 0.0004128199943806976,
"fineweb_edu_approx": 2.2779953479766846,
"eai_general_math": 0.0000448200007667765,
"eai_open_web_math": 0.7231303453445435,
"eai_web_code": 0.36539989709854126
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.462",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.028",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,124,115,914,108,343,000 |
Apple, the FBI, and Security
The dispute between Apple and the FBI is a much closer question than it is being framed as in most of the tech press. In large part this is because the dispute itself is being serially mischaracterized by both Apple supporters and detractors.
Apple supporters are, in my estimation, too easily conflating the security issues at hand with the more fundamental debate about encryption; detractors are trivializing the significance of the FBI’s request by suggesting they simply want Apple to unlock the phone.
My goal with this piece is to, in as plain language as possible, lay out the issues at hand, give a framework to think about them, and explain why I am ultimately supporting Apple’s decision.
Three Debates
The first thing to understand about the issue at hand is that there are three separate debates going on: the issue at hand, the encryption debate, and the PR battle. To understand the issue it is necessary to separate them, but to figure out which side may win it is equally critical to understand how they relate to each other.
The Issue At Hand
As I laid out last week, iPhones running iOS 8 or later have all of their contents encrypted on-disk with very strong encryption that is practically unbreakable. Therefore, the most realistic way to get access to the contents of the iPhone in question in this case is to brute force — i.e. try every possible combination — the passcode on the device. This passcode, in conjunction with the iPhone’s unique ID key (UID) that is embedded at manufacture and unknown by Apple, forms a “key” that unlocks the contents of the drive.
Given that this is an obvious way to break into an iPhone, Apple has instituted a number of software-based protections against brute force attacks, specifically a (user-selected) option to delete the contents of the disk after 10 failed passcode entries1 and a five-second delay between passcode entries. In addition, the passcode must be entered on the device’s touchscreen.
The FBI is asking Apple to remove these limitations: allow more than 10 passcode tries, remove the five-second delay (there would still be an 80-millisecond delay if the computation is done on the device due to a hardware limitation), and allow passcodes to be entered by a separate device instead of a human finger. The FBI cannot do this themselves because removing this limitation would require the installation of a new version of iOS, which itself requires its own key that is known only to Apple.
Moreover, the FBI is insisting that this is a one-time ask for one device: Apple would be able to use the device’s Unique Device Identifier (UDID), which is different than the aforementioned UID and is known to Apple (and anyone else with the device), to ensure the custom version of iOS could only run on the device in question. In fact, the FBI is even offering to let Apple install the custom version of iOS themselves to ensure it does not leave Apple’s campus.
The Encryption Debate
What the FBI is not asking in this case is that Apple defeat the device’s on-disk encryption, and for good reason: as I noted above the iPhone’s on-disk encryption is practically unbreakable. Small wonder that when, in 2014 with the debut of iOS 8, Apple extended this encryption to all of an iPhone’s data, law enforcement agencies everywhere were aghast. FBI Director James Comey, in an October 2014 speech at the Brookings Institute stated:
Encryption isn’t just a technical feature; it’s a marketing pitch. But it will have very serious consequences for law enforcement and national security agencies at all levels. Sophisticated criminals will come to count on these means of evading detection. It’s the equivalent of a closet that can’t be opened. A safe that can’t be cracked. And my question is, at what cost?…
Cyber adversaries will exploit any vulnerability they find. But it makes more sense to address any security risks by developing intercept solutions during the design phase, rather than resorting to a patchwork solution when law enforcement comes knocking after the fact. And with sophisticated encryption, there might be no solution, leaving the government at a dead end—all in the name of privacy and network security.
“Intercept solutions during the design phase” entail the creation of a so-called “golden key”: a built-in solution to an encryption algorithm that is independent of the user’s passcode. Basically, Comey has for a few years now been agitating for Apple’s on-disk encryption be designed like a TSA-compliant luggage lock: it opens with either the owner’s passcode or with a universal key owned by a government agency.
This is an unacceptable outcome that has to date been rightly rejected by Congress. While a “golden key” can not, contrary to conventional wisdom, be guessed, it can be stolen (much like the TSA luggage key has been). Worse, once said key is stolen, every single device governed by said key would be vulnerable without anyone knowing any better: that includes not only devices that hold personal details, but also corporate secrets, classified information, in short, nearly everything of value that underpins the United States economy. And no one would know when and if the data was being stolen.
Again, though, while Comey and the FBI have been the most outspoken advocates of this destructive golden key, that is not an issue in this current case. If it were, my support of Apple would be unequivocal, because a golden key is an issue where there is simply no compromise.
The PR Battle
Before I engage in such consideration, it’s important to acknowledge the PR aspect of this case: this is where details like the fact Apple helped the FBI bypass the passcode on non-encrypted iPhones goes, along with the fact that San Bernardino County, under direction from the FBI, reset the iCloud password associated with the iPhone in question. That’s not to say that PR doesn’t matter, but none of the surrounding details have anything to do with the substance of the question at hand: is Apple right to resist the FBI’s request to weaken software-based security measures (which do not entail breaking encryption)?
Three Contexts
As is the case with many contentious questions, the correct answer depends on the context with which you evaluate the problem.
The Technology Industry’s Perspective
Apple’s opposition to the FBI’s request, and the support they have received from most major technology companies, is completely understandable.
First off, complying with this order would be a burden (the degree of said burden will be the critical factor on which the court’s decision will turn). Apple would need to design a new version of iOS, figure out a way to secure said version to ensure it doesn’t become widely available, and develop an infrastructure to deal with the inevitable flood of requests from law enforcement agencies seeking similar assistance to the FBI. It is not simply an issue of “unlocking” an iPhone: it is far more complex and dangerous than that.
Secondly, Apple’s ability to resist government pressure in foreign countries — particularly China — will be severely compromised should Apple be forced to acquiesce in this case.
Third, as much as it clearly irked Apple when the FBI framed the company’s opposition as a “marketing stunt,” there is no disputing the fact that the company has made privacy and security a core part of the iPhone value proposition. Forcing the company to actively undo its own security measures certainly works against that proposition.
The FBI’s Perspective
All that said, technologists do their case a disservice by dismissing the FBI’s position out of hand. The fact of the matter is that privacy of information is not an absolute: the Fourth Amendment both prohibits “unreasonable searches and seizures” and affirms an exception for warrants “upon probable cause”. Needless to say, the FBI has pretty damn compelling probable cause in this case,2 and I don’t doubt that future requests along these lines will be accompanied by warrants as well.
Moreover, while it’s true the FBI and other law enforcement agencies have access to more information than ever before, both thanks to cloud services and also the expansion of the Communications Assistance for Law Enforcement Act (CALEA), which compels carriers and ISPs to provide the government with the capability to intercept communications, there very well may be information on devices that are never transmitted (or that is encrypted upon transmission).
More broadly, while I argued an absolutists’ position above with regards to encryption, that is because absolutism is the only option: data is either securely encrypted or it’s not.3 Given that, one can certainly make the argument that given the inescapable reality that some amount of data will be “dark” because of encryption, it behooves the technology industry to cooperate on all requests that don’t entail compromising on something (encryption) that, by definition, cannot be compromised on. To put it another way, I can sympathize with law enforcement’s irritation that the position of companies like Apple when it comes to security leaves no room for the FBI’s enforcement of a different type of security: that of the public at large.
The U.S. Perspective
That noted, the FBI’s position itself is more limited than they themselves likely realize: the FBI is primarily concerned with domestic crimes, and their perspective is that of an investigator seeking to uncover a secret.
However, the United States does not exist in a vacuum: there are plenty of entities that would like nothing more than to uncover American secrets, whether those be on the individual level (compromising information, identity, credit cards, etc.), corporate level (trade secrets, financial information, strategic documents, etc.), or government level (military information, government communications, counter-espionage, etc.). Moreover, given the fact the United States is the richest country in the world with the largest economy, powered by corporations overwhelmingly based on intellectual property, defended by the largest and most sophisticated military in the world, the United States collectively has by far the most to gain from strong security. This is why people like Michael Hayden, former director of the NSA — no civil liberties ideologue, to say the least! — say the FBI is wrong. From USA Today:
“Look, I used to run the NSA, OK?” Hayden told USA TODAY’s weekly video newsmaker series. “Back doors are good. Please, please, Lord, put back doors in, because I and a whole bunch of other talented security services around the world — even though that back door was not intended for me — that back door will make it easier for me to do what I want to do, which is to penetrate.
“But when you step back and look at the whole question of American security and safety writ large, we are a safer, more secure nation without back doors,” he says. With them, “a lot of other people would take advantage of it.”
The fact that weaker security helps the FBI doesn’t change the fact that the United States has more to lose from weaker security than any other country on earth. By far.
Winning the Security Game
There’s one more way to look at the question of security in the context of the United States broadly. Consider a sports analogy: in a game like basketball you need to play both defense and offense; the FBI, given their responsibilities, is primarily concerned with offense — uncovering secrets. However, the agency’s haste to score buckets has the effect of weakening the United States’ defense.
This is particularly unnecessary because the United States already has the best offense in the world! Consider the iPhone in question: the fact of the matter is that the data could be extracted without Apple’s help.
• The first potential method would be to leverage a zero-day exploit that would allow the device to run code that is not signed by Apple;4 in other words, it is almost certainly possible that someone other than Apple could install the necessary software to bypass the 10 passcode entry limitation (the National Security Agency [NSA] is widely thought to possess several zero day exploits)
• The second potential method would be to extract the data from the memory chips, and then de-cap the phone’s processor to uncover the device’s unknown UID and the algorithm used to encrypt the data, and then conduct a brute force attack on the passcode using a separate computer designed to do just that5
Both of these processes are hugely difficult and expensive, which means they can only realistically be done by agencies with massive resources. Like, for example, the NSA — which is a big advantage for the United States. If there is strong security everywhere (i.e. everyone has the same defensive capability), then the country with the biggest advantage is the country with the most resources to overcome that security (i.e. not everyone has the same offensive capability). To lower the bar when it comes to defense is to give up one of the United States’ biggest strategic advantages.
Note what I have not discussed in this article: privacy. In fact, I do agree that there are significant privacy concerns around the FBI’s insistence that Apple explicitly weaken iPhone security, and I would personally lean towards the privacy side of the debate when it comes to the privacy-security tradeoff.
That said, as I articulated above, I understand the FBI’s concerns about going dark, and the agency could hardly have picked a more compelling example to make their case for tech company cooperation.6 I am not surprised that a majority of Americans say Apple “Should unlock the terror suspect’s iPhone.”
That is why it is critical to make the argument that the FBI’s request weakens security by compelling something much deeper than merely “unlocking an iPhone.” In other words, given the context of the United States as a whole, an argument for privacy and an argument for security are not a tradeoff at all, but rather two paths to the same outcome: stronger, not weaker iPhones.7
1. Specifically, the “key” for the disk is deleted, meaning the content is encrypted forever []
2. Not to mention the explicit permission of San Bernardino County, the owner of the phone in question []
3. It’s math: just as 2 + 2 can only equal 4, data is secure from everyone or no one []
4. We know these exist: they are the foundation of jailbreaks []
5. Which, thanks to Bitcoin, are cheaper than ever before []
6. That this case is being leveraged is certainly not an accident []
7. One final point: Apple may lose, and that will be ok. This case is a close one, and such an outcome — facilitated brute force attacks — may prove to be the compromise that brings law enforcement to peace with encryption. That would be the hope anyways, because legislation limiting encryption would be a devastating outcome for everyone. One hopes Apple’s resistance in this case doesn’t lay the groundwork for an even worse outcome in the future []
|
{
"url": "https://stratechery.com/2016/apple-the-fbi-and-security/",
"source_domain": "stratechery.com",
"snapshot_id": "crawl=CC-MAIN-2019-39",
"warc_metadata": {
"Content-Length": "64890",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:X3TANROCCLOLYAMABG7QBGRT4J2GFJR4",
"WARC-Concurrent-To": "<urn:uuid:96a4a287-cdcc-4a4b-aab9-cd53d333d288>",
"WARC-Date": "2019-09-22T12:27:26Z",
"WARC-IP-Address": "35.184.247.115",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:R3GHPLAURSAL6H7NL2TPEI67AH6M7U3X",
"WARC-Record-ID": "<urn:uuid:a046b501-ccc9-4070-ad3c-286a3a4e6b7e>",
"WARC-Target-URI": "https://stratechery.com/2016/apple-the-fbi-and-security/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:1814f122-0d1d-4a07-ab43-c7e97105707d>"
},
"warc_info": "isPartOf: CC-MAIN-2019-39\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-20.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
29,
30,
273,
274,
539,
540,
732,
733,
747,
748,
1077,
1078,
1096,
1097,
1624,
1625,
2001,
2002,
2505,
2506,
2972,
2973,
2995,
2996,
3440,
3441,
3816,
3817,
4237,
4238,
4654,
4655,
5252,
5253,
5530,
5531,
5545,
5546,
6166,
6167,
6182,
6183,
6310,
6311,
6349,
6350,
6494,
6495,
7027,
7028,
7207,
7208,
7546,
7547,
7569,
7570,
8060,
8061,
8521,
8522,
9265,
9266,
9287,
9288,
9510,
9511,
10420,
10421,
10800,
10801,
11028,
11029,
11199,
11200,
11226,
11227,
11623,
11624,
11840,
11841,
12232,
12540,
12541,
13128,
13129,
13130,
13440,
13441,
13745,
13746,
14125,
14126,
14224,
14332,
14422,
14489,
14552,
14623
],
"line_end_idx": [
29,
30,
273,
274,
539,
540,
732,
733,
747,
748,
1077,
1078,
1096,
1097,
1624,
1625,
2001,
2002,
2505,
2506,
2972,
2973,
2995,
2996,
3440,
3441,
3816,
3817,
4237,
4238,
4654,
4655,
5252,
5253,
5530,
5531,
5545,
5546,
6166,
6167,
6182,
6183,
6310,
6311,
6349,
6350,
6494,
6495,
7027,
7028,
7207,
7208,
7546,
7547,
7569,
7570,
8060,
8061,
8521,
8522,
9265,
9266,
9287,
9288,
9510,
9511,
10420,
10421,
10800,
10801,
11028,
11029,
11199,
11200,
11226,
11227,
11623,
11624,
11840,
11841,
12232,
12540,
12541,
13128,
13129,
13130,
13440,
13441,
13745,
13746,
14125,
14126,
14224,
14332,
14422,
14489,
14552,
14623,
15077
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 15077,
"ccnet_original_nlines": 98,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.45824915170669556,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.02289561927318573,
"rps_doc_frac_lines_end_with_ellipsis": 0.010101010091602802,
"rps_doc_frac_no_alph_words": 0.14377103745937347,
"rps_doc_frac_unique_words": 0.33640000224113464,
"rps_doc_mean_word_length": 4.8684000968933105,
"rps_doc_num_sentences": 100,
"rps_doc_symbol_to_word_ratio": 0.0003367000026628375,
"rps_doc_unigram_entropy": 5.74857759475708,
"rps_doc_word_count": 2500,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.0184043999761343,
"rps_doc_frac_chars_dupe_6grams": 0.008380579762160778,
"rps_doc_frac_chars_dupe_7grams": 0.0039437999948859215,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.007805440109223127,
"rps_doc_frac_chars_top_3gram": 0.011091940104961395,
"rps_doc_frac_chars_top_4gram": 0.00345083000138402,
"rps_doc_books_importance": -1354.4129638671875,
"rps_doc_books_importance_length_correction": -1354.4129638671875,
"rps_doc_openwebtext_importance": -853.0518798828125,
"rps_doc_openwebtext_importance_length_correction": -853.0518798828125,
"rps_doc_wikipedia_importance": -568.6768798828125,
"rps_doc_wikipedia_importance_length_correction": -568.6768798828125
},
"fasttext": {
"dclm": 0.319532573223114,
"english": 0.9535476565361023,
"fineweb_edu_approx": 1.7428805828094482,
"eai_general_math": 0.3646220564842224,
"eai_open_web_math": 0.28009486198425293,
"eai_web_code": 0.10437464714050293
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.82",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "343.7302",
"labels": {
"level_1": "Social sciences",
"level_2": "Law",
"level_3": "Criminal law"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "5",
"label": "Evaluate"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "1",
"label": "News/Editorial"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "16",
"label": "Personal Blog"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,388,907,788,942,027,000 |
Next: , Previous: , Up: Image Processing [Contents][Index]
32.2 Displaying Images
A natural part of image processing is visualization of an image. The most basic function for this is the imshow function that shows the image given in the first input argument.
: imshow (im)
: imshow (im, limits)
: imshow (im, map)
: imshow (rgb, …)
: imshow (filename)
: imshow (…, string_param1, value1, …)
: h = imshow (…)
Display the image im, where im can be a 2-dimensional (grayscale image) or a 3-dimensional (RGB image) matrix.
If limits is a 2-element vector [low, high], the image is shown using a display range between low and high. If an empty matrix is passed for limits, the display range is computed as the range between the minimal and the maximal value in the image.
If map is a valid color map, the image will be shown as an indexed image using the supplied color map.
If a filename is given instead of an image, the file will be read and shown.
If given, the parameter string_param1 has value value1. string_param1 can be any of the following:
"displayrange"
value1 is the display range as described above.
"colormap"
value1 is the colormap to use when displaying an indexed image.
"xdata"
If value1 is a 2-element vector, it must contain horizontal image limits in the form [xfirst, xlast], where xfirst and xlast are the abscissa of the centers of the corner pixels. Otherwise value1 must be a vector and only the first and last elements will be used for xfirst and xlast respectively.
"ydata"
If value1 is a 2-element vector, it must contain vertical image limits in the form [yfirst, ylast], where yfirst and ylast are the ordinates of the center of the corner pixels. Otherwise value1 must be a vector and only the first and last elements will be used for yfirst and ylast respectively.
The optional return value h is a graphics handle to the image.
See also: image, imagesc, colormap, gray2ind, rgb2ind.
: image (img)
: image (x, y, img)
: image (…, "prop", val, …)
: image ("prop1", val1, …)
: h = image (…)
Display a matrix as an indexed color image.
The elements of img are indices into the current colormap.
x and y are optional 2-element vectors, [min, max], which specify the coordinates of the centers of the corner pixels. If a range is specified as [max, min] then the image will be reversed along that axis. For convenience, x and y may be specified as N-element vectors matching the length of the data in img. However, only the first and last elements will be used to determine the axis limits.
Multiple property/value pairs may be specified for the image object, but they must appear in pairs.
The optional return value h is a graphics handle to the image.
Implementation Note: The origin (0, 0) for images is located in the upper left. For ordinary plots, the origin is located in the lower left. Octave handles this inversion by plotting the data normally, and then reversing the direction of the y-axis by setting the ydir property to "reverse". This has implications whenever an image and an ordinary plot need to be overlaid. The recommended solution is to display the image and then plot the reversed ydata using, for example, flipud (ydata).
Calling Forms: The image function can be called in two forms: High-Level and Low-Level. When invoked with normal options, the High-Level form is used which first calls newplot to prepare the graphic figure and axes. When the only inputs to image are property/value pairs the Low-Level form is used which creates a new instance of an image object and inserts it in the current axes.
Graphic Properties: The full list of properties is documented at Image Properties.
See also: imshow, imagesc, colormap.
: imagesc (img)
: imagesc (x, y, img)
: imagesc (…, climits)
: imagesc (…, "prop", val, …)
: imagesc ("prop1", val1, …)
: imagesc (hax, …)
: h = imagesc (…)
Display a scaled version of the matrix img as a color image.
The colormap is scaled so that the entries of the matrix occupy the entire colormap. If climits = [lo, hi] is given, then that range is set to the "clim" of the current axes.
x and y are optional 2-element vectors, [min, max], which specify the coordinates of the centers of the corner pixels. If a range is specified as [max, min] then the image will be reversed along that axis. For convenience, x and y may be specified as N-element vectors matching the length of the data in img. However, only the first and last elements will be used to determine the image limits.
The optional return value h is a graphics handle to the image.
Calling Forms: The imagesc function can be called in two forms: High-Level and Low-Level. When invoked with normal options, the High-Level form is used which first calls newplot to prepare the graphic figure and axes. When the only inputs to image are property/value pairs the Low-Level form is used which creates a new instance of an image object and inserts it in the current axes. The full list of properties is documented at Image Properties.
See also: image, imshow, caxis.
Next: Representing Images, Previous: Loading and Saving Images, Up: Image Processing [Contents][Index]
|
{
"url": "https://docs.octave.org/v7.2.0/Displaying-Images.html",
"source_domain": "docs.octave.org",
"snapshot_id": "crawl=CC-MAIN-2022-40",
"warc_metadata": {
"Content-Length": "13890",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:MDZU6OPIJCWLGB7L4DISMXDHO6BU4COZ",
"WARC-Concurrent-To": "<urn:uuid:3ce5e21a-674a-4bc6-95f1-0fe14ad16366>",
"WARC-Date": "2022-09-27T10:20:32Z",
"WARC-IP-Address": "23.237.137.44",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:U2LUTAEQXHEGRL6UOYKFXULWJKDIKUBM",
"WARC-Record-ID": "<urn:uuid:d79671d4-42fd-4730-b231-7e004d4eedf9>",
"WARC-Target-URI": "https://docs.octave.org/v7.2.0/Displaying-Images.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:684dae3a-1c88-4cf1-b27a-17b37907895f>"
},
"warc_info": "isPartOf: CC-MAIN-2022-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September/October 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-14\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
61,
62,
63,
86,
87,
264,
265,
279,
301,
320,
338,
358,
397,
414,
415,
526,
527,
775,
776,
879,
880,
957,
958,
1057,
1058,
1073,
1074,
1122,
1123,
1134,
1135,
1199,
1200,
1208,
1209,
1507,
1508,
1516,
1517,
1813,
1814,
1877,
1878,
1933,
1934,
1948,
1968,
1996,
2023,
2039,
2040,
2084,
2085,
2144,
2145,
2539,
2540,
2640,
2641,
2704,
2705,
3197,
3198,
3580,
3581,
3664,
3665,
3702,
3703,
3719,
3741,
3764,
3794,
3823,
3842,
3860,
3861,
3922,
3923,
4098,
4099,
4494,
4495,
4558,
4559,
5006,
5007,
5039,
5040,
5041
],
"line_end_idx": [
61,
62,
63,
86,
87,
264,
265,
279,
301,
320,
338,
358,
397,
414,
415,
526,
527,
775,
776,
879,
880,
957,
958,
1057,
1058,
1073,
1074,
1122,
1123,
1134,
1135,
1199,
1200,
1208,
1209,
1507,
1508,
1516,
1517,
1813,
1814,
1877,
1878,
1933,
1934,
1948,
1968,
1996,
2023,
2039,
2040,
2084,
2085,
2144,
2145,
2539,
2540,
2640,
2641,
2704,
2705,
3197,
3198,
3580,
3581,
3664,
3665,
3702,
3703,
3719,
3741,
3764,
3794,
3823,
3842,
3860,
3861,
3922,
3923,
4098,
4099,
4494,
4495,
4558,
4559,
5006,
5007,
5039,
5040,
5041,
5145
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5145,
"ccnet_original_nlines": 90,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3595004379749298,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.003568239975720644,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.22836753726005554,
"rps_doc_frac_unique_words": 0.26327943801879883,
"rps_doc_mean_word_length": 4.553117752075195,
"rps_doc_num_sentences": 49,
"rps_doc_symbol_to_word_ratio": 0.012488850392401218,
"rps_doc_unigram_entropy": 4.763864994049072,
"rps_doc_word_count": 866,
"rps_doc_frac_chars_dupe_10grams": 0.40831854939460754,
"rps_doc_frac_chars_dupe_5grams": 0.4407811164855957,
"rps_doc_frac_chars_dupe_6grams": 0.43063658475875854,
"rps_doc_frac_chars_dupe_7grams": 0.43063658475875854,
"rps_doc_frac_chars_dupe_8grams": 0.4275932013988495,
"rps_doc_frac_chars_dupe_9grams": 0.4275932013988495,
"rps_doc_frac_chars_top_2gram": 0.01902104914188385,
"rps_doc_frac_chars_top_3gram": 0.009130099788308144,
"rps_doc_frac_chars_top_4gram": 0.01724575087428093,
"rps_doc_books_importance": -497.1669616699219,
"rps_doc_books_importance_length_correction": -497.1669616699219,
"rps_doc_openwebtext_importance": -184.57952880859375,
"rps_doc_openwebtext_importance_length_correction": -184.57952880859375,
"rps_doc_wikipedia_importance": -198.16407775878906,
"rps_doc_wikipedia_importance_length_correction": -198.16407775878906
},
"fasttext": {
"dclm": 0.04266208037734032,
"english": 0.784773051738739,
"fineweb_edu_approx": 3.093168020248413,
"eai_general_math": 0.9860685467720032,
"eai_open_web_math": 0.6510826945304871,
"eai_web_code": 0.9431121945381165
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-4,835,490,716,327,628,000 |
Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.
A Banach Space is a vector space which is normed and is complete with respect to its norm (every cauchy sequence converges). Examples of Banach spaces include $\mathbb{R}^n$ and the space of bounded continuous functions with the norm $\Vert f(x) \Vert = \sup \lbrace \vert f(x) \vert \rbrace$.
The set of all Bounded Linear Operators $\Omega$ on the space of all $C^\infty$ functions over $\mathbb{R}$ forms a Banach space:
1. For two operators $A, B \in \Omega$ define $(A+B)(f) = Af + Bf$, and for a constant $c \in \mathbb{R}$ define $(cA)(f) = c Af$. This makes $\Omega$ into a vector space.
2. Define a norm by $ \Vert A \Vert_\Omega = \sup \lbrace \Vert Af \Vert : f \in C^\infty(\mathbb{R}), \Vert f \Vert \leq 1 \rbrace $, where $\Vert f \Vert$ for $f \in C^\infty(\mathbb{R})$ is some norm on that space.
Now my question is: Does the norm chosen for $C^\infty(\mathbb{R})$ affect the structure of $\Omega$ (i.e. its topology or whatever), and is there a natural choice for such a norm in this situation?
share|cite|improve this question
2
It's not clear to me how you would define a norm on $C^\infty(\mathbb{R})$ at all. – Akhil Mathew Aug 15 '10 at 3:29
1
The sup-norm and $L_2$ norm are both norms that work on $C^\infty(\mathbb{R})$. – Eric Haengel Aug 15 '10 at 4:10
1
@Eric Haengel: Why is this tagged under complex analysis? – anonymous Aug 15 '10 at 6:55
5
Neither the "sup-norm" nor the "$L_2$" norm is a norm on $C^\infty(\mathbb{R})$. Of course the norm chosen on an infinite-dimensional vector space determines which operators on it are bounded. There are various topologies on $C^\infty(\mathbb{R})$ studied in the theory of distributions en.wikipedia.org/wiki/Distribution_%28mathematics%29 but they are not derived from norms. – Robin Chapman Aug 15 '10 at 7:40
3
Greg, no. The "sup-norm" is not a norm on $C^\infty(\mathbb{R})$ (as I've already said). – Robin Chapman Aug 15 '10 at 10:03
2 Answers 2
up vote 2 down vote accepted
First off there is no norm that can be put on $C^\infty(\mathbb{R})$, or even $C^\infty([0,1])$, that will make it into a Banach Space. I mention the last one because there are lots of obvious norms, sup norm, $L^p$ norms etc. But it will not be complete with respect to any norm.
It's fairly simple to see this, for the $L^2$ norm. Differentiation would then be an operator defined on the whole Banach space that has an adjoint. In fact, it is self-adjoint (this is by integration by parts).
Now it is a theorem that any operator on a Banach space with an adjoint is automatically bounded (this is a consequence of Total Boundedness Principle). But of course differentiation is unbounded.
As for your main question:
If you put some norm on $C^\infty(\mathbb{R})$ then yes it would greatly affect the set of bounded operators (even as a set, not just as a banach space). For example putting different $L^p$-norms would give you different duals spaces. While if you say restricted to bounded smooth functions and used the sup-norm, the dual would be measures on $\mathbb{R}$.
I guess the take-away message is that the definition of bounded operators involves the norm on the domain. So if you change that norm you can greatly change the bounded operators.
By the way most of this stuff can be found in pretty much any Functional Analysis textbook.
I like Analysis NOW by Gert Pederson.
share|cite|improve this answer
+1 for Analysis NOW, but -1 for "there is no norm that can be put on $C^\infty(\mathbb R)$, that will make it into a Banach Space". So, $\pm 0$. – Rasmus Aug 15 '10 at 14:44
Ok, yeah so I meant there is no natural norm. Since $C^\infty(\mathbb{R})$ is not countable dimension then it is isomorphic as a vector space to any other separable Banach space, and so you can put a norm on it through the iso. Maybe a good way to say it, is there is no explicit norm. (i.e. without using choice to define). – Owen Sizemore Aug 16 '10 at 16:19
Do you know a reference, where I can find a proof that, there is no norm in $C^\infty([0,1])$ which makes it a Banach space? – Tomás Sep 3 '14 at 0:18
@Tomás: The way I usually know involves using the uniform boundedness principal. Since differentiation is self-adjoint, it $C^\infty$ was a Banach space that would mean that differentiation is bounded, which it can't be (no matter the norm as $x^n$) shows. Any intro functional analysis textbook will have the uniform boundedness principle. Though I haven't seen any that explicitly shows that $C^\infty$ is a Frechet space that isn't a Banach space. – Owen Sizemore Sep 3 '14 at 3:53
Dear @OwenSizemore, I would like to refere you to this post. – Tomás Sep 5 '14 at 14:34
I'm not aware of any natural choices for norms on $C^\infty(\mathbb{R})$ at all. (As mentioned in comments, things like the sup or $L^p$ norms are infinite for some $C^\infty(\mathbb{R})$ functions.)
There are unnatural choices, contrary to Owen Sizemore's assertion. For example, it is known that all infinite-dimensional separable Fréchet spaces (such as $C^\infty(\mathbb{R})$ in its usual topology) have Hamel dimension $2^{\aleph_0}$, hence are isomorphic as vector spaces. (I believe this is due to Mazur, but couldn't find the exact reference.) So if $(X, ||\cdot||_X)$ is your favorite infinite-dimensional separable normed space, there is a linear isomorphism $T : C^\infty(\mathbb{R}) \to X$ (of course it is in general horribly discontinuous). For $f \in C^\infty(\mathbb{R})$, set $||f|| := ||Tf||_X$. Voilà, a norm on $C^\infty(\mathbb{R})$.
Of course, under this norm $C^\infty(\mathbb{R})$ is isometrically isomorphic to $X$, so for all intents and purposes you are really working with $X$. You can even make $C^\infty(\mathbb{R})$ into a Banach space or even a Hilbert space by choosing $X$ accordingly. And the space of bounded operators on $(C^\infty(\mathbb{R}), ||\cdot||)$ is isometrically isomorphic to the space of those on $X$. Thus for any infinite-dimensional separable normed space $X$ you can realize the space of bounded operators $L(X)$ in this way, so the choice of norm on $C^\infty(\mathbb{R})$ certainly does affect the structure of $L(C^\infty(\mathbb{R}))$.
This illustrates in some sense that the norm contains almost all of the structure of a normed space; if you drop it, you are left with just the vector space structure, which determines almost nothing. "Choosing a norm" on a space is not really a sensible thing to do, since in effect it is really just choosing a normed space which could be almost totally unrelated to the original space.
Also, it should be pointed out that the space of bounded linear operators on an incomplete normed space is not a Banach space. Proof: Let $X$ be an incomplete normed space, let $\lbrace x_n\rbrace$ be a Cauchy sequence in $X$ with no limit, and let $f \in X^*$ be a nonzero bounded linear functional on $X$. Define operators $T_n$ by $T_n x = f(x) x_n$. Then $\lbrace T_n \rbrace$ is Cauchy in operator norm, but does not converge.
The correct theorem is that for normed spaces $X,Y$, the space $L(X,Y)$ of bounded linear operators from $X$ to $Y$ is a Banach space iff $Y$ is a Banach space.
share|cite|improve this answer
Your Answer
discard
By posting your answer, you agree to the privacy policy and terms of service.
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "http://math.stackexchange.com/questions/2496/how-to-define-a-norm-on-a-banach-space-of-operators",
"source_domain": "math.stackexchange.com",
"snapshot_id": "crawl=CC-MAIN-2015-48",
"warc_metadata": {
"Content-Length": "90122",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:XJXPAUZHPCMMTY62KYA3ZU52GJABZHEL",
"WARC-Concurrent-To": "<urn:uuid:1f999486-fc61-468f-85e3-9b500a609c4f>",
"WARC-Date": "2015-11-29T18:12:13Z",
"WARC-IP-Address": "104.16.118.182",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:Z6THQ55VFYB2OH5OHDKAP36YNO5SZYDK",
"WARC-Record-ID": "<urn:uuid:c8b566e7-9cc7-4343-88cc-f31401cf63d5>",
"WARC-Target-URI": "http://math.stackexchange.com/questions/2496/how-to-define-a-norm-on-a-banach-space-of-operators",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:5247ce42-e930-46b4-9f38-9bf9b70cbb7f>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-71-132-137.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2015-48\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for Nov 2015\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
10,
184,
185,
479,
480,
610,
611,
785,
786,
1006,
1007,
1206,
1207,
1240,
1244,
1361,
1365,
1479,
1483,
1572,
1576,
1988,
1992,
2117,
2118,
2130,
2131,
2160,
2161,
2442,
2443,
2655,
2656,
2853,
2854,
2881,
2882,
3240,
3241,
3421,
3422,
3514,
3515,
3553,
3554,
3585,
3590,
3764,
3769,
4130,
4135,
4286,
4291,
4776,
4781,
4869,
4870,
5070,
5071,
5726,
5727,
6366,
6367,
6756,
6757,
7189,
7190,
7351,
7352,
7383,
7384,
7396,
7397,
7399,
7407,
7408,
7486,
7487
],
"line_end_idx": [
10,
184,
185,
479,
480,
610,
611,
785,
786,
1006,
1007,
1206,
1207,
1240,
1244,
1361,
1365,
1479,
1483,
1572,
1576,
1988,
1992,
2117,
2118,
2130,
2131,
2160,
2161,
2442,
2443,
2655,
2656,
2853,
2854,
2881,
2882,
3240,
3241,
3421,
3422,
3514,
3515,
3553,
3554,
3585,
3590,
3764,
3769,
4130,
4135,
4286,
4291,
4776,
4781,
4869,
4870,
5070,
5071,
5726,
5727,
6366,
6367,
6756,
6757,
7189,
7190,
7351,
7352,
7383,
7384,
7396,
7397,
7399,
7407,
7408,
7486,
7487,
7577
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 7577,
"ccnet_original_nlines": 78,
"rps_doc_curly_bracket": 0.00712683005258441,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3296000063419342,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0560000017285347,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.29120001196861267,
"rps_doc_frac_unique_words": 0.31230032444000244,
"rps_doc_mean_word_length": 4.460063934326172,
"rps_doc_num_sentences": 73,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.242431163787842,
"rps_doc_word_count": 1252,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.05712750926613808,
"rps_doc_frac_chars_dupe_6grams": 0.0383237786591053,
"rps_doc_frac_chars_dupe_7grams": 0.028295129537582397,
"rps_doc_frac_chars_dupe_8grams": 0.020415470004081726,
"rps_doc_frac_chars_dupe_9grams": 0.009670490399003029,
"rps_doc_frac_chars_top_2gram": 0.029548710212111473,
"rps_doc_frac_chars_top_3gram": 0.027936959639191628,
"rps_doc_frac_chars_top_4gram": 0.009670490399003029,
"rps_doc_books_importance": -734.7731323242188,
"rps_doc_books_importance_length_correction": -734.7731323242188,
"rps_doc_openwebtext_importance": -442.4416198730469,
"rps_doc_openwebtext_importance_length_correction": -442.4416198730469,
"rps_doc_wikipedia_importance": -283.9351806640625,
"rps_doc_wikipedia_importance_length_correction": -283.9351806640625
},
"fasttext": {
"dclm": 0.24393236637115479,
"english": 0.8844137787818909,
"fineweb_edu_approx": 1.723366141319275,
"eai_general_math": 0.9722947478294373,
"eai_open_web_math": 0.9282673001289368,
"eai_web_code": 0.13667714595794678
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "515.7",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Calculus and Mathematical analysis"
}
},
"secondary": {
"code": "515",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Calculus and Mathematical analysis"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "4",
"label": "Analyze"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "3",
"label": "Academic Writing"
}
},
"reasoning_depth": {
"primary": {
"code": "4",
"label": "Advanced Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,178,178,865,176,323,600 |
Click here to Skip to main content
13,192,855 members (54,094 online)
Click here to Skip to main content
Add your own
alternative version
Tagged as
Stats
47.6K views
36 bookmarked
Posted 20 Apr 2012
Where should I store my data?
, 20 Apr 2012
Rate this:
Please Sign up or sign in to vote.
There is a common theme in development: storing data files in the application folder. This is bad, and wrong, and should be stamped on!
Introduction
Recently, I have been answering questions regarding storing data files, and the problems that result from choosing the wrong location. So, where should you store data? And how do you get the path?
Background
Windows has a number of places that are free for data storage and which will not cause "Access Denied" exceptions when you try to write to them - unfortunately, the default directory is not one of them. If you use code such as:
File.WriteAllText("myFile.txt", "Hello World");
Then the system will try to write it to the current folder - which is normally the application executable directory, which in release programs is (or should be) under the "Program Files" or "Program Files(x86)" folder. It is not a good idea to write anything here - you may get an exception, or the user may not be able to locate it with Windows Explorer, or worse: it may well not be on a regular backup schedule folder list.
If you want to write data to a sensible location, Windows provides three Data folders:
User Data
Roaming User Data
All User Data
And these are accessible in C# via the Environment.SpecialFolder enumeration:
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
However it is not a good idea to use these directly, as they are not specific to your application, but general to all.
One way to get an appropriate folder is just to use the Application Properties:
Application.UserAppDataPath
Application.LocalUserAppDataPath
Application.CommonAppDataPath
But I am not in favour of this as the path is specific to your application, and the version number of the assembly: If you issue a new version of your EXE, then it may not be able to find the data that worked with a previous version.
Instead, I prefer to use the Application GUID and the Environment.SpecialFolder enumeration.
When you create an assembly with Visual Studio, it is assigned a Guid value, which does not change during the life of that assembly - be it an EXE file or a Class Library. You can use that Guid to absolutely identify your application, and thus it's data - there is a very, very small chance of any two applications being given the same GUID - which is not the case for application names! How many companies do you think have wanted to call an application "Word", or "Paint"?
The table at the bottom shows the problem with using the Application Properties too blindly.
The code
Include the following in your application data storage class, or in an appropriate Class Library.
/// <summary>
/// Get the Application Guid
/// </summary>
public static Guid AppGuid
{
get
{
Assembly asm = Assembly.GetEntryAssembly();
object[] attr = (asm.GetCustomAttributes(typeof(GuidAttribute), true));
return new Guid((attr[0] as GuidAttribute).Value);
}
}
/// <summary>
/// Get the current assembly Guid.
/// <remarks>
/// Note that the Assembly Guid is not necessarily the same as the
/// Application Guid - if this code is in a DLL, the Assembly Guid
/// will be the Guid for the DLL, not the active EXE file.
/// </remarks>
/// </summary>
public static Guid AssemblyGuid
{
get
{
Assembly asm = Assembly.GetExecutingAssembly();
object[] attr = (asm.GetCustomAttributes(typeof(GuidAttribute), true));
return new Guid((attr[0] as GuidAttribute).Value);
}
}
/// <summary>
/// Get the current user data folder
/// </summary>
public static string UserDataFolder
{
get
{
Guid appGuid = AppGuid;
string folderBase = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string dir = string.Format(@"{0}\{1}\", folderBase, appGuid.ToString("B").ToUpper());
return CheckDir(dir);
}
}
/// <summary>
/// Get the current user roaming data folder
/// </summary>
public static string UserRoamingDataFolder
{
get
{
Guid appGuid = AppGuid;
string folderBase = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string dir = string.Format(@"{0}\{1}\", folderBase, appGuid.ToString("B").ToUpper());
return CheckDir(dir);
}
}
/// <summary>
/// Get all users data folder
/// </summary>
public static string AllUsersDataFolder
{
get
{
Guid appGuid = AppGuid;
string folderBase = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
string dir = string.Format(@"{0}\{1}\", folderBase, appGuid.ToString("B").ToUpper());
return CheckDir(dir);
}
}
/// <summary>
/// Check the specified folder, and create if it doesn't exist.
/// </summary>
/// <param name="dir"></param>
/// <returns></returns>
private static string CheckDir(string dir)
{
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
return dir;
}
Do note that if you include this code in a Class Library, then AppGuid will not be the same as the AssemblyGuid - a Class Library is a separate Assembly, and has it's own Guid. This can be useful, if you want to store information which is to be used by multiple applications - User Login details for example if these are not related to the Windows Login details.
Sample paths generated
Common.AppGuid 158aa00d-332e-440b-9c2c-47e2fc11c078
Common.AssemblyGuid 8d14ff7e-8d39-4163-a1ba-4fae4a5c361d
Common.UserDataFolder C:\Users\griff\AppData\Local\{158AA00D-332E-440B-9C2C-47E2FC11C078}\
Application.UserAppDataPath C:\Users\griff\AppData\Roaming\SetShares\SetShares\1.0.0.0
Common.UserRoamingDataFolder C:\Users\griff\AppData\Roaming\{158AA00D-332E-440B-9C2C-47E2FC11C078}\
Application.LocalUserAppDataPath C:\Users\griff\AppData\Local\SetShares\SetShares\1.0.0.0
Common.AllUsersDataFolder C:\ProgramData\{158AA00D-332E-440B-9C2C-47E2FC11C078}\
Application.CommonAppDataPath C:\ProgramData\SetShares\SetShares\1.0.0.0
History
Original version.
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
Share
About the Author
OriginalGriff
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?
You may also be interested in...
Pro
Pro
Comments and Discussions
QuestionMy vote of 5 Pin
Boris Stam24-Jan-16 1:07
professionalBoris Stam24-Jan-16 1:07
QuestionSuperb! Pin
Mark@Metro23-Mar-15 17:56
memberMark@Metro23-Mar-15 17:56
Question[My vote of 2] Static gettters Pin
Истинското Ми-Име26-Jun-14 12:46
memberИстинското Ми-Име26-Jun-14 12:46
AnswerRe: [My vote of 2] Static gettters Pin
PIEBALDconsult26-Jun-14 12:55
memberPIEBALDconsult26-Jun-14 12:55
SuggestionChecking Directory exists Pin
PabloInNz10-Jun-14 18:07
memberPabloInNz10-Jun-14 18:07
GeneralNice work ! Pin
Member 1046110810-Jun-14 16:27
memberMember 1046110810-Jun-14 16:27
GeneralMy vote of 5 Pin
Maciej Los3-May-14 3:18
mvpMaciej Los3-May-14 3:18
Questionabout the guid Pin
zebra8811-Jun-13 8:25
memberzebra8811-Jun-13 8:25
AnswerRe: about the guid Pin
OriginalGriff11-Jun-13 8:34
protectorOriginalGriff11-Jun-13 8:34
GeneralRe: about the guid Pin
zebra8811-Jun-13 8:42
memberzebra8811-Jun-13 8:42
GeneralMy vote of 5 Pin
Menon Santosh11-Mar-13 2:05
memberMenon Santosh11-Mar-13 2:05
QuestionSaving in registry Pin
ProgramFOX19-Jan-13 4:54
member ProgramFOX19-Jan-13 4:54
Hi,
Internet Explorer saves some history in the Windows Registry. When it's a good idea do this, and where to store your data in the Windows Registry?
Thanks.
In some cases, my signature will be longer than my message...
<em style="color:red"> <b>ProgramFOX</b></em>
ProgramFOX
modified 19-Jan-13 11:20am.
AnswerRe: Saving in registry Pin
PIEBALDconsult19-Jan-13 5:11
memberPIEBALDconsult19-Jan-13 5:11
QuestionWhat about parent of LocalUserAppDataPath Pin
LesF18-Aug-12 16:01
memberLesF18-Aug-12 16:01
AnswerRe: What about parent of LocalUserAppDataPath Pin
OriginalGriff18-Aug-12 20:12
mvpOriginalGriff18-Aug-12 20:12
QuestionOk..but Pin
FatCat_Programmer21-Apr-12 4:16
memberFatCat_Programmer21-Apr-12 4:16
GeneralGood Tip Pin
perilbrain20-Apr-12 10:08
memberperilbrain20-Apr-12 10:08
GeneralRe: Good Tip Pin
OriginalGriff20-Apr-12 21:43
mvpOriginalGriff20-Apr-12 21:43
General General News News Suggestion Suggestion Question Question Bug Bug Answer Answer Joke Joke Praise Praise Rant Rant Admin Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171017.2 | Last Updated 20 Apr 2012
Article Copyright 2012 by OriginalGriff
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid
|
{
"url": "https://www.codeproject.com/Tips/370232/Where-should-I-store-my-data?msg=4475888",
"source_domain": "www.codeproject.com",
"snapshot_id": "crawl=CC-MAIN-2017-43",
"warc_metadata": {
"Content-Length": "130238",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:X6JKXTDTHI7UY4KMXLTAMLWATHCPJAM4",
"WARC-Concurrent-To": "<urn:uuid:45d247c1-3754-43dd-a43b-e89eb9249185>",
"WARC-Date": "2017-10-18T15:30:02Z",
"WARC-IP-Address": "76.74.234.210",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:YXXWPFMMZJVRWQZH4UXG6DN63NZ4YY4J",
"WARC-Record-ID": "<urn:uuid:812a17da-da3a-4031-a3ad-ae26025902ec>",
"WARC-Target-URI": "https://www.codeproject.com/Tips/370232/Where-should-I-store-my-data?msg=4475888",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:89bd9143-4de5-40b8-91a3-eca1f61771a8>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-37-188-157.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-43\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for October 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
35,
70,
105,
118,
138,
139,
149,
150,
156,
157,
169,
183,
202,
203,
233,
234,
248,
259,
294,
430,
431,
444,
445,
643,
644,
656,
657,
886,
887,
936,
937,
1365,
1366,
1453,
1454,
1464,
1482,
1496,
1497,
1575,
1576,
1650,
1719,
1794,
1795,
1914,
1915,
1995,
1996,
2024,
2057,
2087,
2088,
2322,
2323,
2416,
2417,
2892,
2893,
2986,
2987,
2996,
2997,
3095,
3096,
3110,
3139,
3154,
3181,
3187,
3195,
3205,
3257,
3337,
3396,
3406,
3412,
3426,
3461,
3475,
3542,
3609,
3668,
3683,
3698,
3730,
3736,
3744,
3754,
3810,
3890,
3949,
3959,
3965,
3979,
4016,
4031,
4067,
4073,
4081,
4091,
4123,
4226,
4320,
4350,
4360,
4366,
4380,
4425,
4440,
4483,
4489,
4497,
4507,
4539,
4637,
4731,
4761,
4771,
4777,
4791,
4821,
4836,
4876,
4882,
4890,
4900,
4932,
5036,
5130,
5160,
5170,
5176,
5190,
5254,
5269,
5300,
5324,
5367,
5373,
5405,
5415,
5455,
5465,
5481,
5487,
5488,
5851,
5852,
5875,
5876,
5948,
6020,
6124,
6218,
6324,
6416,
6506,
6584,
6585,
6593,
6594,
6612,
6613,
6621,
6622,
6740,
6741,
6747,
6748,
6765,
6766,
6780,
6784,
6796,
6906,
6944,
6976,
7016,
7017,
7050,
7051,
7055,
7059,
7060,
7085,
7086,
7088,
7113,
7138,
7176,
7196,
7222,
7255,
7298,
7331,
7371,
7416,
7446,
7483,
7523,
7548,
7580,
7603,
7634,
7672,
7696,
7720,
7748,
7775,
7797,
7826,
7855,
7883,
7921,
7951,
7973,
8002,
8026,
8054,
8089,
8120,
8145,
8178,
8182,
8183,
8330,
8331,
8339,
8401,
8447,
8458,
8459,
8460,
8488,
8489,
8522,
8551,
8587,
8641,
8661,
8688,
8744,
8773,
8806,
8826,
8858,
8897,
8917,
8943,
8976,
9000,
9029,
9062,
9063,
9227,
9228,
9339,
9340,
9396,
9444,
9484,
9535
],
"line_end_idx": [
35,
70,
105,
118,
138,
139,
149,
150,
156,
157,
169,
183,
202,
203,
233,
234,
248,
259,
294,
430,
431,
444,
445,
643,
644,
656,
657,
886,
887,
936,
937,
1365,
1366,
1453,
1454,
1464,
1482,
1496,
1497,
1575,
1576,
1650,
1719,
1794,
1795,
1914,
1915,
1995,
1996,
2024,
2057,
2087,
2088,
2322,
2323,
2416,
2417,
2892,
2893,
2986,
2987,
2996,
2997,
3095,
3096,
3110,
3139,
3154,
3181,
3187,
3195,
3205,
3257,
3337,
3396,
3406,
3412,
3426,
3461,
3475,
3542,
3609,
3668,
3683,
3698,
3730,
3736,
3744,
3754,
3810,
3890,
3949,
3959,
3965,
3979,
4016,
4031,
4067,
4073,
4081,
4091,
4123,
4226,
4320,
4350,
4360,
4366,
4380,
4425,
4440,
4483,
4489,
4497,
4507,
4539,
4637,
4731,
4761,
4771,
4777,
4791,
4821,
4836,
4876,
4882,
4890,
4900,
4932,
5036,
5130,
5160,
5170,
5176,
5190,
5254,
5269,
5300,
5324,
5367,
5373,
5405,
5415,
5455,
5465,
5481,
5487,
5488,
5851,
5852,
5875,
5876,
5948,
6020,
6124,
6218,
6324,
6416,
6506,
6584,
6585,
6593,
6594,
6612,
6613,
6621,
6622,
6740,
6741,
6747,
6748,
6765,
6766,
6780,
6784,
6796,
6906,
6944,
6976,
7016,
7017,
7050,
7051,
7055,
7059,
7060,
7085,
7086,
7088,
7113,
7138,
7176,
7196,
7222,
7255,
7298,
7331,
7371,
7416,
7446,
7483,
7523,
7548,
7580,
7603,
7634,
7672,
7696,
7720,
7748,
7775,
7797,
7826,
7855,
7883,
7921,
7951,
7973,
8002,
8026,
8054,
8089,
8120,
8145,
8178,
8182,
8183,
8330,
8331,
8339,
8401,
8447,
8458,
8459,
8460,
8488,
8489,
8522,
8551,
8587,
8641,
8661,
8688,
8744,
8773,
8806,
8826,
8858,
8897,
8917,
8943,
8976,
9000,
9029,
9062,
9063,
9227,
9228,
9339,
9340,
9396,
9444,
9484,
9535,
9556
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 9556,
"ccnet_original_nlines": 263,
"rps_doc_curly_bracket": 0.004395139869302511,
"rps_doc_ldnoobw_words": 1,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.21559633314609528,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.019877679646015167,
"rps_doc_frac_lines_end_with_ellipsis": 0.007575760129839182,
"rps_doc_frac_no_alph_words": 0.36850154399871826,
"rps_doc_frac_unique_words": 0.4119749665260315,
"rps_doc_mean_word_length": 6.374441623687744,
"rps_doc_num_sentences": 105,
"rps_doc_symbol_to_word_ratio": 0.0015290499432012439,
"rps_doc_unigram_entropy": 5.585971355438232,
"rps_doc_word_count": 1119,
"rps_doc_frac_chars_dupe_10grams": 0.03168372064828873,
"rps_doc_frac_chars_dupe_5grams": 0.1379503756761551,
"rps_doc_frac_chars_dupe_6grams": 0.11608018726110458,
"rps_doc_frac_chars_dupe_7grams": 0.079069122672081,
"rps_doc_frac_chars_dupe_8grams": 0.0661713182926178,
"rps_doc_frac_chars_dupe_9grams": 0.05495584011077881,
"rps_doc_frac_chars_top_2gram": 0.013738960027694702,
"rps_doc_frac_chars_top_3gram": 0.0133183803409338,
"rps_doc_frac_chars_top_4gram": 0.008411609567701817,
"rps_doc_books_importance": -1032.0955810546875,
"rps_doc_books_importance_length_correction": -1032.0955810546875,
"rps_doc_openwebtext_importance": -630.7579956054688,
"rps_doc_openwebtext_importance_length_correction": -630.7579956054688,
"rps_doc_wikipedia_importance": -450.1658630371094,
"rps_doc_wikipedia_importance_length_correction": -450.1658630371094
},
"fasttext": {
"dclm": 0.018116239458322525,
"english": 0.7255507111549377,
"fineweb_edu_approx": 1.8722041845321655,
"eai_general_math": 0.01472145039588213,
"eai_open_web_math": 0.28605085611343384,
"eai_web_code": 0.0002806799893733114
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-40,643,318,870,314,480 |
View Javadoc
1 /**
2 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3 */
4 package net.sourceforge.pmd.cpd;
5
6 import java.io.Reader;
7 import java.io.StringReader;
8
9 import net.sourceforge.pmd.lang.LanguageRegistry;
10 import net.sourceforge.pmd.lang.LanguageVersionHandler;
11 import net.sourceforge.pmd.lang.TokenManager;
12 import net.sourceforge.pmd.lang.ast.TokenMgrError;
13 import net.sourceforge.pmd.lang.matlab.MatlabLanguageModule;
14 import net.sourceforge.pmd.lang.matlab.ast.Token;
15 import net.sourceforge.pmd.util.IOUtil;
16
17 import org.apache.commons.io.IOUtils;
18
19 /**
20 * The Matlab Tokenizer.
21 */
22 public class MatlabTokenizer implements Tokenizer {
23
24 @Override
25 public void tokenize(SourceCode sourceCode, Tokens tokenEntries) {
26 StringBuilder buffer = sourceCode.getCodeBuffer();
27 Reader reader = null;
28 try {
29 LanguageVersionHandler languageVersionHandler = LanguageRegistry.getLanguage(MatlabLanguageModule.NAME)
30 .getDefaultVersion().getLanguageVersionHandler();
31 reader = new StringReader(buffer.toString());
32 reader = IOUtil.skipBOM(reader);
33 TokenManager tokenManager = languageVersionHandler.getParser(
34 languageVersionHandler.getDefaultParserOptions()).getTokenManager(sourceCode.getFileName(), reader);
35 Token currentToken = (Token) tokenManager.getNextToken();
36 while (currentToken.image.length() > 0) {
37 tokenEntries.add(new TokenEntry(currentToken.image, sourceCode.getFileName(), currentToken.beginLine));
38 currentToken = (Token) tokenManager.getNextToken();
39 }
40 tokenEntries.add(TokenEntry.getEOF());
41 System.err.println("Added " + sourceCode.getFileName());
42 } catch (TokenMgrError err) {
43 err.printStackTrace();
44 System.err.println("Skipping " + sourceCode.getFileName() + " due to parse error");
45 tokenEntries.add(TokenEntry.getEOF());
46 } finally {
47 IOUtils.closeQuietly(reader);
48 }
49 }
50 }
|
{
"url": "http://pmd.sourceforge.net/pmd-5.4.1/xref/net/sourceforge/pmd/cpd/MatlabTokenizer.html",
"source_domain": "pmd.sourceforge.net",
"snapshot_id": "crawl=CC-MAIN-2017-47",
"warc_metadata": {
"Content-Length": "7647",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:O3OLCIB6TDJ7IYKZU6LYNWIREG75WT2N",
"WARC-Concurrent-To": "<urn:uuid:0692a23d-86fc-4a07-9cc7-e8b3d3ea6523>",
"WARC-Date": "2017-11-23T12:58:20Z",
"WARC-IP-Address": "216.34.181.96",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:YKD72EF7ABZDYRTHE4EPFUVSM35GXZTV",
"WARC-Record-ID": "<urn:uuid:22e9a58b-d18b-4944-bc16-28228f7de7d4>",
"WARC-Target-URI": "http://pmd.sourceforge.net/pmd-5.4.1/xref/net/sourceforge/pmd/cpd/MatlabTokenizer.html",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:87d27b7c-a081-4c30-9580-21eb45c3601c>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-169-239-161.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-47\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for November 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
13,
21,
105,
113,
150,
155,
182,
215,
220,
274,
334,
384,
439,
504,
558,
602,
607,
649,
654,
662,
691,
699,
755,
760,
778,
853,
916,
950,
968,
1088,
1162,
1224,
1273,
1351,
1476,
1550,
1608,
1732,
1804,
1822,
1877,
1950,
1992,
2031,
2131,
2186,
2210,
2256,
2270,
2280
],
"line_end_idx": [
13,
21,
105,
113,
150,
155,
182,
215,
220,
274,
334,
384,
439,
504,
558,
602,
607,
649,
654,
662,
691,
699,
755,
760,
778,
853,
916,
950,
968,
1088,
1162,
1224,
1273,
1351,
1476,
1550,
1608,
1732,
1804,
1822,
1877,
1950,
1992,
2031,
2131,
2186,
2210,
2256,
2270,
2280,
2285
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2285,
"ccnet_original_nlines": 50,
"rps_doc_curly_bracket": 0.005251639988273382,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.01955989934504032,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.004889979958534241,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5427873134613037,
"rps_doc_frac_unique_words": 0.8367347121238708,
"rps_doc_mean_word_length": 10.401360511779785,
"rps_doc_num_sentences": 79,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.668196201324463,
"rps_doc_word_count": 147,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.022236760705709457,
"rps_doc_frac_chars_top_3gram": 0.05362981930375099,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -185.4755096435547,
"rps_doc_books_importance_length_correction": -185.4755096435547,
"rps_doc_openwebtext_importance": -89.47412109375,
"rps_doc_openwebtext_importance_length_correction": -89.47412109375,
"rps_doc_wikipedia_importance": -89.230224609375,
"rps_doc_wikipedia_importance_length_correction": -89.230224609375
},
"fasttext": {
"dclm": 0.8933284878730774,
"english": 0.19357027113437653,
"fineweb_edu_approx": 1.4567134380340576,
"eai_general_math": 0.8749482035636902,
"eai_open_web_math": 0.2548419237136841,
"eai_web_code": 0.26295411586761475
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.0151",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "1",
"label": "Leftover HTML"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "3",
"label": "Academic Writing"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
1,424,855,544,748,332,300 |
[OS X TeX] Fourier and amsart
Bruno Voisin bvoisin at mac.com
Mon Jun 28 03:13:57 EDT 2004
Le 28 juin 04, à 04:38, Richard Seguin a écrit :
> However, using Fourier, $\mathbf{T}$ is bold, but is upright, and
> $\boldsymbol{T}$ is not bold, but is italic.
This is normal behaviour. \mathbf allows to use the text bold font in
maths, in other words it produces in maths the same output as does
\textbf in text; hence the upright result.
\boldsymbol, from the amsbsy package (deprecated in favour of bm), and
\bm, from the bm package, do something different: they select bold
maths fonts, provided these fonts are available. In other words they
take the (italic) math symbol you are asking for, look for a bold
version of it, and, if it's available, pick it up; if it's not, they
apparently revert to the non-bold version. Both \boldsymbol and \bm aim
at providing more practical and extensive variants of LaTeX's original
\boldmath.
Bruno Voisin
-----------------------------------------------------
Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.
More information about the MacOSX-TeX mailing list
|
{
"url": "https://email.esm.psu.edu/pipermail/macosx-tex/2004-June/006608.html",
"source_domain": "email.esm.psu.edu",
"snapshot_id": "crawl=CC-MAIN-2020-29",
"warc_metadata": {
"Content-Length": "3872",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:SLZ4XZ2R4OVU2LMBHWGK3EEMEYJ7FOAI",
"WARC-Concurrent-To": "<urn:uuid:99c0af4d-d9d8-482d-bbb8-bcaa619bd5eb>",
"WARC-Date": "2020-07-14T01:27:10Z",
"WARC-IP-Address": "130.203.250.147",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:QYYGYE7AIOB7QS7EWX3N3JVW4EDJP2C2",
"WARC-Record-ID": "<urn:uuid:8eb1f067-f2a1-4f9d-b946-2903575b6246>",
"WARC-Target-URI": "https://email.esm.psu.edu/pipermail/macosx-tex/2004-June/006608.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:12b8ede5-e1f4-4397-a089-faee87be1911>"
},
"warc_info": "isPartOf: CC-MAIN-2020-29\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for July 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-48.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
30,
31,
63,
92,
93,
94,
143,
144,
213,
260,
261,
332,
400,
443,
444,
516,
584,
654,
721,
791,
864,
936,
947,
948,
961,
962,
1016,
1063,
1117,
1167,
1168,
1169,
1170,
1171,
1172
],
"line_end_idx": [
30,
31,
63,
92,
93,
94,
143,
144,
213,
260,
261,
332,
400,
443,
444,
516,
584,
654,
721,
791,
864,
936,
947,
948,
961,
962,
1016,
1063,
1117,
1167,
1168,
1169,
1170,
1171,
1172,
1222
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1222,
"ccnet_original_nlines": 35,
"rps_doc_curly_bracket": 0.0032733199186623096,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.30388692021369934,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01766783930361271,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3109540641307831,
"rps_doc_frac_unique_words": 0.6373626589775085,
"rps_doc_mean_word_length": 4.824175834655762,
"rps_doc_num_sentences": 15,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.560713291168213,
"rps_doc_word_count": 182,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.025056950747966766,
"rps_doc_frac_chars_top_3gram": 0.020501140505075455,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -117.09262084960938,
"rps_doc_books_importance_length_correction": -117.09262084960938,
"rps_doc_openwebtext_importance": -68.30091094970703,
"rps_doc_openwebtext_importance_length_correction": -68.30085754394531,
"rps_doc_wikipedia_importance": -49.55723190307617,
"rps_doc_wikipedia_importance_length_correction": -49.55723190307617
},
"fasttext": {
"dclm": 0.07681894302368164,
"english": 0.7603921294212341,
"fineweb_edu_approx": 2.3807144165039062,
"eai_general_math": 0.6354992985725403,
"eai_open_web_math": 0.7233158946037292,
"eai_web_code": 0.03495645895600319
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "510",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "5",
"label": "Social/Forum"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,664,283,685,207,661,000 |
文件夹不存在则创建
if [ ! -d "/data/" ];then
mkdir /data
else
echo "文件夹已经存在"
fi
文件存在则删除
if [ ! -f "/data/filename" ];then
echo "文件不存在"
else
rm -rf /data/filename
fi
判断文件夹是否存在
if [ -d "/data/" ];then
echo "文件夹存在"
else
echo "文件夹不存在"
fi
判断文件是否存在
if [ -d "/data/test" ];then
echo "文件存在"
else
echo "文件不存在"
fi
文件比较符
-e filename 如果 filename存在,则为真 [ -e /var/log/syslog ]
-d filename 如果 filename为目录,则为真 [ -d /tmp/mydir ]
-f filename 如果 filename为常规文件,则为真 [ -f /usr/bin/grep ]
-L filename 如果 filename为符号链接,则为真 [ -L /usr/bin/grep ]
-r filename 如果 filename可读,则为真 [ -r /var/log/syslog ]
-w filename 如果 filename可写,则为真 [ -w /var/mytmp.txt ]
-x filename 如果 filename可执行,则为真 [ -L /usr/bin/grep ]
filename1-nt filename2 如果 filename1比 filename2新,则为真 [ /tmp/install/etc/services -nt /etc/services ]
filename1-ot filename2 如果 filename1比 filename2旧,则为真 [ /boot/bzImage -ot arch/i386/boot/bzImage ]
|
{
"url": "https://blog.cnbattle.com/post/166/",
"source_domain": "blog.cnbattle.com",
"snapshot_id": "CC-MAIN-2023-40",
"warc_metadata": {
"Content-Length": "23458",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:LBFRQT47TMXBHGLGOJ5MJ5MFVN676GHF",
"WARC-Concurrent-To": "<urn:uuid:b71c5a64-f0ba-4afb-b572-c8d7194f1cbc>",
"WARC-Date": "2023-09-29T07:22:59Z",
"WARC-IP-Address": "185.199.111.153",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:YSOWWGPMLRCR4LVVWTJERQK3YICJDJ6M",
"WARC-Record-ID": "<urn:uuid:7526983e-564d-4a30-bf65-d06d0d7dae2c>",
"WARC-Target-URI": "https://blog.cnbattle.com/post/166/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:b4c81ab0-a468-4907-917a-5bbaf342c227>"
},
"warc_info": "isPartOf: CC-MAIN-2023-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September/October 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-82\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
10,
11,
37,
49,
54,
69,
72,
73,
81,
82,
116,
129,
134,
156,
159,
160,
170,
171,
195,
208,
213,
227,
230,
231,
240,
241,
269,
281,
286,
299,
302,
303,
309,
310,
365,
416,
472,
528,
583,
637,
691,
793
],
"line_end_idx": [
10,
11,
37,
49,
54,
69,
72,
73,
81,
82,
116,
129,
134,
156,
159,
160,
170,
171,
195,
208,
213,
227,
230,
231,
240,
241,
269,
281,
286,
299,
302,
303,
309,
310,
365,
416,
472,
528,
583,
637,
691,
793,
891
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 891,
"ccnet_original_nlines": 42,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.11372549086809158,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0117647098377347,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5686274766921997,
"rps_doc_frac_unique_words": 0.5096153616905212,
"rps_doc_mean_word_length": 5.961538314819336,
"rps_doc_num_sentences": 4,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 3.6958470344543457,
"rps_doc_word_count": 104,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.11290322989225388,
"rps_doc_frac_chars_top_3gram": 0.022580649703741074,
"rps_doc_frac_chars_top_4gram": 0.03548387065529823,
"rps_doc_books_importance": -105.59081268310547,
"rps_doc_books_importance_length_correction": -105.59081268310547,
"rps_doc_openwebtext_importance": -40.903568267822266,
"rps_doc_openwebtext_importance_length_correction": -32.61567306518555,
"rps_doc_wikipedia_importance": -34.19572067260742,
"rps_doc_wikipedia_importance_length_correction": -34.19572067260742
},
"fasttext": {
"dclm": 0.046288128942251205,
"english": 0.0828746110200882,
"fineweb_edu_approx": 1.8954989910125732,
"eai_general_math": 0.004334569908678532,
"eai_open_web_math": 0.465798020362854,
"eai_web_code": 0.6914740800857544
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.445",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-3,708,123,727,632,141,300 |
Resumen
Tal vez tengas algo que ocultar y no sepas como. A continuación se muestra como ocultar cualquier tipo archivos dentro de una imagen de manera muy simple para que nadie sospeche.
El "truco" consiste primero en comprimir los archivos y luego mediante algunos comandos de Windows ocultarlo dentro de una imagen JPG.
Necesitas
Para llevar a cabo esta tarea, tendrá que haber, ya sea [WinZip] o [WinRAR] instalado en su ordenador. You can download either of these two off the Internet and use them without having to pay anything. Puede descargar cualquiera de estos dos fuera de la Internet y el uso de ellas sin tener que pagar nada
Pasos
Estos son los pasos para crear su ocultos stash:
1) Cree una carpeta en su disco duro, por ejemplo C: \ Test y poner todos los ficheros que desea ocultar en esa carpeta incluyendo el archivo de imagen donde vas a ocultarlos.
2) Ahora selecciona todos los archivos que desea ocultar, hacer clic derecho sobre ellos, y elegir la opción de añadir a un comprimido ZIP o RAR archivo. Sólo selecciona los archivos que desea ocultar, no la imagen. Nombrelo como desee, por ejemplo "Hidden.rar".
Ahora usted debería tener una carpeta que tiene este aspecto con los archivos, una imagen JPG, y un archivo comprimido.
3) Haga clic en Inicio y, a continuación, haga clic en Ejecutar. Escriba "CMD" sin las comillas y pulse Enter. Ahora deberías ver la ventana de comandos abierta. Escriba "CD \" para obtener en el directorio raíz.
Luego, tipee "CD ", en nuestro caso se deberia tipear "CD Test".
4) Ahora escriba en la línea siguiente: "copy / b .JPG + Hidden.rar .jpg", y presione Enter. No utilice las comillas ni <>. Usted debe recibir una respuesta como la siguiente: "1 file copied"
En la carpeta C:/Test podra comprobar que se ha creado un nuevo archivo de imagen.
Asegúrate de comprobar que la extensión del archivo comprimido, sea .ZIP o .RAR . He oído que algunas personas han tenido problemas con la extensión ZIP, de modo que si esto no funciona, pruebe utilizando la extension .RAR
Y eso es todo! El nuevo archivo de imagen se habrá creado con el archivo comprimido dentro! Usted puede comprobar el tamaño de archivo de la imagen y ver que se ha incrementado en la misma cantidad que el tamaño del archivo comprimido.
Usted puede acceder a su archivo oculto de dos maneras.
A) En primer lugar, basta con cambiar la extensión a. RAR y abre el archivo con [WinRAR].
B) En segundo lugar, puede simplemente hacer clic derecho sobre la imagen JPG y seleccione Abrir con y, a continuación, desplácese hacia abajo y seleccione [WinRAR].
Por medio de ambos procedimientos se le ejucatara el [WinRAR] y podra observar los archivos que usted oculto, listos para ser extraidos.
Para extraer los archivos simplemente arrastrelos desde la ventana del [WinRAR] a la carpeta que usted desee.
|
{
"url": "http://comunidad.biensimple.com/tecnologia/w/tecnologia/Como-ocultar-archivos-en-una-imagen.aspx",
"source_domain": "comunidad.biensimple.com",
"snapshot_id": "crawl=CC-MAIN-2014-15",
"warc_metadata": {
"Content-Length": "67448",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:T52JYJJPDENTEJSJNGNUG4WG2XD7EXOP",
"WARC-Concurrent-To": "<urn:uuid:c8ed58e2-783b-4b16-9eee-6cb484419f48>",
"WARC-Date": "2014-04-23T09:13:06Z",
"WARC-IP-Address": "198.101.170.193",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:EVDHLVPY524IKCJTI3RVTIN3DL5T637I",
"WARC-Record-ID": "<urn:uuid:f0277ad4-e64e-4ad9-8fb5-4de14a51642b>",
"WARC-Target-URI": "http://comunidad.biensimple.com/tecnologia/w/tecnologia/Como-ocultar-archivos-en-una-imagen.aspx",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:f908a3e6-58b5-400a-b1ce-066be6ecec51>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-147-4-33.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2014-15\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for April 2014\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
8,
9,
188,
323,
324,
334,
335,
641,
642,
648,
649,
698,
699,
875,
876,
1139,
1259,
1260,
1473,
1538,
1539,
1731,
1814,
2037,
2038,
2274,
2275,
2331,
2332,
2422,
2423,
2589,
2590,
2727,
2728
],
"line_end_idx": [
8,
9,
188,
323,
324,
334,
335,
641,
642,
648,
649,
698,
699,
875,
876,
1139,
1259,
1260,
1473,
1538,
1539,
1731,
1814,
2037,
2038,
2274,
2275,
2331,
2332,
2422,
2423,
2589,
2590,
2727,
2728,
2837
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2837,
"ccnet_original_nlines": 35,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.109375,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0364583283662796,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.1701388955116272,
"rps_doc_frac_unique_words": 0.48124998807907104,
"rps_doc_mean_word_length": 4.693749904632568,
"rps_doc_num_sentences": 35,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.000499725341797,
"rps_doc_word_count": 480,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.023080339655280113,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.029294269159436226,
"rps_doc_frac_chars_top_3gram": 0.01997336931526661,
"rps_doc_frac_chars_top_4gram": 0.015090989880263805,
"rps_doc_books_importance": -288.59478759765625,
"rps_doc_books_importance_length_correction": -288.59478759765625,
"rps_doc_openwebtext_importance": -158.69998168945312,
"rps_doc_openwebtext_importance_length_correction": -158.69998168945312,
"rps_doc_wikipedia_importance": -131.21482849121094,
"rps_doc_wikipedia_importance_length_correction": -131.21482849121094
},
"fasttext": {
"dclm": 0.9682003259658813,
"english": 0.0007370900129899383,
"fineweb_edu_approx": 1.324221134185791,
"eai_general_math": 0.0015796399675309658,
"eai_open_web_math": 0.5384507775306702,
"eai_web_code": 0.32425159215927124
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.7",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,775,733,503,341,329,000 |
Home > Resource > Edit MPEG Videos > How to Use FFmpeg
Thanksgiving Freebies & Hot Deals 2013
FFmpeg - How to Use FFmpeg to Edit and Convert Videos
FFmpeg is a cross-platform solution to record, convert and edit audio and video. It is a command line tool to convert one video file format to another. However, you could also find a FFmpeg GUI for user-friendly video editing. In this article, we will show you how to use FFmpeg for daily tasks on both Linux and Windows.
1. How to Install FFmpeg Command Line Tool in Windows
2. How to Install FFmpeg Command Line Tool on Linux
3. FFmpeg Examples for Daily Video Editing Tasks
4. FFmpeg Alternative That Suitable for Any One to Use
How to Install FFmpeg Command Line Tool in Windows
Download FFmpeg and uncompress files to a folder, e.g. D:/temp/. Then copy /bin/ffmpeg.exe to X:/Windows/system32/ffmpeg.exe (X is your windows system drive, usually C:/). Thereafter, you can run FFmpeg in command line. To do so, go through Start/Run and enter cmd in the Run dialog box. When cmd opens, input FFmpeg. If FFmpeg version and other information show up, you installed FFmpeg on your Windows system successfully.
avidemux tutorial
Note: You get helps by typing "FFmpeg -h | more" to get help, or read next session for daily video editing tasks.
Recommended Software:
wondershare video editor
Handy FFmpeg alternative to help you create home movies in minutes. It features intuitive interface, comprehensive drag-n-drop feature, wide format support, and handy editing tools. Learn More >>
How to Install FFmpeg Command Line Tool on Linux
What you should know before installing FFmpeg on Linux - FFmpeg requires many modules for general usages. If FFmpeg doesn't work well, fix it by installing correct module, including LAME MP3 Codec, mplayer, libogg, libvorbis, etc. Now, follow these steps to install FFmpeg to your Linux system.
Step 1: Download modules
cd /usr/local/src/
wget www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
Step 2: Extract modules
tar zxvf lame-3.97.tar.gz
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
tar jxvf essential-20061022.tar.bz2
mkdir /usr/local/lib/codecs/
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran subversion ruby ncurses-devel -y
Step 3: Update FFmpeg and mplayer
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src/
mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
Step 4: Install Modules
Install LAME:
cd /usr/local/src/lame-3.97
./configure
make && make install
Install LIBOGG
cd /usr/local/src/
cd /usr/local/src/libogg-1.1.3
./configure --enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
Install LIBVORBIS
cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install
Install mplayer
cd /usr/local/src/
cd /usr/local/src/mplayer
./configure && make && make install
Install FFmpeg:
cd /usr/local/src/FFmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make
make install
export LD_LIBRARY_PATH=/usr/local/lib/
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
FFmpeg Examples for Daily Video Editing Tasks
Convert .avi video to .mpg and any other formats by typing desired formats, say wmv, mp4, mkv, flv, etc.
FFmpeg -i source_video.avi final_video.mpg
Convert a video for the iPod/iPhone using FFmpeg
FFmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4
Convert a video for the PSP using FFmpeg
FFmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4
Extracting sound from a video, and save it as MP3 using FFmpeg
FFmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3
Convert video to image sequences using FFmpeg
FFmpeg -i video.mpg image%d.jpg
Convert video to animated gif(uncompressed) using FFmpeg
FFmpeg -i source_video.avi gif_animated.gif
Split/Trim video using FFmpeg
FFmpeg -i source_video.mpg -ss 00:00:10 -t 00:00:30 final_video.mpg
Merge video files and convert to desired formats
copy /b source_video1.mp4 + source_video2.mp4 out.mp4 | FFmpeg -i out.mp4 -sameq final_video.mpg
FFmpeg Alternative That Suitable for Any One to Use
Many users may find FFmpeg program hard to interpret, and want some easy and quick editing application. If this is your case, Wondershare Video Editor (Video Editor for Mac) comes a handy FFmpeg alternative to help you create home movies in minutes. It has a very intuitive interface and includes all common editing features you may need. When you crop, trim, rotate, add transitions, effects, intro/credits, etc. on Timeline, you can conveniently check any changes in the real-time previewing window. Below is the primary window screenshot.
ffmpeg alternative
Download Wondershare Video Editor free trial:
Download Win Version Download Mac Version
GRatt8191
I like it because it gives you full controle of editing and converting. However you can not use a path to your video that contains spaces in it because ffmpeg thinks it is a start of a new option. For example ( C:\Documents and Settings\Administrator\My Documents) tricks ffmpeg to think (C:\Documents) is the input video and that (and) begins a new command option. Can anyone tell me if there is a way to use spaces or a way to convert the path to a 8dot3 type format that would take out spaces ?
Liza_Brown
Hi, James, FFmpeg is not GUI designed and many users find it on the difficult side. Anyway, you can have a try! If you're looking for an much easier to use alternative, you can try this video converter. It's the all-in-one solution for you to download online video, convert videos to any formats, and burn DVD at ease.
James Cord
Good or Bad?
James Cord
Some say good and some say bad. How do we know?
Back to top
|
{
"url": "http://www.wondershare.com/video-editor/free-video-editor-ffmpeg.html",
"source_domain": "www.wondershare.com",
"snapshot_id": "crawl=CC-MAIN-2013-48",
"warc_metadata": {
"Content-Length": "32149",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:WWYLQACBXLJR4OT5SPXK3HWF2EMGMF3Y",
"WARC-Concurrent-To": "<urn:uuid:906965ef-4c42-400b-a1e4-ef52caaa9bc7>",
"WARC-Date": "2013-12-06T00:47:20Z",
"WARC-IP-Address": "203.130.48.4",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:DLPEUKXUNVU7KGUQFQ4UFJHCIPG6XEHF",
"WARC-Record-ID": "<urn:uuid:3b5d10de-a971-464f-b254-6084dac2d78d>",
"WARC-Target-URI": "http://www.wondershare.com/video-editor/free-video-editor-ffmpeg.html",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:a21ab6c0-35da-4dc4-9580-5c6b479ebcd2>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-33-133-15.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2013-48\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for Winter 2013\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
55,
94,
95,
149,
150,
472,
473,
529,
583,
634,
691,
692,
743,
744,
1169,
1170,
1188,
1189,
1303,
1304,
1326,
1327,
1352,
1548,
1550,
1551,
1600,
1601,
1896,
1897,
1922,
1923,
1942,
2016,
2083,
2140,
2203,
2204,
2228,
2229,
2255,
2284,
2316,
2352,
2381,
2493,
2494,
2528,
2529,
2585,
2643,
2669,
2680,
2699,
2761,
2797,
2798,
2822,
2823,
2837,
2838,
2866,
2878,
2899,
2900,
2915,
2916,
2935,
2966,
3018,
3059,
3082,
3083,
3101,
3102,
3136,
3172,
3173,
3189,
3190,
3209,
3235,
3271,
3272,
3288,
3289,
3315,
3396,
3401,
3414,
3415,
3454,
3455,
3521,
3585,
3647,
3709,
3775,
3776,
3822,
3823,
3928,
3971,
3972,
4021,
4185,
4186,
4227,
4330,
4331,
4394,
4466,
4467,
4513,
4545,
4546,
4603,
4647,
4648,
4678,
4746,
4747,
4796,
4893,
4894,
4946,
4947,
5489,
5490,
5509,
5510,
5556,
5557,
5599,
5600,
5610,
6108,
6119,
6438,
6449,
6462,
6473,
6521
],
"line_end_idx": [
55,
94,
95,
149,
150,
472,
473,
529,
583,
634,
691,
692,
743,
744,
1169,
1170,
1188,
1189,
1303,
1304,
1326,
1327,
1352,
1548,
1550,
1551,
1600,
1601,
1896,
1897,
1922,
1923,
1942,
2016,
2083,
2140,
2203,
2204,
2228,
2229,
2255,
2284,
2316,
2352,
2381,
2493,
2494,
2528,
2529,
2585,
2643,
2669,
2680,
2699,
2761,
2797,
2798,
2822,
2823,
2837,
2838,
2866,
2878,
2899,
2900,
2915,
2916,
2935,
2966,
3018,
3059,
3082,
3083,
3101,
3102,
3136,
3172,
3173,
3189,
3190,
3209,
3235,
3271,
3272,
3288,
3289,
3315,
3396,
3401,
3414,
3415,
3454,
3455,
3521,
3585,
3647,
3709,
3775,
3776,
3822,
3823,
3928,
3971,
3972,
4021,
4185,
4186,
4227,
4330,
4331,
4394,
4466,
4467,
4513,
4545,
4546,
4603,
4647,
4648,
4678,
4746,
4747,
4796,
4893,
4894,
4946,
4947,
5489,
5490,
5509,
5510,
5556,
5557,
5599,
5600,
5610,
6108,
6119,
6438,
6449,
6462,
6473,
6521,
6532
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 6532,
"ccnet_original_nlines": 143,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.19437339901924133,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.014705879613757133,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3184143304824829,
"rps_doc_frac_unique_words": 0.43694689869880676,
"rps_doc_mean_word_length": 5.601769924163818,
"rps_doc_num_sentences": 133,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.400487422943115,
"rps_doc_word_count": 904,
"rps_doc_frac_chars_dupe_10grams": 0.022906789556145668,
"rps_doc_frac_chars_dupe_5grams": 0.14375987648963928,
"rps_doc_frac_chars_dupe_6grams": 0.0876777321100235,
"rps_doc_frac_chars_dupe_7grams": 0.0876777321100235,
"rps_doc_frac_chars_dupe_8grams": 0.07227487862110138,
"rps_doc_frac_chars_dupe_9grams": 0.07227487862110138,
"rps_doc_frac_chars_top_2gram": 0.011058449745178223,
"rps_doc_frac_chars_top_3gram": 0.02014218084514141,
"rps_doc_frac_chars_top_4gram": 0.021327009424567223,
"rps_doc_books_importance": -681.58349609375,
"rps_doc_books_importance_length_correction": -681.58349609375,
"rps_doc_openwebtext_importance": -368.66253662109375,
"rps_doc_openwebtext_importance_length_correction": -368.66253662109375,
"rps_doc_wikipedia_importance": -317.69805908203125,
"rps_doc_wikipedia_importance_length_correction": -317.69805908203125
},
"fasttext": {
"dclm": 0.02605658955872059,
"english": 0.6510855555534363,
"fineweb_edu_approx": 1.756168246269226,
"eai_general_math": 0.03982282057404518,
"eai_open_web_math": 0.17449915409088135,
"eai_web_code": 0.01665562018752098
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "791.83",
"labels": {
"level_1": "Arts",
"level_2": "Amusements and Recreation",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,487,069,213,228,326,000 |
What format for new ext. HD?
Discussion in 'Mac Basics and Help' started by flyfish29, May 28, 2007.
1. flyfish29 macrumors 68020
flyfish29
Joined:
Feb 4, 2003
Location:
New HAMpshire
#1
I just bought a Seagate 80 GB free agent Go and I know I need to reformat it-
I see under disk utility there are several options for the Mac. Which one should I choose?
Also, when I am done hooking up the HD to my laptop do I need to drag the icon to the trash before unplugging the USB cables?
2. JNB macrumors 604
JNB
Joined:
Oct 7, 2004
Location:
In a Hell predominately of my own making
#2
HFS+ should cover ya'. May also list as Mac Extended (Journaled)
3. flyfish29 thread starter macrumors 68020
flyfish29
Joined:
Feb 4, 2003
Location:
New HAMpshire
#3
There is a Mac Extended (Journaled) and a Mac Extended (Case sensitive Journaled)...I assume the first one is right?
What is journaled and why do I want it?
What would case sensitive mean as far as HD's formatting goes?
4. JNB macrumors 604
JNB
Joined:
Oct 7, 2004
Location:
In a Hell predominately of my own making
#4
I'm sure I'll get corrected (or at least amplified on), but real simply, journaling a Unix file system writes system changes to a journal before making the actual file system change. (http://en.wikipedia.org/wiki/Journaling_file_system). It used to be a purely server-related formatting, but has found it's way into general desktop use on everyday *nix systems. It's a generally recommended method, though I'm also sure some will argue against it.
Case-sensitive journaling I've never seen the value of, and is actually contraindicated (http://www.macfixit.com/staticpages/index.php?page=2003111009264885)
5. Luigi239 macrumors 6502a
Joined:
Jan 25, 2007
#5
If you need to do any file sharing with windows, use Fat32 or MS DOS file system. OS X can still read and write to fat32 just fine. The reason to do this is that Windows cannot read HFS+. The only thing you lose by going Fat32 is being able to boot off of the drive into OS X.
6. Peace macrumors P6
Peace
Joined:
Apr 1, 2005
Location:
Space--The ONLY Frontier
#6
To answer the other part of your question one should always "unmount" any external drive before disconnecting the USB cable.There may be apps or the system writing or reading from the drive and than can corrupt data.
7. flyfish29 thread starter macrumors 68020
flyfish29
Joined:
Feb 4, 2003
Location:
New HAMpshire
#7
Nope- I don't do Windows or windows!!!
Thanks everyone for the help- I will assume that I just need to drag the icon to the trash to remove the drive.
Share This Page
|
{
"url": "https://forums.macrumors.com/threads/what-format-for-new-ext-hd.308184/",
"source_domain": "forums.macrumors.com",
"snapshot_id": "crawl=CC-MAIN-2017-34",
"warc_metadata": {
"Content-Length": "161304",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:YXYJQENZBYSAWCJBW5OMCMDK33ZXT4WG",
"WARC-Concurrent-To": "<urn:uuid:223c72e6-012e-436c-8c7a-48aeb70b27d3>",
"WARC-Date": "2017-08-23T01:26:53Z",
"WARC-IP-Address": "162.254.116.214",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:JXIIT24LPFRRDI3ZUJYLRFFXHODRZEKB",
"WARC-Record-ID": "<urn:uuid:54d2da7b-20fe-4206-a636-fc01c00ef927>",
"WARC-Target-URI": "https://forums.macrumors.com/threads/what-format-for-new-ext-hd.308184/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:0d3c6004-8d07-489b-874c-e7548b1ce1c4>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-166-41-113.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-34\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for August 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
29,
30,
102,
103,
134,
135,
149,
150,
162,
178,
192,
210,
217,
299,
300,
395,
396,
397,
527,
533,
556,
557,
565,
566,
578,
594,
608,
653,
660,
729,
735,
781,
782,
796,
797,
809,
825,
839,
857,
864,
985,
986,
1030,
1031,
1098,
1104,
1127,
1128,
1136,
1137,
1149,
1165,
1179,
1224,
1231,
1683,
1684,
1846,
1852,
1882,
1883,
1895,
1912,
1919,
2200,
2206,
2230,
2231,
2241,
2242,
2254,
2270,
2284,
2313,
2320,
2541,
2547,
2593,
2594,
2608,
2609,
2621,
2637,
2651,
2669,
2676,
2719,
2720,
2836,
2842,
2843
],
"line_end_idx": [
29,
30,
102,
103,
134,
135,
149,
150,
162,
178,
192,
210,
217,
299,
300,
395,
396,
397,
527,
533,
556,
557,
565,
566,
578,
594,
608,
653,
660,
729,
735,
781,
782,
796,
797,
809,
825,
839,
857,
864,
985,
986,
1030,
1031,
1098,
1104,
1127,
1128,
1136,
1137,
1149,
1165,
1179,
1224,
1231,
1683,
1684,
1846,
1852,
1882,
1883,
1895,
1912,
1919,
2200,
2206,
2230,
2231,
2241,
2242,
2254,
2270,
2284,
2313,
2320,
2541,
2547,
2593,
2594,
2608,
2609,
2621,
2637,
2651,
2669,
2676,
2719,
2720,
2836,
2842,
2843,
2858
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2858,
"ccnet_original_nlines": 91,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3154246211051941,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.06239167973399162,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.25129982829093933,
"rps_doc_frac_unique_words": 0.5101580023765564,
"rps_doc_mean_word_length": 4.525959491729736,
"rps_doc_num_sentences": 37,
"rps_doc_symbol_to_word_ratio": 0.013864819891750813,
"rps_doc_unigram_entropy": 5.106300354003906,
"rps_doc_word_count": 443,
"rps_doc_frac_chars_dupe_10grams": 0.18004988133907318,
"rps_doc_frac_chars_dupe_5grams": 0.2069825381040573,
"rps_doc_frac_chars_dupe_6grams": 0.2069825381040573,
"rps_doc_frac_chars_dupe_7grams": 0.2069825381040573,
"rps_doc_frac_chars_dupe_8grams": 0.2069825381040573,
"rps_doc_frac_chars_dupe_9grams": 0.18004988133907318,
"rps_doc_frac_chars_top_2gram": 0.01197007019072771,
"rps_doc_frac_chars_top_3gram": 0.03441397100687027,
"rps_doc_frac_chars_top_4gram": 0.04339151829481125,
"rps_doc_books_importance": -293.0218200683594,
"rps_doc_books_importance_length_correction": -293.0218200683594,
"rps_doc_openwebtext_importance": -141.44407653808594,
"rps_doc_openwebtext_importance_length_correction": -141.44407653808594,
"rps_doc_wikipedia_importance": -130.35145568847656,
"rps_doc_wikipedia_importance_length_correction": -130.35145568847656
},
"fasttext": {
"dclm": 0.5631443858146667,
"english": 0.9158164262771606,
"fineweb_edu_approx": 1.9894733428955078,
"eai_general_math": 0.1445683240890503,
"eai_open_web_math": 0.41592633724212646,
"eai_web_code": 0.0004000100016128272
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.456",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,549,577,133,371,465,000 |
FRACTIONS
Fractions
Any unit can be divided into any numbers of equal parts, one or more of this parts is called fraction of that unit. e.g. one-forth (1/4), one-third (1/3), three-seventh (3/7) etc.
The lower part indicates the number of equal parts into which the unit is divided, is called denominator. The upper part, which indicates the number of parts taken from the fraction is called the numerator. The numerator and the denominator of a fraction are called its terms.
• A fraction is unity, when its numerator and denominator are equal.
• A fraction is equal to zero if its numerator is zero.
• The denominator of a fraction can never be zero.
• The value of a fraction is not altered by multiplying or dividing the numerator and the denominator by the same number.e.g. 2/3 = 2/6 = 8/12 = (2/4)/(3/4)
• When there is no common factor between numerator and denominator it is called in its lowest terms.e.g. 15/25 = 3/5
• When a fraction is reduced to its lowest term, its numerator and denominator are prime to each other.
• When the numerator and denominator are divided by its HCF, fraction reduces to its lowest term.
Proper fraction:
A fraction in which numerator is less than the denominator. e.g. 1/4, 3/4, 11/12 etc.
Improper Fraction: A fraction in which numerator is equal to or more than the denominator. e.g. 5/4, 7/4, 13/12 etc.
Like fraction: Fractions in which denominators are same is called like fractions.
e.g. 1/12, 5/12, 7/12, 13/12 etc.
Unlike fraction: Fractions in which denominators are not same is called, unlike fractions.
e.g. 1/12, 5/7, 7/9 13/11 etc.
Compound Fraction: Fraction of a fraction is called a compound fraction.
e.g. 1/2 of 3/4 is a compound fraction.
Complex Fractions: Fractions in which numerator or denominator or both are fractions, are called complex fractions.
Continued fraction: Fraction that contain additional fraction is called continued fraction.
e.g.
Rule: To simplify a continued fraction, begin from the bottom and move upwards.
Decimal Fractions: Fractions in which denominators are 10 or multiples of 10 is called, decimal fractions. e.g. 1/10, 3/100, 2221/10000 etc.
Recurring Decimal: If in a decimal fraction a digit or a set of digits is repeated continuously, then such a number is called a recurring decimal. It is expressed by putting a dot or bar over the digits. e.g.
Pure recurring decimal: A decimal fraction in which all the figures after the decimal point is repeated is called a pure recurring decimal.
Mixed recurring decimal: A decimal fraction in which only some of the figures after the decimal point is repeated is called a mixed recurring decimal.
Conversion of recurring decimal into proper fraction:
CASE I: Pure recurring decimal
Write the repeated digit only once in the numerator and put as many nines as in the denominator as the number of repeating figures. e.g.
CASE II: Mixed recurring decimal
In the numerator, take the difference between the number formed by all the digits after the decimal point and that formed by the digits which are not repeated. In the denominator, take the number formed as many nines as there are repeating digits followed by as many zeros as is the number of non-repeating digits. e.g.
Questions
Level-I
1.
Evaluate :(2.39)2 – (1.61)2
2.39 – 1.61
A.2
B.4
C.6
D.8
2.What decimal of an hour is a second ?
A..0025
B..0256
C..00027
D..000126
3.
The value of(0.96)3 – (0.1)3is:
(0.96)2 + 0.096 + (0.1)2
A.0.86
B.0.95
C.0.97
D.1.06
4.
The value of0.1 x 0.1 x 0.1 + 0.02 x 0.02 x 0.02is:
0.2 x 0.2 x 0.2 + 0.04 x 0.04 x 0.04
A.0.0125
B.0.125
C.0.25
D.0.5
5.If 2994 ÷ 14.5 = 172, then 29.94 ÷ 1.45 = ?
A.0.172
B.1.72
C.17.2
D.172
6.
When 0.232323….. is converted into a fraction, then the result is:
A.
1
5
B.
2
9
C.
23
99
D.
23
100
7.
.009= .01
?
A..0009
B..09
C..9
D.9
8.The expression (11.98 x 11.98 + 11.98 x x + 0.02 x 0.02) will be a perfect square for x equal to:
A.0.02
B.0.2
C.0.04
D.0.4
9.
(0.1667)(0.8333)(0.3333)is approximately equal to:
(0.2222)(0.6667)(0.1250)
A.2
B.2.40
C.2.43
D.2.50
10.3889 + 12.952 – ? = 3854.002
A.47.095
B.47.752
C.47.932
D.47.95
11.
Level-II
0.04 x 0.0162 is equal to:
A.6.48 x 10-3
B.6.48 x 10-4
C.6.48 x 10-5
D.6.48 x 10-6
12.
4.2 x 4.2 – 1.9 x 1.9is equal to:
2.3 x 6.1
A.0.5
B.1.0
C.20
D.22
13.
If144=14.4, then the value of x is:
0.144x
A.0.0144
B.1.44
C.14.4
D.144
14.The price of commodity X increases by 40 paise every year, while the price of commodity Y increases by 15 paise every year. If in 2001, the price of commodity X was Rs. 4.20 and that of Y was Rs. 6.30, in which year commodity X will cost 40 paise more than the commodity Y ?
A.2010
B.2011
C.2012
D.2013
15.
Which of the following are in descending order of their value ?
A.
1,2,3,4,5,6
357567
B.
1,2,3,4,5,6
355767
C.
1,2,3,4,5,6
355677
D.
6,5,4,3,2,1
765753
16.
Which of the following fractions is greater than3and less than5?
46
A.
1
2
B.
2
3
C.
4
5
D.
9
10
17.The rational number for recurring decimal 0.125125…. is:
A.
63
487
B.
119
993
C.
125
999
D.None of these
18.617 + 6.017 + 0.617 + 6.0017 = ?
A.6.2963
B.62.965
C.629.6357
D.None of these
19.
The value of489.1375 x 0.0483 x 1.956is closest to:
0.0873 x 92.581 x 99.749
A.0.006
B.0.06
C.0.6
D.6
20.0.002 x 0.5 = ?
A.0.0001
B.0.001
C.0.01
D.0.1
Answers
Level-I
Answer:1 Option B
Explanation:
Given Expression =a2 – b2=(a + b)(a – b)= (a + b) = (2.39 + 1.61) = 4.
a – b(a – b)
Answer:2 Option C
Explanation:
Required decimal =1=1= .00027
60 x 603600
Answer:3 Option A
Explanation:
Given expression
=(0.96)3 – (0.1)3
(0.96)2 + (0.96 x 0.1) + (0.1)2
=a3 – b3
a2 + ab + b2
= (a – b)
= (0.96 – 0.1)
= 0.86
Answer:4 Option B
Explanation:
Given expression =(0.1)3 + (0.02)3=1= 0.125
23 [(0.1)3 + (0.02)3]8
Answer:5 Option C
Explanation:
29.94=299.4
1.4514.5
=2994x1[ Here, Substitute 172 in the place of 2994/14.5 ]
14.510
=172
10
= 17.2
Answer:6 Option C
Explanation:
0.232323… = 0.23 =23
99
Answer:7 Option C
Explanation:
Let.009= .01; Then x =.009=.9= .9
x.011
Answer:8 Option C
Explanation:
Given expression = (11.98)2 + (0.02)2 + 11.98 x x.
For the given expression to be a perfect square, we must have
11.98 x x = 2 x 11.98 x 0.02 or x = 0.04
Answer:9 Option D
Explanation:
Given expression
=(0.3333)x(0.1667)(0.8333)
(0.2222)(0.6667)(0.1250)
=3333x
1x5
66
2222
2x125
31000
=3x1x5x3x 8
2662
=5
2
= 2.50
Answer:10 Option D
Explanation:
Let 3889 + 12.952 – x = 3854.002.
Then x = (3889 + 12.952) – 3854.002
= 3901.952 – 3854.002
= 47.95.
Level-II
Answer:11 Option B
Explanation:
4 x 162 = 648. Sum of decimal places = 6.
So, 0.04 x 0.0162 = 0.000648 = 6.48 x 10-4
Answer:12 Option B
Explanation:
Given Expression =(a2 – b2)=(a2 – b2)= 1.
(a + b)(a – b)(a2 – b2)
Answer:13 Option A
Explanation:
144=14.4
0.144x
144 x 1000=14.4
144x
x =14.4= 0.0144
1000
Answer:14 Option B
Explanation:
Suppose commodity X will cost 40 paise more than Y after z years.
Then, (4.20 + 0.40z) – (6.30 + 0.15z) = 0.40
0.25z = 0.40 + 2.10
z =2.50=250= 10.
0.2525
X will cost 40 paise more than Y 10 years after 2001 i.e., 2011.
Answer:15 Option D
Answer:16 Option C
Explanation:
3= 0.75,5= 0.833,1= 0.5,2= 0.66,4= 0.8,9= 0.9.
4623510
Clearly, 0.8 lies between 0.75 and 0.833.
4lies between3and5.
546
Answer:17 Option C
Explanation:
0.125125… = 0.125 =125
999
Answer:18 Option C
Explanation:
617.00
6.017
0.617
+ 6.0017
——–
629.6357
———
Answer:19 Option B
Explanation:
489.1375 x 0.0483 x 1.956489 x 0.05 x 2
0.0873 x 92.581 x 99.7490.09 x 93 x 100
=489
9 x 93 x 10
=163x1
27910
=0.58
10
= 0.058 0.06.
Answer:20 Option B
Explanation:
2 x 5 = 10.
Sum of decimal places = 4
0.002 x 0.5 = 0.001
UKPCS Notes brings Prelims and Mains programs for UKPCS Prelims and UKPCS Mains Exam preparation. Various Programs initiated by UKPCS Notes are as follows:- For any doubt, Just leave us a Chat or Fill us a querry––
error: Content is protected !!
|
{
"url": "http://uttarakhand.pscnotes.com/prelims-notes/aptitude-reasoning/fractions/",
"source_domain": "uttarakhand.pscnotes.com",
"snapshot_id": "crawl=CC-MAIN-2022-33",
"warc_metadata": {
"Content-Length": "190153",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:IQR73MNJIZG44LX26KYOLM4XLZHWDDE2",
"WARC-Concurrent-To": "<urn:uuid:12812f5a-174a-43a4-b47e-7d08d911264d>",
"WARC-Date": "2022-08-10T05:40:42Z",
"WARC-IP-Address": "136.243.83.14",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:XL7BRLWXUVNP3H4KEBJ46UALIEB546Y7",
"WARC-Record-ID": "<urn:uuid:d7b96274-1539-4fd9-b086-39594d6b378c>",
"WARC-Target-URI": "http://uttarakhand.pscnotes.com/prelims-notes/aptitude-reasoning/fractions/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:5845d24a-dc1e-4330-92c6-7571b001c4b5>"
},
"warc_info": "isPartOf: CC-MAIN-2022-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-170\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
10,
11,
21,
201,
202,
479,
480,
551,
609,
662,
821,
940,
1046,
1146,
1147,
1148,
1165,
1252,
1253,
1255,
1256,
1374,
1375,
1377,
1378,
1460,
1461,
1495,
1496,
1498,
1499,
1590,
1591,
1622,
1623,
1625,
1626,
1699,
1700,
1740,
1741,
1743,
1744,
1860,
1861,
1863,
1864,
1956,
1957,
1962,
1963,
1965,
1966,
1968,
1969,
1971,
1972,
2052,
2053,
2055,
2056,
2197,
2198,
2200,
2201,
2410,
2411,
2413,
2414,
2416,
2417,
2557,
2558,
2560,
2561,
2712,
2713,
2715,
2716,
2771,
2772,
2803,
2804,
2806,
2807,
2944,
2945,
2947,
2948,
2981,
2982,
3302,
3303,
3305,
3315,
3316,
3324,
3325,
3327,
3328,
3331,
3332,
3360,
3372,
3376,
3380,
3384,
3388,
3389,
3391,
3392,
3432,
3440,
3448,
3457,
3467,
3468,
3470,
3471,
3473,
3474,
3477,
3478,
3510,
3535,
3542,
3549,
3556,
3563,
3564,
3566,
3567,
3569,
3570,
3573,
3574,
3626,
3663,
3672,
3680,
3687,
3693,
3694,
3696,
3697,
3743,
3751,
3758,
3765,
3771,
3773,
3774,
3776,
3777,
3779,
3780,
3783,
3784,
3786,
3787,
3789,
3790,
3792,
3793,
3860,
3861,
3864,
3866,
3868,
3871,
3873,
3875,
3878,
3881,
3884,
3887,
3890,
3894,
3895,
3897,
3898,
3901,
3911,
3913,
3921,
3927,
3932,
3936,
3937,
3939,
3940,
4040,
4047,
4053,
4060,
4066,
4067,
4069,
4070,
4073,
4124,
4149,
4153,
4160,
4167,
4174,
4177,
4178,
4180,
4181,
4213,
4222,
4231,
4240,
4248,
4250,
4251,
4253,
4254,
4256,
4257,
4259,
4260,
4262,
4263,
4265,
4266,
4270,
4271,
4273,
4274,
4276,
4277,
4279,
4280,
4289,
4290,
4292,
4293,
4295,
4296,
4323,
4324,
4338,
4352,
4366,
4380,
4381,
4383,
4384,
4388,
4422,
4432,
4438,
4444,
4449,
4454,
4455,
4457,
4458,
4460,
4461,
4465,
4466,
4502,
4509,
4518,
4525,
4532,
4538,
4539,
4541,
4542,
4544,
4545,
4547,
4548,
4826,
4833,
4840,
4847,
4854,
4855,
4857,
4858,
4860,
4861,
4865,
4866,
4868,
4869,
4933,
4934,
4937,
4949,
4956,
4959,
4971,
4978,
4981,
4993,
5000,
5003,
5015,
5022,
5024,
5025,
5027,
5028,
5032,
5033,
5035,
5036,
5101,
5104,
5107,
5109,
5111,
5114,
5116,
5118,
5121,
5123,
5125,
5128,
5130,
5133,
5134,
5136,
5137,
5197,
5200,
5203,
5207,
5210,
5214,
5218,
5221,
5225,
5229,
5245,
5246,
5248,
5249,
5285,
5294,
5303,
5314,
5330,
5331,
5333,
5334,
5336,
5337,
5341,
5342,
5394,
5419,
5427,
5434,
5440,
5444,
5445,
5447,
5448,
5467,
5476,
5484,
5491,
5497,
5498,
5500,
5501,
5503,
5504,
5506,
5507,
5509,
5510,
5512,
5513,
5521,
5522,
5530,
5531,
5549,
5550,
5552,
5553,
5566,
5567,
5638,
5651,
5652,
5654,
5655,
5656,
5674,
5675,
5677,
5678,
5691,
5692,
5722,
5734,
5735,
5737,
5738,
5740,
5741,
5759,
5760,
5762,
5763,
5776,
5777,
5794,
5812,
5844,
5853,
5866,
5877,
5893,
5900,
5901,
5919,
5920,
5922,
5923,
5936,
5937,
5981,
6004,
6005,
6007,
6008,
6010,
6011,
6013,
6014,
6016,
6017,
6035,
6036,
6038,
6039,
6052,
6053,
6065,
6074,
6075,
6077,
6078,
6136,
6143,
6144,
6146,
6147,
6152,
6155,
6156,
6163,
6164,
6166,
6167,
6169,
6170,
6188,
6189,
6191,
6192,
6205,
6206,
6227,
6230,
6231,
6233,
6234,
6252,
6253,
6255,
6256,
6269,
6270,
6308,
6314,
6315,
6317,
6318,
6320,
6321,
6339,
6340,
6342,
6343,
6356,
6357,
6408,
6409,
6471,
6472,
6515,
6516,
6518,
6519,
6537,
6538,
6540,
6541,
6554,
6555,
6572,
6599,
6624,
6631,
6635,
6638,
6643,
6649,
6655,
6667,
6672,
6675,
6677,
6684,
6685,
6687,
6688,
6707,
6708,
6710,
6711,
6724,
6725,
6759,
6760,
6796,
6797,
6819,
6820,
6829,
6830,
6832,
6833,
6842,
6843,
6862,
6863,
6865,
6866,
6879,
6880,
6922,
6965,
6966,
6968,
6969,
6988,
6989,
6991,
6992,
7005,
7006,
7048,
7072,
7073,
7075,
7076,
7078,
7079,
7098,
7099,
7101,
7102,
7115,
7116,
7125,
7132,
7133,
7135,
7136,
7152,
7157,
7158,
7160,
7161,
7178,
7183,
7184,
7186,
7187,
7189,
7190,
7209,
7210,
7212,
7213,
7226,
7227,
7293,
7294,
7339,
7340,
7360,
7361,
7379,
7386,
7387,
7452,
7453,
7455,
7456,
7458,
7459,
7461,
7462,
7481,
7482,
7501,
7502,
7504,
7505,
7518,
7519,
7566,
7574,
7575,
7617,
7618,
7638,
7642,
7643,
7645,
7646,
7648,
7649,
7651,
7652,
7671,
7672,
7674,
7675,
7688,
7689,
7712,
7716,
7717,
7719,
7720,
7722,
7723,
7742,
7743,
7745,
7746,
7759,
7760,
7767,
7768,
7774,
7775,
7781,
7782,
7792,
7793,
7797,
7798,
7807,
7808,
7812,
7813,
7815,
7816,
7835,
7836,
7838,
7839,
7852,
7853,
7893,
7933,
7934,
7936,
7937,
7942,
7954,
7955,
7957,
7958,
7965,
7971,
7972,
7974,
7975,
7981,
7984,
7985,
8000,
8001,
8003,
8004,
8023,
8024,
8026,
8027,
8040,
8041,
8053,
8054,
8080,
8081,
8101,
8102,
8317
],
"line_end_idx": [
10,
11,
21,
201,
202,
479,
480,
551,
609,
662,
821,
940,
1046,
1146,
1147,
1148,
1165,
1252,
1253,
1255,
1256,
1374,
1375,
1377,
1378,
1460,
1461,
1495,
1496,
1498,
1499,
1590,
1591,
1622,
1623,
1625,
1626,
1699,
1700,
1740,
1741,
1743,
1744,
1860,
1861,
1863,
1864,
1956,
1957,
1962,
1963,
1965,
1966,
1968,
1969,
1971,
1972,
2052,
2053,
2055,
2056,
2197,
2198,
2200,
2201,
2410,
2411,
2413,
2414,
2416,
2417,
2557,
2558,
2560,
2561,
2712,
2713,
2715,
2716,
2771,
2772,
2803,
2804,
2806,
2807,
2944,
2945,
2947,
2948,
2981,
2982,
3302,
3303,
3305,
3315,
3316,
3324,
3325,
3327,
3328,
3331,
3332,
3360,
3372,
3376,
3380,
3384,
3388,
3389,
3391,
3392,
3432,
3440,
3448,
3457,
3467,
3468,
3470,
3471,
3473,
3474,
3477,
3478,
3510,
3535,
3542,
3549,
3556,
3563,
3564,
3566,
3567,
3569,
3570,
3573,
3574,
3626,
3663,
3672,
3680,
3687,
3693,
3694,
3696,
3697,
3743,
3751,
3758,
3765,
3771,
3773,
3774,
3776,
3777,
3779,
3780,
3783,
3784,
3786,
3787,
3789,
3790,
3792,
3793,
3860,
3861,
3864,
3866,
3868,
3871,
3873,
3875,
3878,
3881,
3884,
3887,
3890,
3894,
3895,
3897,
3898,
3901,
3911,
3913,
3921,
3927,
3932,
3936,
3937,
3939,
3940,
4040,
4047,
4053,
4060,
4066,
4067,
4069,
4070,
4073,
4124,
4149,
4153,
4160,
4167,
4174,
4177,
4178,
4180,
4181,
4213,
4222,
4231,
4240,
4248,
4250,
4251,
4253,
4254,
4256,
4257,
4259,
4260,
4262,
4263,
4265,
4266,
4270,
4271,
4273,
4274,
4276,
4277,
4279,
4280,
4289,
4290,
4292,
4293,
4295,
4296,
4323,
4324,
4338,
4352,
4366,
4380,
4381,
4383,
4384,
4388,
4422,
4432,
4438,
4444,
4449,
4454,
4455,
4457,
4458,
4460,
4461,
4465,
4466,
4502,
4509,
4518,
4525,
4532,
4538,
4539,
4541,
4542,
4544,
4545,
4547,
4548,
4826,
4833,
4840,
4847,
4854,
4855,
4857,
4858,
4860,
4861,
4865,
4866,
4868,
4869,
4933,
4934,
4937,
4949,
4956,
4959,
4971,
4978,
4981,
4993,
5000,
5003,
5015,
5022,
5024,
5025,
5027,
5028,
5032,
5033,
5035,
5036,
5101,
5104,
5107,
5109,
5111,
5114,
5116,
5118,
5121,
5123,
5125,
5128,
5130,
5133,
5134,
5136,
5137,
5197,
5200,
5203,
5207,
5210,
5214,
5218,
5221,
5225,
5229,
5245,
5246,
5248,
5249,
5285,
5294,
5303,
5314,
5330,
5331,
5333,
5334,
5336,
5337,
5341,
5342,
5394,
5419,
5427,
5434,
5440,
5444,
5445,
5447,
5448,
5467,
5476,
5484,
5491,
5497,
5498,
5500,
5501,
5503,
5504,
5506,
5507,
5509,
5510,
5512,
5513,
5521,
5522,
5530,
5531,
5549,
5550,
5552,
5553,
5566,
5567,
5638,
5651,
5652,
5654,
5655,
5656,
5674,
5675,
5677,
5678,
5691,
5692,
5722,
5734,
5735,
5737,
5738,
5740,
5741,
5759,
5760,
5762,
5763,
5776,
5777,
5794,
5812,
5844,
5853,
5866,
5877,
5893,
5900,
5901,
5919,
5920,
5922,
5923,
5936,
5937,
5981,
6004,
6005,
6007,
6008,
6010,
6011,
6013,
6014,
6016,
6017,
6035,
6036,
6038,
6039,
6052,
6053,
6065,
6074,
6075,
6077,
6078,
6136,
6143,
6144,
6146,
6147,
6152,
6155,
6156,
6163,
6164,
6166,
6167,
6169,
6170,
6188,
6189,
6191,
6192,
6205,
6206,
6227,
6230,
6231,
6233,
6234,
6252,
6253,
6255,
6256,
6269,
6270,
6308,
6314,
6315,
6317,
6318,
6320,
6321,
6339,
6340,
6342,
6343,
6356,
6357,
6408,
6409,
6471,
6472,
6515,
6516,
6518,
6519,
6537,
6538,
6540,
6541,
6554,
6555,
6572,
6599,
6624,
6631,
6635,
6638,
6643,
6649,
6655,
6667,
6672,
6675,
6677,
6684,
6685,
6687,
6688,
6707,
6708,
6710,
6711,
6724,
6725,
6759,
6760,
6796,
6797,
6819,
6820,
6829,
6830,
6832,
6833,
6842,
6843,
6862,
6863,
6865,
6866,
6879,
6880,
6922,
6965,
6966,
6968,
6969,
6988,
6989,
6991,
6992,
7005,
7006,
7048,
7072,
7073,
7075,
7076,
7078,
7079,
7098,
7099,
7101,
7102,
7115,
7116,
7125,
7132,
7133,
7135,
7136,
7152,
7157,
7158,
7160,
7161,
7178,
7183,
7184,
7186,
7187,
7189,
7190,
7209,
7210,
7212,
7213,
7226,
7227,
7293,
7294,
7339,
7340,
7360,
7361,
7379,
7386,
7387,
7452,
7453,
7455,
7456,
7458,
7459,
7461,
7462,
7481,
7482,
7501,
7502,
7504,
7505,
7518,
7519,
7566,
7574,
7575,
7617,
7618,
7638,
7642,
7643,
7645,
7646,
7648,
7649,
7651,
7652,
7671,
7672,
7674,
7675,
7688,
7689,
7712,
7716,
7717,
7719,
7720,
7722,
7723,
7742,
7743,
7745,
7746,
7759,
7760,
7767,
7768,
7774,
7775,
7781,
7782,
7792,
7793,
7797,
7798,
7807,
7808,
7812,
7813,
7815,
7816,
7835,
7836,
7838,
7839,
7852,
7853,
7893,
7933,
7934,
7936,
7937,
7942,
7954,
7955,
7957,
7958,
7965,
7971,
7972,
7974,
7975,
7981,
7984,
7985,
8000,
8001,
8003,
8004,
8023,
8024,
8026,
8027,
8040,
8041,
8053,
8054,
8080,
8081,
8101,
8102,
8317,
8347
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 8347,
"ccnet_original_nlines": 714,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.1836327314376831,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05189621075987816,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5816367268562317,
"rps_doc_frac_unique_words": 0.3759455382823944,
"rps_doc_mean_word_length": 4.239031791687012,
"rps_doc_num_sentences": 399,
"rps_doc_symbol_to_word_ratio": 0.0015968099469318986,
"rps_doc_unigram_entropy": 5.472301483154297,
"rps_doc_word_count": 1322,
"rps_doc_frac_chars_dupe_10grams": 0.017487509176135063,
"rps_doc_frac_chars_dupe_5grams": 0.12562455236911774,
"rps_doc_frac_chars_dupe_6grams": 0.08708065748214722,
"rps_doc_frac_chars_dupe_7grams": 0.0731620267033577,
"rps_doc_frac_chars_dupe_8grams": 0.03390435129404068,
"rps_doc_frac_chars_dupe_9grams": 0.017487509176135063,
"rps_doc_frac_chars_top_2gram": 0.017130620777606964,
"rps_doc_frac_chars_top_3gram": 0.025695929303765297,
"rps_doc_frac_chars_top_4gram": 0.013918629847466946,
"rps_doc_books_importance": -848.5880737304688,
"rps_doc_books_importance_length_correction": -848.5880737304688,
"rps_doc_openwebtext_importance": -466.2485656738281,
"rps_doc_openwebtext_importance_length_correction": -466.2485656738281,
"rps_doc_wikipedia_importance": -486.7413024902344,
"rps_doc_wikipedia_importance_length_correction": -486.7413024902344
},
"fasttext": {
"dclm": 0.9384865164756775,
"english": 0.6102554798126221,
"fineweb_edu_approx": 3.042603015899658,
"eai_general_math": 0.1985517144203186,
"eai_open_web_math": 0.9072794914245605,
"eai_web_code": 0.0009228599956259131
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "513.2",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry"
}
},
"secondary": {
"code": "372.7",
"labels": {
"level_1": "Social sciences",
"level_2": "Education",
"level_3": "Education, Elementary and Kindergarten"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,669,549,538,060,624,000 |
asp:repeater
hi.
i have a UserControl i created. for datarow in my dataset i want to display one of these controls on my page. do i want to use a repeater control to do this? how do i pass a datarow to each of the user controls created?
thx. bg
BeerGodAsked:
Who is Participating?
mmarinovConnect With a Mentor Commented:
Hi BeerGod,
you can use datagrid, repeater or datalist - everything depends on the purpose
all of these controls has an event ItemDataBound (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsDataListClassItemDataBoundTopic.asp) which is fired before the current row of the control is shown
so if you use this event ( and the example of the given url ) you can pass a value from your datarow to the user control
Regards!
B..M
0
raed_hasanCommented:
Inside the ItemTemplate for the Repeater you can add the markup for
your user control.
<ItemTemplate>
<uc:MyControl runat="server" id="MyControl1"/>
</ItemTemplate>
Catch the Repeater's data binding event to manipulate your user
control in each row:
protected void Repeater1_ItemDataBound(
object sender,
RepeaterItemEventArgs e
)
{
// get the control
MyControl c = e.Item.FincControl("MyControl1");
// get the data container
object o = e.Item.DataItem;
// get o into c
}
Makeing some sense?
0
BeerGodAuthor Commented:
thx. that was easy.
0
All Courses
From novice to tech pro — start learning today.
|
{
"url": "https://www.experts-exchange.com/questions/21167651/asp-repeater.html",
"source_domain": "www.experts-exchange.com",
"snapshot_id": "crawl=CC-MAIN-2018-09",
"warc_metadata": {
"Content-Length": "94315",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:FJ5IGKR46422GMLQDETFVO3BDBOVR7AM",
"WARC-Concurrent-To": "<urn:uuid:b2b387a8-9859-405e-9caa-47b0c28bc857>",
"WARC-Date": "2018-02-25T18:13:03Z",
"WARC-IP-Address": "104.20.169.10",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:7IN2OWBGSTNS6GUJFRY274KRDA3LYB26",
"WARC-Record-ID": "<urn:uuid:8bce1848-1f02-4f14-8db3-0d1a33725410>",
"WARC-Target-URI": "https://www.experts-exchange.com/questions/21167651/asp-repeater.html",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:dc849385-f61d-45a1-a8a8-1007741eb7a7>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-228-65-216.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-09\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for February 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
13,
14,
18,
19,
240,
241,
249,
263,
285,
287,
328,
340,
341,
420,
672,
794,
795,
804,
809,
811,
813,
834,
902,
921,
922,
937,
988,
1004,
1005,
1069,
1090,
1091,
1131,
1154,
1186,
1192,
1194,
1217,
1269,
1271,
1301,
1333,
1334,
1354,
1355,
1357,
1358,
1378,
1380,
1382,
1407,
1427,
1429,
1441,
1442
],
"line_end_idx": [
13,
14,
18,
19,
240,
241,
249,
263,
285,
287,
328,
340,
341,
420,
672,
794,
795,
804,
809,
811,
813,
834,
902,
921,
922,
937,
988,
1004,
1005,
1069,
1090,
1091,
1131,
1154,
1186,
1192,
1194,
1217,
1269,
1271,
1301,
1333,
1334,
1354,
1355,
1357,
1358,
1378,
1380,
1382,
1407,
1427,
1429,
1441,
1442,
1489
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1489,
"ccnet_original_nlines": 55,
"rps_doc_curly_bracket": 0.0013431799598038197,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3569023609161377,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.006734009832143784,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2457912564277649,
"rps_doc_frac_unique_words": 0.5763546824455261,
"rps_doc_mean_word_length": 5.536945819854736,
"rps_doc_num_sentences": 23,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.514517784118652,
"rps_doc_word_count": 203,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.013345199637115002,
"rps_doc_frac_chars_top_3gram": 0.01245552022010088,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -116.14270782470703,
"rps_doc_books_importance_length_correction": -108.11714172363281,
"rps_doc_openwebtext_importance": -83.73453521728516,
"rps_doc_openwebtext_importance_length_correction": -83.73453521728516,
"rps_doc_wikipedia_importance": -68.61918640136719,
"rps_doc_wikipedia_importance_length_correction": -57.354888916015625
},
"fasttext": {
"dclm": 0.05683350935578346,
"english": 0.6917835474014282,
"fineweb_edu_approx": 1.5750744342803955,
"eai_general_math": 0.023965179920196533,
"eai_open_web_math": 0.27693748474121094,
"eai_web_code": 0.498318612575531
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.13",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,724,281,648,945,065,000 |
0
Hello!
I am about to load details from a file and save it to a node. I am having an error regarding to a certain code. Here's the code::
boolean loadFromFile(String filename) throws Exception{
boolean b = false;
try{
FileInputStream myfile = new FileInputStream(filename);
ObjectInputStream in = new ObjectInputStream(myfile);
do{
start = (Node)(in.readObject()); /*This part is the error. Cannot cast a String into a Node */
System.out.println(start.toString());
b = true;
}while(b == true);
in.close();
}catch (EOFException e){
System.out.println("EOF");
b = false;
}catch(Exception e){
System.out.println(e.getMessage());
System.out.println("Cannot load file");
}
return b;
}
You might also need the code for saveToFile. (since this might cause the problem)
boolean saveToFile(String filename) throws Exception{
boolean b = false;
try{
FileOutputStream myfile = new FileOutputStream(filename);
ObjectOutputStream out = new ObjectOutputStream(myfile);
System.out.println("Writing files...");
index = start;
do{
out.writeObject(index); //Or out.writeObject(index.toString()) though I do not think this will work.
index = index.next;
}while(index!=null);
out.close();
}catch(Exception e){
System.out.println(e.getMessage());
System.out.println("File not existing.");
b = false;
}
return b;
}
Any suggestions regarding to this matter? Thank you very much.
Edited by chixm8_49: n/a
2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by __avd
0
Line #7 - in.readObject() method reads something which is not belonging to Node object. Can you maybe provide some more information about class Node.
0
Line #7 - in.readObject() method reads something which is not belonging to Node object. Can you maybe provide some more information about class Node.
class Node{
private String elname; //surname
private String efname; //first name
private String work; //position
private int floorno; //floor number
Node next;
}
This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.
|
{
"url": "https://www.daniweb.com/programming/software-development/threads/261222/loading-nodes-from-a-file",
"source_domain": "www.daniweb.com",
"snapshot_id": "crawl=CC-MAIN-2017-09",
"warc_metadata": {
"Content-Length": "40627",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:7DLUPEO7ZPWZ64KBIDJB2NQLU4AX2QR4",
"WARC-Concurrent-To": "<urn:uuid:f4ba76e6-e8f0-47b8-83e7-9136a04b936f>",
"WARC-Date": "2017-02-22T06:33:51Z",
"WARC-IP-Address": "198.23.117.137",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:M5A55REYRSI5D2GLR6S2ZH4Q3SERNG6W",
"WARC-Record-ID": "<urn:uuid:e630c995-280c-46d7-9af8-a3bc99ed090b>",
"WARC-Target-URI": "https://www.daniweb.com/programming/software-development/threads/261222/loading-nodes-from-a-file",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:44d4c88e-a242-4e4d-b078-ebb0f1822798>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-171-10-108.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2017-09\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for February 2017\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
2,
3,
10,
11,
141,
142,
198,
219,
226,
285,
342,
349,
448,
490,
504,
526,
541,
568,
598,
612,
635,
674,
717,
721,
724,
736,
739,
740,
822,
876,
877,
896,
903,
964,
1024,
1067,
1085,
1092,
1197,
1221,
1245,
1261,
1264,
1287,
1326,
1371,
1385,
1389,
1401,
1404,
1405,
1468,
1469,
1494,
1495,
1497,
1510,
1512,
1520,
1522,
1528,
1536,
1552,
1571,
1573,
1574,
1724,
1725,
1727,
1728,
1878,
1879,
1891,
1932,
1969,
2002,
2039,
2051,
2053,
2133
],
"line_end_idx": [
2,
3,
10,
11,
141,
142,
198,
219,
226,
285,
342,
349,
448,
490,
504,
526,
541,
568,
598,
612,
635,
674,
717,
721,
724,
736,
739,
740,
822,
876,
877,
896,
903,
964,
1024,
1067,
1085,
1092,
1197,
1221,
1245,
1261,
1264,
1287,
1326,
1371,
1385,
1389,
1401,
1404,
1405,
1468,
1469,
1494,
1495,
1497,
1510,
1512,
1520,
1522,
1528,
1536,
1552,
1571,
1573,
1574,
1724,
1725,
1727,
1728,
1878,
1879,
1891,
1932,
1969,
2002,
2039,
2051,
2053,
2133,
2271
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2271,
"ccnet_original_nlines": 80,
"rps_doc_curly_bracket": 0.008806689642369747,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2776618003845215,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.008350729942321777,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.33820459246635437,
"rps_doc_frac_unique_words": 0.5812274217605591,
"rps_doc_mean_word_length": 5.891696929931641,
"rps_doc_num_sentences": 45,
"rps_doc_symbol_to_word_ratio": 0.0062630497850477695,
"rps_doc_unigram_entropy": 4.865025043487549,
"rps_doc_word_count": 277,
"rps_doc_frac_chars_dupe_10grams": 0.14705881476402283,
"rps_doc_frac_chars_dupe_5grams": 0.19485293328762054,
"rps_doc_frac_chars_dupe_6grams": 0.19485293328762054,
"rps_doc_frac_chars_dupe_7grams": 0.19485293328762054,
"rps_doc_frac_chars_dupe_8grams": 0.14705881476402283,
"rps_doc_frac_chars_dupe_9grams": 0.14705881476402283,
"rps_doc_frac_chars_top_2gram": 0.014705879613757133,
"rps_doc_frac_chars_top_3gram": 0.028186269104480743,
"rps_doc_frac_chars_top_4gram": 0.036764711141586304,
"rps_doc_books_importance": -222.4737548828125,
"rps_doc_books_importance_length_correction": -222.4737548828125,
"rps_doc_openwebtext_importance": -102.66828155517578,
"rps_doc_openwebtext_importance_length_correction": -102.66828155517578,
"rps_doc_wikipedia_importance": -74.13964080810547,
"rps_doc_wikipedia_importance_length_correction": -74.13964080810547
},
"fasttext": {
"dclm": 0.24103665351867676,
"english": 0.7292249798774719,
"fineweb_edu_approx": 2.1972436904907227,
"eai_general_math": 0.15121042728424072,
"eai_open_web_math": 0.1291365623474121,
"eai_web_code": 0.01708585023880005
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "1",
"label": "Truncated Snippets"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "2",
"label": "Partially Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-4,804,334,274,253,447,000 |
the software development company
Best Strategies for Managing Bugs and Feature Requests
Matt Warcholinski
Jan 4, 2021
According to many seasoned software developers, bug-free software doesn’t exist. As annoying and frustrating as bugs can be, they are an integral part of software development, which is why it’s so crucial to know how to manage them effectively.
Strategies for managing bugs and feature requests must keep up with the rapid evolution of development methodologies and knowledge of testing practices. Simply put, agile mobile app developers and web app developers need agile strategies for managing bugs and feature requests, which is exactly what this article is all about.
The cost of bugs
On a small scale, we perceive bugs as annoyances that slow down software development and leave users with a negative impression of the product. But when we zoom out, the real cost of bugs becomes obvious. According to a report issued by the Austrian software testing firm Tricentis, software failures cost the worldwide economy over $1 trillion annually, which is about as much as the GDP of South Korea.
What’s more, the report found out that software failures have caused more than 315 years of lost time and have affected approximately 4.4 billion customers. Software failures also have a massive negative impact on the reputation of companies. The companies surveyed by Tricentis lost an average of $2.3 billion of shareholder value just on the first day after announcing a software failure. No wonder that so many companies keep quiet about bugs.
If we zoom back in, we can see that bugs become more expensive to fix the longer it takes to uncover them. According to IBM, bugs found after product release are 4 to 5 times costlier than bugs uncovered during the design phase, and as much as 100 times costlier than those identified in the maintenance phase.
When companies get stuck with outdated strategies for managing bugs and feature requests, they risk releasing buggy software and paying the steep price for it. The good news is that teams can now enjoy greater flexibility than ever when adding features, making changes, and checking for bugs thanks to Agile’s incremental approach to software development.
Agile strategies for managing bugs
If you’re familiar with the traditional waterfall approach to software development, you know that scope on waterfall projects is rigidly managed and not flexible at all. On the other hand, agile software development is all about change and achieving customer satisfaction with frequent iteration.
Instead of fitting outdated strategies for managing bugs and feature requests into an Agile model of development, it’s recommended to start with an Agile strategy from the get-go.
Make your bugs visible
“Keeping a database of bugs is the hallmark of a good software team,” believes Joel Spolsky, CEO of Stack Overflow. While it’s entirely possible to track bugs using Microsoft Excel, the benefits of using a bug tracking and issue tracking system are too great to ignore.
Many Agile teams live inside Pivotal Tracker, an Agile project management tool with support for real-time collaboration around a shared, prioritized backlog.
Pivotal Tracker integrates with leading issue tracking solutions, including:
• Redmine – a free and open source project management and issue tracking tool that allows users to manage multiple projects and associated subprojects,
• Bugsnag – a stability monitoring solutions that makes it easier to decide whether you should be building features or fixing bugs,
• Bugzilla – a widely used defect-tracking system originally developed and used by the Mozilla project and licensed under the Mozilla Public License.
A good bug tracking and issue tracking system ensures that known bugs are fixed by allowing companies to keep a record of detected bugs, brings the whole team together by providing better communication through chat interfaces, allows end users to report bugs and make feature requests directly on their applications, and, above all else, makes it easy to prioritize bugs and assign issues.
Prioritize your bugs
When Agile teams allow the backlog of reported bugs to grow organically, it can spiral out of control and become completely unmanageable. That’s why it’s paramount to prioritize bugs, and do it the right way.
Typically, bugs are prioritized according to their priority (P), which is based on business needs, and severity (S), which indicates the degree of negative impact on the quality of software. Bugs with the highest priority and the highest severity are critical and must be resolved first, while bugs with the lowest priority and the lowest severity don’t need immediate attention.
• Critical bugs cause complete failure of a feature and don’t have a workaround. They must be fixed as soon as possible, typically within 24 hours. Bugs that cause significant memory leaks are sometimes classified as a priority -1, which means that they prevent the entire software from functioning.
• High-priority bugs affect major features or major data, and they may or may not have a workaround. If a workaround is available, it’s difficult to implement or is not obvious. All high-priority bugs should be resolved before the release is made, but only after all critical bugs are fixed.
• Medium-priority bugs affect minor functionality or non-critical data, and there may even be simple workarounds. Sometimes, even cosmetic errors are classified as P3 bugs, depending on how severely they affect the overall user experience. It’s not necessary to resolve all medium-priority bugs before the release is made, but they should be resolved only after all high-priority bugs are fixed.
• Low-priority bugs have no effect on functionality or data. They are merely small inconveniences, such as spelling errors and layout discrepancies, that can be fixed in the future and don’t need immediate attention.
Conclusion
Agile isn’t just about speed. It’s about speed and quality. To deliver quality software faster, teams need the right strategies for managing bugs and feature requests, such as those outlined in this article. Modern bug tracking and issue tracking systems play an important role as well, bringing visibility and making it easy to prioritize bugs and assign issues.
Resources
• http://servicevirtualization.com/report-software-failures-cost-1-1-trillion-2016/
• http://blog.celerity.com/the-true-cost-of-a-software-bug
• https://www.joelonsoftware.com/2000/11/08/painless-bug-tracking/
BUSINESS
DEVELOPMENT
Insights
All The Services Rendered
DEVELOPMENT
Kiến trúc phát triển Website JAMSTACK
Published on May 28, 2021
INSIGHTS
Bảng tin điểm Tuần 28
Published on Jun 3, 2021
DEVELOPMENT
MEAN vs MERN vs MEVN vs LAMP Stack for Development
Published on Jun 3, 2021
DEVELOPMENT
What is JAMstack and Why You Should Try It
Published on May 28, 2021
Expert articles on best software developments practives
Get a bi-weekly email with most popular stories
|
{
"url": "http://acaziasoft.com/best-strategies-for-managing.html",
"source_domain": "acaziasoft.com",
"snapshot_id": "crawl=CC-MAIN-2021-25",
"warc_metadata": {
"Content-Length": "35588",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:7KXNWFOYFEELZPUZRO6F2UYS6AJ7IH2N",
"WARC-Concurrent-To": "<urn:uuid:928eb04f-8f5a-4833-b827-6f345f1c82e3>",
"WARC-Date": "2021-06-24T06:56:50Z",
"WARC-IP-Address": "160.153.78.133",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:XQEVSUMIJ534JVB36BUROQETGWEOSNFJ",
"WARC-Record-ID": "<urn:uuid:d7666b76-d97c-4622-8f1a-a40d2412dda3>",
"WARC-Target-URI": "http://acaziasoft.com/best-strategies-for-managing.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:366dcdee-3495-4069-8d19-9e96453688d5>"
},
"warc_info": "isPartOf: CC-MAIN-2021-25\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for June 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-19.ec2.internal\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
33,
34,
89,
90,
108,
109,
121,
122,
367,
368,
695,
696,
713,
714,
1119,
1120,
1567,
1568,
1879,
1880,
2236,
2237,
2272,
2273,
2570,
2571,
2751,
2752,
2775,
2776,
3046,
3047,
3205,
3206,
3283,
3284,
3438,
3572,
3724,
3725,
4115,
4116,
4137,
4138,
4347,
4348,
4728,
4729,
5031,
5325,
5723,
5942,
5943,
5954,
5955,
6319,
6320,
6330,
6331,
6417,
6478,
6547,
6556,
6568,
6569,
6578,
6579,
6605,
6606,
6618,
6656,
6657,
6683,
6684,
6693,
6715,
6716,
6741,
6742,
6754,
6805,
6806,
6831,
6832,
6844,
6887,
6888,
6914,
6915,
6971,
6972
],
"line_end_idx": [
33,
34,
89,
90,
108,
109,
121,
122,
367,
368,
695,
696,
713,
714,
1119,
1120,
1567,
1568,
1879,
1880,
2236,
2237,
2272,
2273,
2570,
2571,
2751,
2752,
2775,
2776,
3046,
3047,
3205,
3206,
3283,
3284,
3438,
3572,
3724,
3725,
4115,
4116,
4137,
4138,
4347,
4348,
4728,
4729,
5031,
5325,
5723,
5942,
5943,
5954,
5955,
6319,
6320,
6330,
6331,
6417,
6478,
6547,
6556,
6568,
6569,
6578,
6579,
6605,
6606,
6618,
6656,
6657,
6683,
6684,
6693,
6715,
6716,
6741,
6742,
6754,
6805,
6806,
6831,
6832,
6844,
6887,
6888,
6914,
6915,
6971,
6972,
7019
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 7019,
"ccnet_original_nlines": 91,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3678598701953888,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.013709059916436672,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.15917746722698212,
"rps_doc_frac_unique_words": 0.4254143536090851,
"rps_doc_mean_word_length": 5.2734808921813965,
"rps_doc_num_sentences": 50,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.519575595855713,
"rps_doc_word_count": 1086,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.10930678993463516,
"rps_doc_frac_chars_dupe_6grams": 0.09149642288684845,
"rps_doc_frac_chars_dupe_7grams": 0.060764800757169724,
"rps_doc_frac_chars_dupe_8grams": 0.030731620267033577,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.01222280040383339,
"rps_doc_frac_chars_top_3gram": 0.025667890906333923,
"rps_doc_frac_chars_top_4gram": 0.03055701032280922,
"rps_doc_books_importance": -644.1030883789062,
"rps_doc_books_importance_length_correction": -644.1030883789062,
"rps_doc_openwebtext_importance": -338.6340637207031,
"rps_doc_openwebtext_importance_length_correction": -338.6340637207031,
"rps_doc_wikipedia_importance": -294.010986328125,
"rps_doc_wikipedia_importance_length_correction": -294.010986328125
},
"fasttext": {
"dclm": 0.04344528913497925,
"english": 0.9275496006011963,
"fineweb_edu_approx": 1.8424859046936035,
"eai_general_math": 0.11444652080535889,
"eai_open_web_math": 0.12845826148986816,
"eai_web_code": 0.09252119064331055
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.452",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,007,997,122,151,568,000 |
Tagged with virtualenv
Instalación de paquetes Python con Distribute y pip
Instalación de paquetes Python con Distribute y pip
Previamente explique como hacer instalar paquetes Python con setuptools y EasyInstall y ahora le presento la manera actualmente mas recomendada para instalar paquetes Python con las herramientas Distribute y pip. Introducción Python, Es un lenguaje de programación interpretado cuya filosofía hace hincapié en una sintaxis muy limpia y que favorezca un código legible. Se trata de un lenguaje de programación multiparadigma, ya que soporta orientación a objetos, … Seguir leyendo
Instalación de paquetes Python con setuptools y EasyInstall
Instalación de paquetes Python con setuptools y EasyInstall
Este articulo explica como instalar paquetes Python con setuptools y EasyInstall. Introducción Python, Es un lenguaje de programación interpretado cuya filosofía hace hincapié en una sintaxis muy limpia y que favorezca un código legible. Se trata de un lenguaje de programación multiparadigma, ya que soporta orientación a objetos, programación imperativa y, en menor medida, programación funcional. Es un … Seguir leyendo
Creación de entornos virtuales Python
Creación de entornos virtuales Python
¿Por que crear entornos virtuales en Python? Si usted está en un sistema Linux, BSD, Cygwin, u otros similares a Unix como sistema operativo, pero no tienen acceso al usuario root, puede crear su propio entorno virtual (instalación) Python, que utiliza su propia biblioteca de directorios y algunos enlaces simbólicos hacia todo el directorio de … Seguir leyendo
|
{
"url": "https://lcaballero.wordpress.com/tag/virtualenv/",
"source_domain": "lcaballero.wordpress.com",
"snapshot_id": "crawl=CC-MAIN-2017-09",
"warc_metadata": {
"Content-Length": "59911",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:7DCXK4YWUYR24CNJZSEXT7LZGATMPQKB",
"WARC-Concurrent-To": "<urn:uuid:1e2a393f-987d-4d41-832d-1af42eba8f6e>",
"WARC-Date": "2017-02-28T00:53:14Z",
"WARC-IP-Address": "192.0.78.13",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:UNFHV2ZX4PGSIOJKEKNPEBHTLBXC2PBJ",
"WARC-Record-ID": "<urn:uuid:048565be-aabb-4941-ba1b-4113eb4e1bee>",
"WARC-Target-URI": "https://lcaballero.wordpress.com/tag/virtualenv/",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:55433b66-b965-4f5f-aa7f-8fc12df2526c>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-171-10-108.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2017-09\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for February 2017\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
23,
24,
76,
77,
129,
130,
610,
611,
671,
672,
732,
733,
1156,
1157,
1195,
1196,
1234,
1235
],
"line_end_idx": [
23,
24,
76,
77,
129,
130,
610,
611,
671,
672,
732,
733,
1156,
1157,
1195,
1196,
1234,
1235,
1597
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1597,
"ccnet_original_nlines": 18,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.12451361864805222,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0038910498842597008,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.10116732120513916,
"rps_doc_frac_unique_words": 0.45299145579338074,
"rps_doc_mean_word_length": 5.8034186363220215,
"rps_doc_num_sentences": 7,
"rps_doc_symbol_to_word_ratio": 0.011673149652779102,
"rps_doc_unigram_entropy": 4.311113357543945,
"rps_doc_word_count": 234,
"rps_doc_frac_chars_dupe_10grams": 0.31811487674713135,
"rps_doc_frac_chars_dupe_5grams": 0.5817378759384155,
"rps_doc_frac_chars_dupe_6grams": 0.5316641926765442,
"rps_doc_frac_chars_dupe_7grams": 0.5316641926765442,
"rps_doc_frac_chars_dupe_8grams": 0.4624447822570801,
"rps_doc_frac_chars_dupe_9grams": 0.31811487674713135,
"rps_doc_frac_chars_top_2gram": 0.07216495275497437,
"rps_doc_frac_chars_top_3gram": 0.08762887120246887,
"rps_doc_frac_chars_top_4gram": 0.0824742317199707,
"rps_doc_books_importance": -117.03632354736328,
"rps_doc_books_importance_length_correction": -103.45838165283203,
"rps_doc_openwebtext_importance": -71.39112091064453,
"rps_doc_openwebtext_importance_length_correction": -71.39112091064453,
"rps_doc_wikipedia_importance": -29.341075897216797,
"rps_doc_wikipedia_importance_length_correction": -15.63576602935791
},
"fasttext": {
"dclm": 0.9471514225006104,
"english": 0.0013849600218236446,
"fineweb_edu_approx": 1.6435405015945435,
"eai_general_math": 0.000756499997805804,
"eai_open_web_math": 0.2863615155220032,
"eai_web_code": 0.964813232421875
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1332",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "1",
"label": "Truncated Snippets"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,987,826,039,834,895,000 |
Golang Reflect
golang study notes
Published: 2020-05-19
Reflection in Golang
Incase you are here looking to learn about reflection, a better resource is
https://blog.golang.org/laws-of-reflection
Interfaces in Go are types which hold concrete value and underlying type of the value with a precondition that value should implement methods of the interface. For example; types implementing Read([]byte) (int, error) method satisfy the io.Reader interface. However interface{}, without any method definition will match all types.
A struct type can be assigned to an empty interface, the assertion is the concrete type should implement the methods of the interface type. In the following example there are no methods that need to be implemented, hence the assertion passes.
type T struct {
x string
}
t := T{}
var x interface{}
x = t
example 1
On inspecting the interface, reflect.Type represents the value part of the interface and reflect.Type represents the underlying type of the value in the interface. The actual interface can be got with the Interface() method of the Value.
type T struct {
x string
}
x := T{"hello"}
p := reflect.ValueOf(x)
fmt.Println(p.Interface())
fmt.Println("type of p:", p.Type())
fmt.Println(p.Kind())
fmt.Println(p.CanSet())
&{hello}
type of p: *main.T
ptr
false
example 2
Can the value be updated
Most often we need to modify value of a struct. CanSet() is used to know if the interface values can be updated. From example 1, the value is not settable. That is because we should be looking at the value p is pointing which can be found by using Elem() method.
p.Elem().CanSet()
This still would not work because the value is not a refrence to x but rather copy of x.
type T struct {
x string
}
x := T{"hello"}
p := reflect.ValueOf(&x)
fmt.Println(p.Interface())
fmt.Println("type of p:", p.Type())
fmt.Println(p.Elem().CanSet())
&{hello}
type of p: *main.T
true
example 3
Accessing struct fields
struct fields can be accessed using the Field, FieldByName, FieldbyNameFunc methods.
type T struct {
X string
Y string
}
x := T{}
p := reflect.ValueOf(&x)
p.Elem().Field(0).SetString("Hello")
p.Elem().FieldByName("Y").SetString("you")
fmt.Println(x)
{Hello you}
example 4
Struct tags
StructTag is the approach many libraries take for accessing and modifying struct values. Which many of us are familiar with Go's json module.
type T struct {
X string `json:"x_struct_tag"`
}
fmt.Println(reflect.TypeOf(&T{}).Elem().NumField())
fmt.Println(reflect.TypeOf(&T{}).Elem().Field(0).Tag.Get("json"))
1
x_struct_tag
|
{
"url": "http://thepedestrian.in/notes/golang-reflect/",
"source_domain": "thepedestrian.in",
"snapshot_id": "crawl=CC-MAIN-2021-49",
"warc_metadata": {
"Content-Length": "13653",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:UJPWRD7FWYRCYQON5JOWOHF33Y7BODJI",
"WARC-Concurrent-To": "<urn:uuid:37279871-e0ae-4148-9072-6af9322b4652>",
"WARC-Date": "2021-11-28T06:25:13Z",
"WARC-IP-Address": "185.199.108.153",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:4IRM7QAQTIIUZTXXUUX27XGZAGA2AN4N",
"WARC-Record-ID": "<urn:uuid:ff61e137-7818-4364-b0ea-e49cfbbc8a40>",
"WARC-Target-URI": "http://thepedestrian.in/notes/golang-reflect/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:46a06fc9-1085-4f50-a266-6dc11ebb3f1a>"
},
"warc_info": "isPartOf: CC-MAIN-2021-49\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-159\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
15,
34,
56,
57,
78,
79,
155,
198,
199,
530,
531,
774,
775,
791,
804,
806,
807,
816,
834,
840,
850,
851,
1089,
1090,
1106,
1117,
1119,
1120,
1136,
1160,
1187,
1223,
1245,
1269,
1278,
1297,
1301,
1307,
1317,
1318,
1343,
1344,
1607,
1608,
1626,
1627,
1716,
1717,
1733,
1744,
1746,
1747,
1763,
1788,
1815,
1851,
1882,
1891,
1910,
1915,
1925,
1926,
1950,
1951,
2036,
2037,
2053,
2064,
2075,
2077,
2078,
2087,
2112,
2149,
2192,
2207,
2219,
2229,
2230,
2242,
2243,
2385,
2386,
2402,
2436,
2438,
2490,
2556,
2558
],
"line_end_idx": [
15,
34,
56,
57,
78,
79,
155,
198,
199,
530,
531,
774,
775,
791,
804,
806,
807,
816,
834,
840,
850,
851,
1089,
1090,
1106,
1117,
1119,
1120,
1136,
1160,
1187,
1223,
1245,
1269,
1278,
1297,
1301,
1307,
1317,
1318,
1343,
1344,
1607,
1608,
1626,
1627,
1716,
1717,
1733,
1744,
1746,
1747,
1763,
1788,
1815,
1851,
1882,
1891,
1910,
1915,
1925,
1926,
1950,
1951,
2036,
2037,
2053,
2064,
2075,
2077,
2078,
2087,
2112,
2149,
2192,
2207,
2219,
2229,
2230,
2242,
2243,
2385,
2386,
2402,
2436,
2438,
2490,
2556,
2558,
2570
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2570,
"ccnet_original_nlines": 89,
"rps_doc_curly_bracket": 0.012451360002160072,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3192567527294159,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.030405409634113312,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.29054054617881775,
"rps_doc_frac_unique_words": 0.4338028132915497,
"rps_doc_mean_word_length": 5.385915279388428,
"rps_doc_num_sentences": 60,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.544415473937988,
"rps_doc_word_count": 355,
"rps_doc_frac_chars_dupe_10grams": 0.0868200808763504,
"rps_doc_frac_chars_dupe_5grams": 0.1579497903585434,
"rps_doc_frac_chars_dupe_6grams": 0.0868200808763504,
"rps_doc_frac_chars_dupe_7grams": 0.0868200808763504,
"rps_doc_frac_chars_dupe_8grams": 0.0868200808763504,
"rps_doc_frac_chars_dupe_9grams": 0.0868200808763504,
"rps_doc_frac_chars_top_2gram": 0.03347279876470566,
"rps_doc_frac_chars_top_3gram": 0.028765689581632614,
"rps_doc_frac_chars_top_4gram": 0.031380750238895416,
"rps_doc_books_importance": -297.267333984375,
"rps_doc_books_importance_length_correction": -297.267333984375,
"rps_doc_openwebtext_importance": -163.8255615234375,
"rps_doc_openwebtext_importance_length_correction": -163.8255615234375,
"rps_doc_wikipedia_importance": -126.55113220214844,
"rps_doc_wikipedia_importance_length_correction": -126.55113220214844
},
"fasttext": {
"dclm": 0.29006439447402954,
"english": 0.6571159958839417,
"fineweb_edu_approx": 2.8218393325805664,
"eai_general_math": 0.9673448801040649,
"eai_open_web_math": 0.03542304039001465,
"eai_web_code": 0.6852943301200867
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1332",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
2,280,170,526,478,072,800 |
question
doronhn avatar image
doronhn asked
link device or create account?
Hey,
Fast question:
When i try to login to Facebook i get access token.
Then i have two option:
1. link to an existing account on PlayFab
2. create new Its two different methods, its mean that i need to check before calling the PlayFab API if the user was guest before.
Am i missing something?
Am i right?
apissdks
10 |1200
Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Andy avatar image
Andy answered
If you're already logging players in through an anonymous device identifier (a guest, as you put it), then you should call the link API once you have a Facebook token. From then on, they can continue to sign in silently using the device id, but it will be linked to Facebook should they need to recover it at some point.
Our Linking and Unlinking tutorial goes into more detail: https://api.playfab.com/docs/tutorials/landing-players/account-linking.
Here's a snippet of the tutorial that addresses what your scenario:
Use an anonymous login to create new players with zero friction. After a tutorial phase, gently encourage players to link your preferred choice of recoverable credentials to their account. If you're using a third-party authentication system, retrieve the appropriate token from that service (via API calls or SDK functions), then call the appropriate PlayFab API to link the player's account from that service to their PlayFab account: LinkFacebookAccount, LinkGameCenterAccount, LinkGoogleAccount, LinkKongregate, LinkSteamAccount, LinkTwitch, LinkWindowsHello.
10 |1200
Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
marcowilliamspf avatar image
marcowilliamspf answered
In addition to Andy's answer, you should also check out our Login Best Practices and our Authentication Sample on Github and the video tutorial series I've done on Authentication with PlayFab
10 |1200
Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Write an Answer
Hint: Notify or tag a user in this post by typing @username.
Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
|
{
"url": "https://community.playfab.com/questions/21960/link-device-or-create-account.html",
"source_domain": "community.playfab.com",
"snapshot_id": "CC-MAIN-2024-22",
"warc_metadata": {
"Content-Length": "171216",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:A2BOAGPEI64HZWBYYNNK3KUF4STJ57OY",
"WARC-Concurrent-To": "<urn:uuid:841c8156-791e-4b74-8db2-1442673afcd6>",
"WARC-Date": "2024-05-21T14:12:51Z",
"WARC-IP-Address": "52.3.117.45",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:OUOTPTVPB7QMZ25PW57RESOHZIES54Q2",
"WARC-Record-ID": "<urn:uuid:f771450e-cf80-4240-bb73-b6e514877715>",
"WARC-Target-URI": "https://community.playfab.com/questions/21960/link-device-or-create-account.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:bae50f56-de4b-4f96-af7e-1325e11afe4b>"
},
"warc_info": "isPartOf: CC-MAIN-2024-22\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-212\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
9,
10,
31,
45,
46,
77,
78,
83,
84,
99,
100,
152,
153,
177,
178,
220,
221,
353,
354,
378,
379,
391,
392,
401,
410,
411,
514,
515,
533,
547,
548,
869,
870,
1000,
1001,
1069,
1070,
1633,
1634,
1643,
1644,
1747,
1748,
1777,
1802,
1803,
1995,
1996,
2005,
2006,
2109,
2110,
2126,
2127,
2188,
2189
],
"line_end_idx": [
9,
10,
31,
45,
46,
77,
78,
83,
84,
99,
100,
152,
153,
177,
178,
220,
221,
353,
354,
378,
379,
391,
392,
401,
410,
411,
514,
515,
533,
547,
548,
869,
870,
1000,
1001,
1069,
1070,
1633,
1634,
1643,
1644,
1747,
1748,
1777,
1802,
1803,
1995,
1996,
2005,
2006,
2109,
2110,
2126,
2127,
2188,
2189,
2291
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2291,
"ccnet_original_nlines": 56,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3638297915458679,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.012765959836542606,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2255319058895111,
"rps_doc_frac_unique_words": 0.45923912525177,
"rps_doc_mean_word_length": 4.9347825050354,
"rps_doc_num_sentences": 28,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.838133335113525,
"rps_doc_word_count": 368,
"rps_doc_frac_chars_dupe_10grams": 0.18171806633472443,
"rps_doc_frac_chars_dupe_5grams": 0.18171806633472443,
"rps_doc_frac_chars_dupe_6grams": 0.18171806633472443,
"rps_doc_frac_chars_dupe_7grams": 0.18171806633472443,
"rps_doc_frac_chars_dupe_8grams": 0.18171806633472443,
"rps_doc_frac_chars_dupe_9grams": 0.18171806633472443,
"rps_doc_frac_chars_top_2gram": 0.00881057046353817,
"rps_doc_frac_chars_top_3gram": 0.011013220064342022,
"rps_doc_frac_chars_top_4gram": 0.035242289304733276,
"rps_doc_books_importance": -229.99407958984375,
"rps_doc_books_importance_length_correction": -229.99407958984375,
"rps_doc_openwebtext_importance": -140.4110565185547,
"rps_doc_openwebtext_importance_length_correction": -140.4110565185547,
"rps_doc_wikipedia_importance": -97.80780792236328,
"rps_doc_wikipedia_importance_length_correction": -97.80780792236328
},
"fasttext": {
"dclm": 0.019069189205765724,
"english": 0.8944026231765747,
"fineweb_edu_approx": 1.1717991828918457,
"eai_general_math": 0.05095481872558594,
"eai_open_web_math": 0.2211257815361023,
"eai_web_code": 0.16456818580627441
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
2,810,696,188,858,042,400 |
dslreports logo
site
All Forums Hot Topics Gallery
spc
spacer
how-to block ads
Search Topic:
uniqs
2
share rss forum feed
LightS
Premium
join:2005-12-17
Greenville, TX
reply to camper
Re: All that you would ever need...
I think you're thinking of Ethernet standards - not consumer broadband options.
Broadband speeds are not jumping up in 10x increments - that'd be awesome, but it's not. I currently have a 30/2 connection - I don't see it jumping to 300/20 any time soon
However, connections that are not last-mile or long-distance (for our sake, let's say copper) are usually 100/1000, while fiber is used for 1gbps/10gbps
Kamus
join:2011-01-27
El Paso, TX
said by LightS:
I think you're thinking of Ethernet standards - not consumer broadband options.
The thing is, there is really no technical reason for this to be the case. Google is showing just that with their fine example.
And since we're talking powers of 10, this is a great example from 1977, just so people who for some reason defend things like caps see why it's so stupid to do so for technologies that advance exponentially like Ethernet does:
»www.youtube.com/watch?v=0fKBhvDjuy0
|
{
"url": "http://www.dslreports.com/forum/remark,27769192",
"source_domain": "www.dslreports.com",
"snapshot_id": "crawl=CC-MAIN-2014-10",
"warc_metadata": {
"Content-Length": "24760",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:AEFSXCPSZV6YMZ2C34YOCQILCDULGW5E",
"WARC-Concurrent-To": "<urn:uuid:21e9c02b-2534-435e-8000-89ca7a4a339c>",
"WARC-Date": "2014-03-07T23:13:43Z",
"WARC-IP-Address": "64.91.255.98",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:H4HB6RNA2UIYKLTSW6PKTQYWMOY5MLVL",
"WARC-Record-ID": "<urn:uuid:6678a5cb-73c5-4e33-a1e7-675fea8362b0>",
"WARC-Target-URI": "http://www.dslreports.com/forum/remark,27769192",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:9096a412-92eb-4744-89ca-1168fd952e74>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-183-142-35.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2014-10\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for March 2014\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
16,
21,
23,
57,
61,
62,
69,
70,
71,
72,
73,
90,
91,
92,
106,
112,
114,
135,
136,
137,
144,
152,
168,
183,
199,
200,
236,
237,
317,
318,
491,
492,
645,
646,
647,
653,
654,
670,
682,
683,
699,
700,
780,
781,
909,
910,
1138,
1139
],
"line_end_idx": [
16,
21,
23,
57,
61,
62,
69,
70,
71,
72,
73,
90,
91,
92,
106,
112,
114,
135,
136,
137,
144,
152,
168,
183,
199,
200,
236,
237,
317,
318,
491,
492,
645,
646,
647,
653,
654,
670,
682,
683,
699,
700,
780,
781,
909,
910,
1138,
1139,
1175
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1175,
"ccnet_original_nlines": 48,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.38257575035095215,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.022727269679307938,
"rps_doc_frac_lines_end_with_ellipsis": 0.020408159121870995,
"rps_doc_frac_no_alph_words": 0.2537878751754761,
"rps_doc_frac_unique_words": 0.725806474685669,
"rps_doc_mean_word_length": 4.870967864990234,
"rps_doc_num_sentences": 10,
"rps_doc_symbol_to_word_ratio": 0.003787880064919591,
"rps_doc_unigram_entropy": 4.768853187561035,
"rps_doc_word_count": 186,
"rps_doc_frac_chars_dupe_10grams": 0.1434878557920456,
"rps_doc_frac_chars_dupe_5grams": 0.1434878557920456,
"rps_doc_frac_chars_dupe_6grams": 0.1434878557920456,
"rps_doc_frac_chars_dupe_7grams": 0.1434878557920456,
"rps_doc_frac_chars_dupe_8grams": 0.1434878557920456,
"rps_doc_frac_chars_dupe_9grams": 0.1434878557920456,
"rps_doc_frac_chars_top_2gram": 0.01324503030627966,
"rps_doc_frac_chars_top_3gram": 0.024282559752464294,
"rps_doc_frac_chars_top_4gram": 0.04194260016083717,
"rps_doc_books_importance": -120.95602416992188,
"rps_doc_books_importance_length_correction": -120.95602416992188,
"rps_doc_openwebtext_importance": -85.71501922607422,
"rps_doc_openwebtext_importance_length_correction": -85.42781829833984,
"rps_doc_wikipedia_importance": -55.71735763549805,
"rps_doc_wikipedia_importance_length_correction": -55.71735763549805
},
"fasttext": {
"dclm": 0.03184223175048828,
"english": 0.9395931959152222,
"fineweb_edu_approx": 1.2639400959014893,
"eai_general_math": 0.005660589784383774,
"eai_open_web_math": 0.18531709909439087,
"eai_web_code": 0.0005997400148771703
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "621.384",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Engineering",
"level_3": "Mechanical engineering and Machinery"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "5",
"label": "Comment Section"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,969,342,725,438,722,000 |
How barn dance I convert safe mp4 to mp3?
As ffmpeg of the 105th MPEG meeting (seePress launch ), MPEG has concluded its research of the transfer of Timed textual content in the ISO substratum Media discourse Format (MP4). mp3gain resulted inside recruitment standards for the conveyance of WebVTT and TTML content material that have reached last recruitment occasion (FDAM 2 for 1forty nine96-12/1fifty fourforty four-12 and FDIS for 1forty fourninety six-three0). they're thought of complete and are submitted to national our bodies for ultimate vote. MP3 NORMALIZER gives an summary of these recruitment paperwork.
Select where you want to convertyour recordsdata: MP4, AVI, MP3, WMV, FLV,MKV, Apple, Android, PSP, and so forth.
Is there a mp4 by nazi zombies?
What audacity name the thing by digicam,stay tv,mp4 and tuner? 1,zero61,292questions on Wikianswers Add New web page Edit Edit sourceHistoryTalk 0This question is awaiting a solution...Please leave this area clean unless you are answering the question. do not ask questions you already know the answer to. thanks.Retrieved from " "Ad blocker interference detected! Wikia is a single-to-use site that makes cash from advertising. we've got a bespoke experience for viewers utilizing ad blockers Wikia just isn't available if youve made additional modifications. take away the custom ad blocker standard(s) and the web page timber as anticipated.categories : Un-answered questions camerasAdd category CancelSave
What shindig you name the thing digital camera,live television,mp4 and tuner?
While creating our YouTube to MP4 online converter, it was your needs we were eager about. we try to invent it as simple and as quick as potential for you to convert your favourite videos to any format including mp3, avi, mp4, mov, wmv, and many more. you might constructiveness Flvto YouTube Downloader on any podium including Linux, MacOS, or home windows. Download and convert a video and be part of hundreds of pleased Flvto.biz users.
Mozilla foundation safety Advisory 2zero15-17Buffer overflow surrounded by libstagefright throughout MP4 video playback introduced February 24, 2zero15 journalist PantrombkaImpactCritical products Firefox, Firefox OS, SeaMonkey fixed surrounded byFirefox 36Firefox OS 2.2SeaMonkey 2.three3depictionsafety researcherPantrombkareported a buffer overflow contained by thelibstagefrightlibrary throughout video playback when certain contained byvalid MP4 video recordsdata led to the passing on of a buffer that was for the content material. This led to a probably exploitable run into. ReferencesMP4 rear-end access violation( CVE-2015-0829 )
MP4 basics and timed-textual content associated specs
Is there a mp4 on nazi zombies? 1,zero61,293questions by Wikianswers Add New page Edit Edit sourceHistoryTalk 0This questiby is awaiting an answer...Please depart this field blank unless you are answering the questi. don't ask questibys you already know the answer to. thanks.Retrieved from " "Ad blocker interference detected! Wikia is a spinster-to-constructiveness website that makes cash from promoting. now we have a custom-made experience for viewers using ad blockers Wikia shouldn't be available if youve made further modifications. take away the customized ad blocker roll(s) and the page will as expected.classes : Un-answered questinext tos Nazi GermanyAdd category CancelSave
Leave a Reply
Your email address will not be published. Required fields are marked *
|
{
"url": "http://wolffyhn7.blogdigy.com/how-barn-dance-i-convert-safe-mp4-to-mp3-6665703",
"source_domain": "wolffyhn7.blogdigy.com",
"snapshot_id": "crawl=CC-MAIN-2019-04",
"warc_metadata": {
"Content-Length": "14963",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:RBOEYXSSKTZPPRLLU5ZLJT7PQW7S34XL",
"WARC-Concurrent-To": "<urn:uuid:fa6d65ce-dad7-4369-97d0-4df1597f4682>",
"WARC-Date": "2019-01-21T18:45:47Z",
"WARC-IP-Address": "23.88.105.52",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:NCCPWICWDN2QUU33I4S367T5EYXTDSAQ",
"WARC-Record-ID": "<urn:uuid:511475e2-c7b7-47f8-8670-8cf6ab46bf08>",
"WARC-Target-URI": "http://wolffyhn7.blogdigy.com/how-barn-dance-i-convert-safe-mp4-to-mp3-6665703",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:de42e554-4486-49de-ae9d-bdc0c09e54a4>"
},
"warc_info": "isPartOf: CC-MAIN-2019-04\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for January 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-145-104-113.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
42,
43,
619,
620,
621,
622,
623,
624,
625,
626,
627,
628,
629,
630,
744,
745,
746,
778,
779,
780,
781,
1491,
1492,
1493,
1571,
1572,
1573,
2013,
2653,
2654,
2655,
2709,
2710,
2711,
3399,
3400,
3414,
3415
],
"line_end_idx": [
42,
43,
619,
620,
621,
622,
623,
624,
625,
626,
627,
628,
629,
630,
744,
745,
746,
778,
779,
780,
781,
1491,
1492,
1493,
1571,
1572,
1573,
2013,
2653,
2654,
2655,
2709,
2710,
2711,
3399,
3400,
3414,
3415,
3485
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3485,
"ccnet_original_nlines": 38,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3094867765903473,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03732503950595856,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.17573872208595276,
"rps_doc_frac_unique_words": 0.5751503109931946,
"rps_doc_mean_word_length": 5.697394847869873,
"rps_doc_num_sentences": 37,
"rps_doc_symbol_to_word_ratio": 0.0031104199588298798,
"rps_doc_unigram_entropy": 5.356450080871582,
"rps_doc_word_count": 499,
"rps_doc_frac_chars_dupe_10grams": 0.05698205903172493,
"rps_doc_frac_chars_dupe_5grams": 0.09778402745723724,
"rps_doc_frac_chars_dupe_6grams": 0.05698205903172493,
"rps_doc_frac_chars_dupe_7grams": 0.05698205903172493,
"rps_doc_frac_chars_dupe_8grams": 0.05698205903172493,
"rps_doc_frac_chars_dupe_9grams": 0.05698205903172493,
"rps_doc_frac_chars_top_2gram": 0.012662679888308048,
"rps_doc_frac_chars_top_3gram": 0.005627859849482775,
"rps_doc_frac_chars_top_4gram": 0.007738300133496523,
"rps_doc_books_importance": -300.5719299316406,
"rps_doc_books_importance_length_correction": -300.5719299316406,
"rps_doc_openwebtext_importance": -168.80360412597656,
"rps_doc_openwebtext_importance_length_correction": -168.80360412597656,
"rps_doc_wikipedia_importance": -146.02804565429688,
"rps_doc_wikipedia_importance_length_correction": -146.02804565429688
},
"fasttext": {
"dclm": 0.09990119934082031,
"english": 0.8838401436805725,
"fineweb_edu_approx": 1.0892623662948608,
"eai_general_math": 0.0001581899996381253,
"eai_open_web_math": 0.08630537986755371,
"eai_web_code": 0.000020980000044801272
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "006.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Cognitive science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "5",
"label": "Social/Forum"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "1",
"label": "Leftover HTML"
}
},
"missing_content": {
"primary": {
"code": "1",
"label": "Truncated Snippets"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "18",
"label": "Q&A Forum"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "2",
"label": "Partially Correct"
},
"secondary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,431,662,744,994,276,000 |
Author Topic: Exactly one day using iViri I'm stumped (Read 1781 times)
Offline mbairhead
• Hero Member
• *****
• Posts: 516
• Karma: +5/-2
Exactly one day using iViri I'm stumped
« on: June 24, 2014, 03:31:19 pm »
Is their any documentation out there?
At some point when I go to "Rooms View" does it stop opening my photos when I choose a room?
Will we be able to add our own voice tags eventually? I hate having to memorize the exact phrase to get this to work.
When there's a "Network Failure" is their any way to not have it pop up 8 or so times? And after I hit "Dismiss" all those time, it then runs the request?!?
Will I get any confirmation when it sees my TwoCanoes beacon? This seems very hit or miss.
Offline jpete7683
• Moderator
• Sr. Member
• *****
• Posts: 363
• Karma: +10/-9
Re: Exactly one day using iViri I'm stumped
« Reply #1 on: June 25, 2014, 05:32:06 pm »
Is their any documentation out there?
At some point when I go to "Rooms View" does it stop opening my photos when I choose a room?
Will we be able to add our own voice tags eventually? I hate having to memorize the exact phrase to get this to work.
When there's a "Network Failure" is their any way to not have it pop up 8 or so times? And after I hit "Dismiss" all those time, it then runs the request?!?
Will I get any confirmation when it sees my TwoCanoes beacon? This seems very hit or miss.
So for the image selection coming up when you go to room view, go to your iphone settings, scroll down to iViri and turn off Allow Custom Room Images. The network failure will be getting removed off, there is a lot of updating that goes on because it goes out on a timed interval to get status and when you pull down to refresh it does the same so I will work on that. As for voice recognition, I feel like just removing it as the feedback is more complaining than positive from most users. It doesn't use any online API and uses internal methods to resolve what it hears so my hands are tied a lot on what I can do, if asking someone to remember the name that they assign to a device is to much to ask I don't think there is really a need for the engineering effort involved to get what you are requesting implemented and with homekit coming Siri should eventually be able to handle this which will cause there to be no need for iViri Voice Control. The notification method was removed from the beacon stuff as I figured it wasn't needed, however if you want we could get you a BETA version to test out and try to see if it works for you to debug your beacon situation. Just email me at [email protected] if you are interested in a BETA version to debug your beacons.
I am the developer of iViri. iViri is available in Apple Store. Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.
Offline mbairhead
• Hero Member
• *****
• Posts: 516
• Karma: +5/-2
Re: Exactly one day using iViri I'm stumped
« Reply #2 on: June 26, 2014, 11:52:49 am »
The problem turned out to be my beacon, not your app. I can't really recommend twocannoes beacons, their support is a bit lack luster...just fyi.
Here's my .02 on this app and what you've done so please take with a grain of salt. The UI isn't great, it's a bit tough to navigate and for someone with big fingers, it requires a pop up to control devices BUT, you have done what no one else has done well, made Vera understand where you are at all times. If I were doing this, and I don't have the skills to so, so much respect for doing as much as you have, I would abandon the UI and focus on the awesome things it can do, truly automate Vera, as opposed to Vera being a home remote control. I would work with the various beacons and figure out how to set power on them so you could truly do a room to room set up. The geofences are awesome and I wouldn't touch them. The voice is neat and if it was only me using it, I would take the time to learn the correct verbiage for the lights I wanted to control but it's not just me, and my wife isn't going to take the time. I don't know how to do this or if it's even possible but a library of terms that could be manually added would be perfect, even if it had to be typed in. I wouldn't abandon the voice control, I would focus on it. If you get this right, you could and should charge a premium for this app.
Another .02, put together a walk through or some documentation with a faq of all the issues people are having. A simple web site would go a long way but even a pdf download would be great.
Thank you for the response and very interesting app
Offline jpete7683
• Moderator
• Sr. Member
• *****
• Posts: 363
• Karma: +10/-9
Re: Exactly one day using iViri I'm stumped
« Reply #3 on: June 26, 2014, 01:22:53 pm »
Thanks for the comments. My intention was exactly what you were saying, it wasn't so much to design a new UI as there are better apps out there and I am all for people using the UI's of other apps. However, the pricing model people have gone after with the iOS apps has driven me to add a UI because they download it and say this is all it does, I wanted a UI with it, so I get it both ways there and I can understand as the UI didn't have much time spent on it because it wasn't as important to me. My goal was to never open the app again if everything was triggering correctly which I had before dropping VERA as my controller. I will continue to work on it and thanks for the comments.
I am the developer of iViri. iViri is available in Apple Store. Check out its Voice Control and Geofence integration, which causes less battery drain than the other options for locating an iphone.
|
{
"url": "http://forum.micasaverde.com/index.php/topic,25718.0.html?PHPSESSID=qr06vvrjbf293q7ar5fhfsh9r5",
"source_domain": "forum.micasaverde.com",
"snapshot_id": "crawl=CC-MAIN-2018-17",
"warc_metadata": {
"Content-Length": "34966",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PYIR42MDNAOFJVJDE2ZF7BBH67HBDYTF",
"WARC-Concurrent-To": "<urn:uuid:2f5b350b-41e9-4594-8198-1c6d21c56d09>",
"WARC-Date": "2018-04-24T12:30:40Z",
"WARC-IP-Address": "184.105.134.138",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:WK3AA645SWRQ6CDBBGZF6FJWW5O5WGOQ",
"WARC-Record-ID": "<urn:uuid:f1b32586-e37d-412d-a1c4-7554987237cf>",
"WARC-Target-URI": "http://forum.micasaverde.com/index.php/topic,25718.0.html?PHPSESSID=qr06vvrjbf293q7ar5fhfsh9r5",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8b451cda-15d2-4c4e-917a-824b32bfe032>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-7-222-90.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-17\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for April 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
73,
74,
92,
93,
109,
119,
134,
151,
191,
226,
264,
265,
358,
359,
477,
478,
635,
636,
727,
728,
746,
747,
761,
776,
786,
801,
819,
863,
907,
945,
946,
1039,
1040,
1158,
1159,
1316,
1317,
1408,
1409,
2688,
2887,
2888,
2906,
2907,
2923,
2933,
2948,
2965,
3009,
3053,
3199,
3200,
4411,
4412,
4601,
4602,
4654,
4655,
4673,
4674,
4688,
4703,
4713,
4728,
4746,
4790,
4834,
5527,
5726,
5727
],
"line_end_idx": [
73,
74,
92,
93,
109,
119,
134,
151,
191,
226,
264,
265,
358,
359,
477,
478,
635,
636,
727,
728,
746,
747,
761,
776,
786,
801,
819,
863,
907,
945,
946,
1039,
1040,
1158,
1159,
1316,
1317,
1408,
1409,
2688,
2887,
2888,
2906,
2907,
2923,
2933,
2948,
2965,
3009,
3053,
3199,
3200,
4411,
4412,
4601,
4602,
4654,
4655,
4673,
4674,
4688,
4703,
4713,
4728,
4746,
4790,
4834,
5527,
5726,
5727,
5728
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5728,
"ccnet_original_nlines": 70,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4710365831851959,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03963414952158928,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.18064023554325104,
"rps_doc_frac_unique_words": 0.33818182349205017,
"rps_doc_mean_word_length": 3.9590909481048584,
"rps_doc_num_sentences": 52,
"rps_doc_symbol_to_word_ratio": 0.003048779908567667,
"rps_doc_unigram_entropy": 5.3437180519104,
"rps_doc_word_count": 1100,
"rps_doc_frac_chars_dupe_10grams": 0.32238805294036865,
"rps_doc_frac_chars_dupe_5grams": 0.3373134434223175,
"rps_doc_frac_chars_dupe_6grams": 0.3373134434223175,
"rps_doc_frac_chars_dupe_7grams": 0.3373134434223175,
"rps_doc_frac_chars_dupe_8grams": 0.3299655616283417,
"rps_doc_frac_chars_dupe_9grams": 0.32238805294036865,
"rps_doc_frac_chars_top_2gram": 0.008266359567642212,
"rps_doc_frac_chars_top_3gram": 0.014925369992852211,
"rps_doc_frac_chars_top_4gram": 0.02066590078175068,
"rps_doc_books_importance": -519.89404296875,
"rps_doc_books_importance_length_correction": -519.89404296875,
"rps_doc_openwebtext_importance": -320.5833740234375,
"rps_doc_openwebtext_importance_length_correction": -320.5833740234375,
"rps_doc_wikipedia_importance": -206.14698791503906,
"rps_doc_wikipedia_importance_length_correction": -206.14698791503906
},
"fasttext": {
"dclm": 0.06510090827941895,
"english": 0.9636859893798828,
"fineweb_edu_approx": 1.0605900287628174,
"eai_general_math": 0.14598685503005981,
"eai_open_web_math": 0.1840120553970337,
"eai_web_code": 0.019378479570150375
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "621.392",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Engineering",
"level_3": "Mechanical engineering and Machinery"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,796,091,711,247,913,000 |
Structure
You’ve heard somewhere that appropriate website structure helps search engines spider your page properly, but have you heard that page structure itself can influence SERP rankings?
How do I know?
After finally following my own advice, my website, which used to rank for nothing, now ranks for several big money terms and I have gone from getting no leads from my website to getting several leads per week.
What you should do:
Use either CSS or tables to get your content area to the top of your code. Do a search for "source ordered columns" if you don't know what I mean. Make sure to use headings and subheadings to break up your text for clarity and easy reading as well as SEO. Use bold and italics for emphasis. Create your menu items to read like complete thoughts. Instead of “Services", use “Web Design Services” or something similar. Don't forget to use breadcrumbs. They increase the usability of your website and create another instance of your keywords.
|
{
"url": "https://www.advancedwebdesign.com/know-about-seo/structure",
"source_domain": "www.advancedwebdesign.com",
"snapshot_id": "crawl=CC-MAIN-2020-34",
"warc_metadata": {
"Content-Length": "18950",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:62ETWDT433Z5GYNYJBD3PBH5ASPI47QD",
"WARC-Concurrent-To": "<urn:uuid:4e3a29a6-c418-4a5f-ab87-42aa22f33c6e>",
"WARC-Date": "2020-08-12T20:45:37Z",
"WARC-IP-Address": "144.208.77.246",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:FULMIM7YDMTA7WHLOGW6V2PPLRNM4W3G",
"WARC-Record-ID": "<urn:uuid:71b0c189-73f0-4507-a094-44ab22126756>",
"WARC-Target-URI": "https://www.advancedwebdesign.com/know-about-seo/structure",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8d9f136e-a424-4aac-a571-f6c38be3b3eb>"
},
"warc_info": "isPartOf: CC-MAIN-2020-34\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-167.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
10,
11,
192,
193,
208,
209,
419,
420,
440,
441
],
"line_end_idx": [
10,
11,
192,
193,
208,
209,
419,
420,
440,
441,
980
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 980,
"ccnet_original_nlines": 10,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.44387754797935486,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.030612239614129066,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.12755101919174194,
"rps_doc_frac_unique_words": 0.6607142686843872,
"rps_doc_mean_word_length": 4.6785712242126465,
"rps_doc_num_sentences": 11,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.504031181335449,
"rps_doc_word_count": 168,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.022900760173797607,
"rps_doc_frac_chars_top_3gram": 0,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -57.36897659301758,
"rps_doc_books_importance_length_correction": -57.36897659301758,
"rps_doc_openwebtext_importance": -36.73442077636719,
"rps_doc_openwebtext_importance_length_correction": -22.817825317382812,
"rps_doc_wikipedia_importance": -35.971099853515625,
"rps_doc_wikipedia_importance_length_correction": -35.971099853515625
},
"fasttext": {
"dclm": 0.24039751291275024,
"english": 0.9353362321853638,
"fineweb_edu_approx": 1.487707495689392,
"eai_general_math": 0.030829429626464844,
"eai_open_web_math": 0.06837301701307297,
"eai_web_code": 0.17275971174240112
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "658.8",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-5,957,531,054,603,200,000 |
Autor
Alejandro Alcalde
Graduado en Ingeniería Informática en la ETSIIT, Granada.
Más artículos de Alejandro Alcalde
¿Has visto algún error?: Por favor, ayúdame a corregirlo contactando conmigo.
Llegó el momento de crear un módulo con la Python C API algo más complejo, como dijimos en la primera parte, crearemos un módulo llamado herramientasRed que permita obtener la dirección IP de un dominio, algo parecido a lo que hicimos en NDK-gdb – Depurar aplicaciones en el NKD de Android.
Creación del módulo
Mostraremos el código completo, puesto que ya se ha explicado el significado de este trozo de código no nos extenderemos mucho:
#include <Python.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
static PyObject*
herramientasRed_imprimeIP(PyObject *self, PyObject *args)
{
char *domainName;
struct hostent *host_info;
struct in_addr *address;
if (!PyArg_ParseTuple(args, "s", &domainName))
return NULL;
char returnValue[100];
memset(returnValue, 0, 100);
host_info = gethostbyname(domainName);
if (strlen(returnValue) + strlen(domainName) + 16 > 99)
return NULL;
if(host_info == NULL) {
sprintf(returnValue, "No se pudo obtener la IP del dominio %s\n", domainName);
} else {
address = (struct in_addr *) (host_info->h_addr);
sprintf(returnValue, "%s tiene dirección IP %s\n", domainName, inet_ntoa(*address));
}
return Py_BuildValue("s", returnValue);
}
static
PyMethodDef herramientasRed_methods[] = {
{"imprimeIP", herramientasRed_imprimeIP, METH_VARARGS, "Documentación del módulo ejemplo"},
{NULL, NULL, 0, NULL}, /* Sentinel */
};
PyMODINIT_FUNC
initherramientasRed(void)
{
PyObject *m;
m = Py_InitModule("herramientasRed", herramientasRed_methods);
if (m == NULL)
return;
}
Compilación y uso
Ahora que hemos visto cómo usar DistUtils, haremos uso de esta herramienta para compilar e instalar el módulo, el contenido del fichero setup.py es:
from distutils.core import setup, Extension
hRed = Extension('herramientasRed',
sources = ['herramientasRed.c'])
setup (name = 'HerramientasRed',
version = '1.0',
author = 'Alejandro Alcalde',
license = 'GPLv3',
description = 'Un simple modulo para obtener la IP de un dominio',
ext_modules = [hRed])
Lo ejecutamos:
# python setup.py install
running install
running build
running build_ext
running install_lib
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/HerramientasRed-1.0.egg-info
Y para usarlo:
In [1]: import herramientasRed
In [2]: print herramientasRed.imprimeIP('elbauldelprogramador.com')
elbauldelprogramador.com tiene dirección IP <ip>
Depuración de módulos Python C API
Es probable que durante el desarrollo de un módulo para Python sea necesario depurar el código, para ello hay que realizar los siguiente pasos:
Añadir la siguiente línea al fichero *.gdbinit*
br _PyImport_LoadDynamicModule
Compilar el módulo mediante gcc sin optimizaciones:
# CFLAGS='-Wall -O0 -g' python setup.py install
Por último ejecutamos gdb de la siguiente forma:
$ gdb -ex r --args python test.py
Tras ejecutar la línea de arriba, establecemos un punto de ruptura en la función deseada, en este caso herramientasRed_imprimeIP y ya podremos depurar el módulo:
(gdb) b herramientasRed_imprimeIP
Breakpoint 1 at 0x7ffff695496a: file herramientasRed.c, line 17.
(gdb) r
Starting program: /usr/bin/python2.7 test.py
Breakpoint 1, herramientasRed_imprimeIP (self=0x0, args=0x965990) at herramientasRed.c:17
17 if (!PyArg_ParseTuple(args, "s", &domainName)){
(gdb) display /s domainName
1: x/s domainName 0x7ffff7f5e454: "elbauldelprogramador.com"
22 memset(returnValue, 0, 100);
(gdb) p *args
$1 = {
ob_refcnt = 1,
ob_type = 0x888280 <PyTuple_Type>
}
(gdb) c
Continuing.
elbauldelprogramador.com tiene dirección IP <ip>
[Inferior 1 (process 28242) exited normally]
Como se puede observar, si imprimimos en pantalla el argumento args, que representa los parámetros que se pasan desde python, se aprecia el reference count del que hablamos en la parte 1.
Así concluye esta cuarta parte, en la quinta y última veremos cómo hacer compatibles nuestros módulos con la versión 3 de Python.
Referencias
Quizá también te interese leer...
|
{
"url": "https://elbauldelprogramador.com/crear-modulo-python-con-python-c-api-4/",
"source_domain": "elbauldelprogramador.com",
"snapshot_id": "crawl=CC-MAIN-2017-39",
"warc_metadata": {
"Content-Length": "311482",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:2A4XRNI623U74EVU7JSV7B5P4JY7AS4Z",
"WARC-Concurrent-To": "<urn:uuid:6a6474c5-c3bc-4c68-9960-0b8d773db94c>",
"WARC-Date": "2017-09-22T00:59:06Z",
"WARC-IP-Address": "104.28.22.95",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:M7GD4GKI6IIIUL44OQP7HMZONV4KZXWO",
"WARC-Record-ID": "<urn:uuid:9250ae71-5b3e-40d5-862d-2d7bf59d5b6d>",
"WARC-Target-URI": "https://elbauldelprogramador.com/crear-modulo-python-con-python-c-api-4/",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:879c56ba-cda0-4b76-a6ee-c85e79ce6aaf>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-159-149-228.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-39\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for September 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
6,
7,
25,
26,
84,
85,
120,
121,
199,
200,
491,
492,
493,
494,
514,
515,
643,
644,
664,
684,
708,
732,
755,
756,
775,
776,
793,
851,
853,
875,
906,
935,
936,
987,
1008,
1009,
1036,
1069,
1070,
1113,
1173,
1194,
1222,
1309,
1319,
1377,
1478,
1482,
1526,
1528,
1529,
1536,
1578,
1674,
1716,
1719,
1720,
1735,
1761,
1763,
1780,
1781,
1848,
1867,
1883,
1885,
1886,
1904,
1905,
2054,
2055,
2099,
2100,
2136,
2189,
2190,
2223,
2254,
2298,
2331,
2412,
2448,
2449,
2464,
2465,
2491,
2507,
2521,
2539,
2559,
2584,
2660,
2661,
2676,
2677,
2708,
2776,
2825,
2826,
2861,
2862,
3006,
3007,
3055,
3056,
3087,
3088,
3140,
3141,
3189,
3190,
3239,
3240,
3274,
3275,
3437,
3438,
3472,
3537,
3545,
3590,
3591,
3681,
3736,
3764,
3828,
3867,
3881,
3888,
3905,
3941,
3943,
3951,
3963,
4012,
4013,
4058,
4059,
4247,
4248,
4378,
4379,
4391,
4392
],
"line_end_idx": [
6,
7,
25,
26,
84,
85,
120,
121,
199,
200,
491,
492,
493,
494,
514,
515,
643,
644,
664,
684,
708,
732,
755,
756,
775,
776,
793,
851,
853,
875,
906,
935,
936,
987,
1008,
1009,
1036,
1069,
1070,
1113,
1173,
1194,
1222,
1309,
1319,
1377,
1478,
1482,
1526,
1528,
1529,
1536,
1578,
1674,
1716,
1719,
1720,
1735,
1761,
1763,
1780,
1781,
1848,
1867,
1883,
1885,
1886,
1904,
1905,
2054,
2055,
2099,
2100,
2136,
2189,
2190,
2223,
2254,
2298,
2331,
2412,
2448,
2449,
2464,
2465,
2491,
2507,
2521,
2539,
2559,
2584,
2660,
2661,
2676,
2677,
2708,
2776,
2825,
2826,
2861,
2862,
3006,
3007,
3055,
3056,
3087,
3088,
3140,
3141,
3189,
3190,
3239,
3240,
3274,
3275,
3437,
3438,
3472,
3537,
3545,
3590,
3591,
3681,
3736,
3764,
3828,
3867,
3881,
3888,
3905,
3941,
3943,
3951,
3963,
4012,
4013,
4058,
4059,
4247,
4248,
4378,
4379,
4391,
4392,
4425
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4425,
"ccnet_original_nlines": 144,
"rps_doc_curly_bracket": 0.003841809928417206,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.08045977354049683,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.027586210519075394,
"rps_doc_frac_lines_end_with_ellipsis": 0.006896549835801125,
"rps_doc_frac_no_alph_words": 0.3724137842655182,
"rps_doc_frac_unique_words": 0.557729959487915,
"rps_doc_mean_word_length": 6.389432430267334,
"rps_doc_num_sentences": 37,
"rps_doc_symbol_to_word_ratio": 0.010344830341637135,
"rps_doc_unigram_entropy": 5.327113628387451,
"rps_doc_word_count": 511,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.02572740986943245,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.006125569809228182,
"rps_doc_frac_chars_top_3gram": 0.015620210207998753,
"rps_doc_frac_chars_top_4gram": 0.007963250391185284,
"rps_doc_books_importance": -299.0570373535156,
"rps_doc_books_importance_length_correction": -299.0570373535156,
"rps_doc_openwebtext_importance": -198.84608459472656,
"rps_doc_openwebtext_importance_length_correction": -198.84608459472656,
"rps_doc_wikipedia_importance": -168.3400421142578,
"rps_doc_wikipedia_importance_length_correction": -168.3400421142578
},
"fasttext": {
"dclm": 0.9855856895446777,
"english": 0.029006149619817734,
"fineweb_edu_approx": 2.511892557144165,
"eai_general_math": 0.014279539696872234,
"eai_open_web_math": 0.3003482222557068,
"eai_web_code": 0.713873565196991
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.02",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,304,002,335,020,675,600 |
It Solution Stuff provide a collection of tutorials about PHP, Laravel Framework, Codeigniter Framework, Mysql Database, Bootstrap Front-end Framework, Jquery, Node JS, Ajax Example, APIs, CURL Example, Composer Packages Example, AngularJS etc. You will find the best example an article about PHP Language. So you can also search tutorial from bellow search box.
Please Subscribe Your Email Address, We Will Notify When Add New Post:
Latest Post
Angular 9/8 Pipes Example | Angular Pipes List Tutorial
Angular 9/8 Pipes Example | Angular Pipes List Tutorial
Hello All, Now, let's see tutorial of angular pipes list. you can understand a concept of angular pipes example. you will learn pipes in angular 9 example. let’s discuss about pipes in angular 7 example. Let's see bellow example angular 8 pipes example. In this tutorial, i would like to show you.....
By Hardik Savani | April 11, 2020 | Category : Angular
Angular 9/8 KeyValue Pipe Example | KeyValue Pipe in Angular
Angular 9/8 KeyValue Pipe Example | KeyValue Pipe in Angular
This article will give you example of angular keyvalue pipe example. let’s discuss about angular keyvalue pipe order. This article will give you simple example of angular ngfor key value pipe. let’s discuss about keyvalue pipe angular. Follow bellow tutorial step of angular keyvalue pipe code. .....
By Hardik Savani | April 11, 2020 | Category : Angular
Angular 9/8 Slice Pipe Example | Slice Pipe in Angular
Angular 9/8 Slice Pipe Example | Slice Pipe in Angular
Hi All, In this post, we will learn angular slice pipe example. I’m going to show you about slice pipe angular example. This article goes in detailed on angular slice pipe. we will help you to give example of angular 8 slice pipe array example. Let's get started with angular 9 slice pipe string e.....
By Hardik Savani | April 11, 2020 | Category : Angular
Angular 9/8 Percent Pipe Example | Percent Pipe in Angular
Angular 9/8 Percent Pipe Example | Percent Pipe in Angular
This article i will explain you about angular percent pipe example. we will use a angular percent pipe. This post will give you simple example of percent pipe angular example. you can see angular percent pipe format. In this tutorial i will provide you full example and how to use angular percent p.....
By Hardik Savani | April 10, 2020 | Category : Angular
Laravel Order By Relation Column Example
Laravel Order By Relation Column Example
Hello Artisan, Now, let's see example of laravel order by relation column. you can understand a concept of laravel orderby belongsto relationship. step by step explain orderby in relation laravel. you will learn orderby relation table laravel. Let's see bellow example laravel orderby relationship co.....
By Hardik Savani | April 9, 2020 | Category : Laravel
|
{
"url": "https://www.itsolutionstuff.com/?page=13",
"source_domain": "www.itsolutionstuff.com",
"snapshot_id": "crawl=CC-MAIN-2020-24",
"warc_metadata": {
"Content-Length": "73339",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:KCICFEXEY5G7VJOIWAK6MVT2N3XSVCJR",
"WARC-Concurrent-To": "<urn:uuid:cd744a73-e4a2-4c23-9474-96f8e8c07fc1>",
"WARC-Date": "2020-05-29T00:38:49Z",
"WARC-IP-Address": "35.175.60.16",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:ZPJWXZWHRZ3T44OVOG7IUE52BW6NOKEM",
"WARC-Record-ID": "<urn:uuid:f480f22f-bc64-485d-9391-82e9fb7fda88>",
"WARC-Target-URI": "https://www.itsolutionstuff.com/?page=13",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:241754a1-111c-4da5-80df-7bcbf6d6c970>"
},
"warc_info": "isPartOf: CC-MAIN-2020-24\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May/June 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-84.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
363,
364,
435,
436,
437,
449,
450,
451,
452,
508,
509,
565,
566,
868,
869,
924,
925,
986,
987,
1048,
1049,
1350,
1351,
1406,
1407,
1408,
1463,
1464,
1519,
1520,
1823,
1824,
1879,
1880,
1939,
1940,
1999,
2000,
2304,
2305,
2360,
2361,
2402,
2403,
2444,
2445,
2751,
2752
],
"line_end_idx": [
363,
364,
435,
436,
437,
449,
450,
451,
452,
508,
509,
565,
566,
868,
869,
924,
925,
986,
987,
1048,
1049,
1350,
1351,
1406,
1407,
1408,
1463,
1464,
1519,
1520,
1823,
1824,
1879,
1880,
1939,
1940,
1999,
2000,
2304,
2305,
2360,
2361,
2402,
2403,
2444,
2445,
2751,
2752,
2805
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2805,
"ccnet_original_nlines": 48,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.24368230998516083,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.009025270119309425,
"rps_doc_frac_lines_end_with_ellipsis": 0.10204081982374191,
"rps_doc_frac_no_alph_words": 0.22924187779426575,
"rps_doc_frac_unique_words": 0.29318180680274963,
"rps_doc_mean_word_length": 5.009090900421143,
"rps_doc_num_sentences": 30,
"rps_doc_symbol_to_word_ratio": 0.009025270119309425,
"rps_doc_unigram_entropy": 4.22154426574707,
"rps_doc_word_count": 440,
"rps_doc_frac_chars_dupe_10grams": 0.1805807650089264,
"rps_doc_frac_chars_dupe_5grams": 0.3330308496952057,
"rps_doc_frac_chars_dupe_6grams": 0.3003629744052887,
"rps_doc_frac_chars_dupe_7grams": 0.22141560912132263,
"rps_doc_frac_chars_dupe_8grams": 0.22141560912132263,
"rps_doc_frac_chars_dupe_9grams": 0.1805807650089264,
"rps_doc_frac_chars_top_2gram": 0.044918328523635864,
"rps_doc_frac_chars_top_3gram": 0.043557170778512955,
"rps_doc_frac_chars_top_4gram": 0.043103449046611786,
"rps_doc_books_importance": -248.93392944335938,
"rps_doc_books_importance_length_correction": -248.93392944335938,
"rps_doc_openwebtext_importance": -145.72232055664062,
"rps_doc_openwebtext_importance_length_correction": -145.72232055664062,
"rps_doc_wikipedia_importance": -108.0694808959961,
"rps_doc_wikipedia_importance_length_correction": -108.0694808959961
},
"fasttext": {
"dclm": 0.021911680698394775,
"english": 0.7445834279060364,
"fineweb_edu_approx": 3.0281269550323486,
"eai_general_math": 0.1974465250968933,
"eai_open_web_math": 0.22988814115524292,
"eai_web_code": 0.003617410082370043
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.136",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "6",
"label": "Content Listing"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-4,152,978,756,440,599,600 |
Search
Languages
<
5 min read
Virtual Strategy Magazine: Q&A with George Teixeira of DataCore Software
http://www.virtual-strategy.com/2011/01/31/qa-george-teixeira-datacore-software?page=0,0
“SANsymphony-V lets you do more with what you already have. Playing off of our musical theme – it orchestrates, tunes, and harmonizes your inflexible storage devices into a dynamic symphony.”
VSM: How is DataCore solving this “Big Problem” in server and desktop virtualization projects?
GT: DataCore is all about storage virtualization, and virtualization is all about applying the advantages of software to cut costs and insulate applications and users from disruptive changes and business risks. Unless the storage assets are virtualized, no server or desktop virtualization project can be considered complete. The business benefits of a stable software infrastructure spanning multiple manufacturers and models across generations of hardware are as compelling for storage environments as they are for servers and desktops. In fact, we think every virtualization strategy must be three dimensional, considering and planning for each server, storage, and desktop virtualization.
The storage problem – its high cost, inadequate performance, inflexibility, vendor lock in – is and remains the “Big Problem” in server and desktop virtualization projects. DataCore solves that problem. We’ve built a software platform that’s open and “future-proof.” It adapts over time, endures over generations of hardware, and enables customers to virtualize their entire storage infrastructure. Customers can repurpose and use existing resources more efficiently and choose lower-cost alternatives when adding or purchasing new resources. They get a stronger, more flexible infrastructure with far greater performance, availability, and redundancy. DataCore is the critical storage virtualization software layer that solves the “Big Problem,” making server and desktop virtualization projects successful.
VSM: Tell us about your new product, SANsymphony-V.
GT: Today we’re launching our SANsymphony-V product, a next-generation storage virtualization software solution. SANsymphony-V eliminates the difficult and costly storage-related barriers to desktop and server customers’ virtualization initiatives. It allows customers to use existing equipment and conventional storage devices to achieve the robust and responsive shared storage environment necessary to support highly dynamic virtual IT environments. This contrasts sharply with the budget busting “rip and replace” approaches traditionally being proposed by storage hardware vendors to support desktop and server virtualization projects.
SANsymphony-V lets you do more with what you already have. Playing off of our musical theme – it orchestrates, tunes, and harmonizes your inflexible storage devices into a dynamic symphony. The “V”, by the way, in SANsymphony-V stands for virtualization.
VSM: What are the most compelling user benefits for SANsymphony-V?
GT: The most important benefit of a software-based approach to storage infrastructure is that it enables customers toget more from whatever storage they use, repurpose existing equipment, and extend its useful life. Therefore, SANsymphony-V helps businesses maximize ROI, minimize costs, and mitigate their risks. Just as importantly, it boosts productivity through its modern and intuitive storage management making it much easier to automate tasks and manage storage resources efficiently within any virtual infrastructure (server and/or desktop).
SANsymphony-V also includes a number of advances to better safeguard workloads and avoid disruptions, including integrated continuous data protection (CDP), multi-site recovery, and high-speed and traffic compressing replication.
VSM: What are the differentiating elements of the DataCore model/approach compared to other solutions on the market? For example, what are the differentiating factors in SANsymphony-V?
GT: In addition to what I have already stated, the main difference arises because DataCore is virtualization software for storage. Unlike vendors who claim to offer “virtualization” from within their storage arrays, DataCore permits users to leverage their existing storage that they have already deployed, while enhancing it with infrastructure-wide features that span many different storage devices from many different vendors. Most importantly, the virtual software infrastructure lives beyond the life of these storage devices which come and go over time.
No one would ever dream of throwing away Exchange or VMware because the server on which it was running became obsolete. Yet, this is what the storage industry has been forcing customers to do with their storage for years – junking their entire investment each time they need to replace, grow or upgrade their storage solutions. DataCore gives customers the power to reject this costly approach by offering both the shared storage required to implement virtual infrastructures and the comfort of knowing that their storage investments will continue to work for them for many years to come.
VSM: What are the future challenges in this market and how does DataCore intend to respond?
GT: For storage virtualization, I see three driving forces: the move to greater commoditization of hardware, the need to better consolidate the use of resources, and the need to drive down people costs. Every CIO I have visited recently is focused on the cost equation and getting higher productivity. DataCore makes commoditization practical, while providing performance and functionality. We allow multiple storage types and existing storage to be consolidated to maximize storage asset utilization. Our software greatly automates storage management and the administrative tasks associated with storing information across many systems.
Another key driver for storage virtualization is the increase in server and desktop virtualization products like those from VMware, Citrix, and Microsoft. They drive the need for a lot more storage. When you only had individual servers, you would use the attached captive disks installed in the server. With server virtualization products, you need virtual infrastructure storage, which can be provided to one server, many servers, or a farm of servers. A lot more capacity and flexibility is required, and there’s typically a lot more performance load on those virtualized servers. Because of DataCore’s scalability and performance, our storage virtualization may help foster an even faster rate of adoption of combined, large-scale server and storage virtualization infrastructures. It’s an interesting cycle; server virtualization drives more storage and performance requirements, thereby driving the need for powerful storage virtualization.
We’ve done a great job of virtualizing storage and companies like VMware and Microsoft have done a great job of virtualizing servers, but there’s a lot more to be gained by building an infrastructure that includes both. Many of our customers have already combined these two technologies, and I see this trend continuing. We work with our partners and vendors like VMware, Microsoft, and Citrix so that our combined virtual capabilities work well together within end-user environments.
Data Storage Solutions for Your Every IT Need
Talk with a solution advisor about how DataCore Software-Defined Storage can make your storage infrastructure modern, performant, and flexible.
Get Started
Related Posts
A Cost-Effective S3 Object Storage Platform for Cloud Service Providers
Vinod Mohan
A Cost-Effective S3 Object Storage Platform for Cloud Service Providers
Data Care with DataCore
Vinod Mohan
Data Care with DataCore
Availability vs Durability vs Reliability vs Resilience vs Fault Tolerance
Vinod Mohan
Availability vs Durability vs Reliability vs Resilience vs Fault Tolerance
|
{
"url": "https://www.datacore.com/blog/virtual-strategy-magazine-qa-with-george-teixeira-of-datacore-software/",
"source_domain": "www.datacore.com",
"snapshot_id": "CC-MAIN-2024-26",
"warc_metadata": {
"Content-Length": "204602",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:ZFPS4MOZQWOFOAXEHCUIOA7WCQUBYKBI",
"WARC-Concurrent-To": "<urn:uuid:8cf5d93e-def3-4bdc-9dfc-63652bdc86bc>",
"WARC-Date": "2024-06-19T03:22:35Z",
"WARC-IP-Address": "146.75.30.217",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:DHBZKL6KAPUHUHUHEG6B4NG44SDA7YAC",
"WARC-Record-ID": "<urn:uuid:8fee3aad-0edc-4d8f-8a26-9b97012d2d1c>",
"WARC-Target-URI": "https://www.datacore.com/blog/virtual-strategy-magazine-qa-with-george-teixeira-of-datacore-software/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3a306086-59d3-414b-95f4-6b7782849709>"
},
"warc_info": "isPartOf: CC-MAIN-2024-26\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for June 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-161\r\nsoftware: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
7,
17,
19,
30,
31,
104,
105,
194,
195,
387,
388,
483,
484,
1177,
1178,
1987,
1988,
2040,
2041,
2682,
2683,
2938,
2939,
3006,
3007,
3557,
3558,
3788,
3789,
3974,
3975,
4535,
4536,
5125,
5126,
5218,
5219,
5857,
5858,
6804,
6805,
7290,
7291,
7337,
7338,
7482,
7483,
7495,
7496,
7510,
7512,
7584,
7596,
7668,
7670,
7694,
7706,
7730,
7732,
7807,
7819
],
"line_end_idx": [
7,
17,
19,
30,
31,
104,
105,
194,
195,
387,
388,
483,
484,
1177,
1178,
1987,
1988,
2040,
2041,
2682,
2683,
2938,
2939,
3006,
3007,
3557,
3558,
3788,
3789,
3974,
3975,
4535,
4536,
5125,
5126,
5218,
5219,
5857,
5858,
6804,
6805,
7290,
7291,
7337,
7338,
7482,
7483,
7495,
7496,
7510,
7512,
7584,
7596,
7668,
7670,
7694,
7706,
7730,
7732,
7807,
7819,
7893
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 7893,
"ccnet_original_nlines": 61,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3441176414489746,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.027205880731344223,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.14779411256313324,
"rps_doc_frac_unique_words": 0.407671719789505,
"rps_doc_mean_word_length": 5.860838413238525,
"rps_doc_num_sentences": 56,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.482508182525635,
"rps_doc_word_count": 1121,
"rps_doc_frac_chars_dupe_10grams": 0.07945205271244049,
"rps_doc_frac_chars_dupe_5grams": 0.11415524780750275,
"rps_doc_frac_chars_dupe_6grams": 0.10350076109170914,
"rps_doc_frac_chars_dupe_7grams": 0.09528157860040665,
"rps_doc_frac_chars_dupe_8grams": 0.09528157860040665,
"rps_doc_frac_chars_dupe_9grams": 0.07945205271244049,
"rps_doc_frac_chars_top_2gram": 0.025570780038833618,
"rps_doc_frac_chars_top_3gram": 0.01826483942568302,
"rps_doc_frac_chars_top_4gram": 0.01826483942568302,
"rps_doc_books_importance": -550.4806518554688,
"rps_doc_books_importance_length_correction": -550.4806518554688,
"rps_doc_openwebtext_importance": -310.0555419921875,
"rps_doc_openwebtext_importance_length_correction": -310.0555419921875,
"rps_doc_wikipedia_importance": -282.6066589355469,
"rps_doc_wikipedia_importance_length_correction": -282.6066589355469
},
"fasttext": {
"dclm": 0.04188007116317749,
"english": 0.9214292168617249,
"fineweb_edu_approx": 1.524095058441162,
"eai_general_math": 0.03264898061752319,
"eai_open_web_math": 0.13539475202560425,
"eai_web_code": 0.034095291048288345
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "6",
"label": "Promotional/Advertisement"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "13",
"label": "News (Org.)"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,046,414,317,306,071,600 |
What is the XAP File Extension?
Author: | Last Updated: November 26, 2018
Microsoft Silver
XAP File Summary
The XAP File Extension has two different file types (mostly seen as the XACT Project format) and can be opened with two distinctive software programs, with the dominant related application developed by Microsoft Corporation (Microsoft XACT software). Although XAP files are traditionally categorized as Developer Files, they can also be Executable Files.
File Extension XAP is supported by Windows, Mac, and Linux operating systems. These types of files can be found on both desktop and mobile devices. These files have a Popularity Rating of "Low", meaning they are not very commonly observed on your average hard disk.
Although there is a lot more to know about XAP files, those are the most important details of these types of files. If you are having trouble opening these files, or would like more detailed information, please see our comprehensive information below.
Low
File Type Popularity
8554
File Rank
/ 11690
Active
This file type is still current and actively used by developers and software applications. Although the original software of this designated file type might be eclipsed by newer version (eg. Excel 97 versus Office 365), this file type is still actively supported by the current software version. This process of interoperability with an older operating system or legacy software version is also known as "backwards compatibility".
File Status
26
November
2018
Page Last Updated
Open your files in %%os%% with FileViewPro File Viewer
Product by Solvusoft
Free Download
McAfee SECURE sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams
Optional Offer for FileViewPro by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Types of XAP Files
2 known file types use this extension
Primary XAP File Association
.XAP
File Format:.xap
File Type:XACT Project
XAP file contains the intermediate form of the information produced by XACT. It includes complete descriptions of wave banks, sound banks, and global settings.
Created by: Microsoft Corporation
File Category:Developer Files
Registry Key: HKEY_CLASSES_ROOT\.xap
Software Programs That Open The XACT Project:
Microsoft XACT by Microsoft Corporation
Compatible with:
Windows
Mac
Linux
Other XAP File Associations
.XAP
File Format:.xap
File Type:Silverlight Application Package
File associated with Microsoft Silverlight, an application framework for writing and running rich Internet applications. XAP File is an application package used for Microsoft Silverlight and Windows Phone 7 mobile applications.
Created by: Microsoft Corporation
File Category:Executable Files
Software Programs That Open Silverlight Application Package Files:
Microsoft Silverlight by Microsoft Corporation
Compatible with:
Windows
Mac
Symbian OS
Optional Offer for FileViewPro by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
XAP File Popularity
Troubleshoot Any Type of File Yourself
Troubleshooting Problems Opening XAP Files
Common Problems Opening XAP Files
Microsoft XACT is Not Installed
When you double-click your XAP file, you may see a dialog box from your operating system stating that it "Cannot Open This File Type". If this is the case, it's usually due to the fact that you do not have Microsoft XACT for %%os%% installed on your computer. Because your operating system doesn't know what to do with this file, you won't be able to open it by double-clicking.
Tip: If you know of another program that can open your XAP file, you can try opening it by selecting the application from the programs listed.
Wrong Version of Microsoft XACT is Installed
In some cases, you might have a newer (or older) version of a XACT Project file that is unsupported by your installed application version. If you do not have the proper version Microsoft XACT (or any of the other programs listed above), you may need to try downloading a different version of it, or one of the other software applications listed above. This problem is most common when you have an older version of the software application, and your file was created by a newer version that it cannot recognize.
Tip: Sometimes you can get a clue about the version of XAP file you have by right clicking on the file, then clicking on "Properties" (Windows) or "Get Info" (Mac OSX).
Summary: In either case, the majority of problems opening XAP files are related to not having the correct software application installed on your computer.
Other Causes of XAP File Opening Problems
Although you might already have Microsoft XACT or another XAP-associated software installed on your computer, you can still encounter problems opening XACT Project files. If you are still having problems opening XAP files, there may be other issues that are preventing you from opening these files. These other problems include (listed in order from most to least common):
• Invalid XAP file references in the Windows Registry (the "phonebook" of the Windows Operating System)
• Accidental deletion of the description of the XAP file in the Windows registry
• Incomplete or bad installation of a software application associated with the XAP format
• Your XAP file is corrupted (issues with your XACT Project file itself)
• Your XAP is infected with malware
• Device drivers of the hardware associated with your XAP file are corrupt or out-of-date
• Your computer does not have the adequate system resources to open the XACT Project format
Poll: What is your favorite word processing application?
Top Web Browsers
Chrome (58.80%)
Firefox (11.05%)
Internet Explorer (9.04%)
Edge (8.46%)
Safari (3.87%)
Fact Of The Day
Amazon’s desire to create a proprietary ebook file which allowed for combinations of popular ebook formats like EPUB and MOBI, Kindle-specific meta information, and DRM protection led to the release of the AZW3 file format, in 2010 along with the Kindle 8.
How to Fix Problems Opening XAP Files
Step 1
Conduct a Malware Scan of Your XAP File
When an antivirus program is installed on the computer, it is capable of scanning all files on the computer, as well as each file individually. Each file can be scanned by right-clicking the file and choosing the option to scan the file for viruses.
For example, in this picture, we've highlighted the my-file.xap file and right-clicked the file to see the 'Scan with AVG' option in the file menu. When this option is selected, AVG Antivirus opens and scans that file for any viruses.
my-file.xap
Step 2
Reinstall Microsoft XACT
Occasionally you might experience a flawed software installation, which may be due to a problem encountered during the install process. This can prevent your operating system from associating your XAP file with the right software application, affecting what is known as "file extension associations".
Sometimes, simply reinstalling Microsoft XACT will solve your problem, properly associating your XAP with Microsoft XACT. Other times, poor software programming on behalf of the software developer can cause problems with file associations, and you may need to contact the developer for further assistance.
Tip: Try upgrading to the latest version of Microsoft XACT to ensure you have the latest patches and updates installed.
Step 3
Obtain Another Copy of Your XAP File
It may seem too obvious, but many times your XAP file itself might be the cause of the problem. If you received the file through an email attachment, or downloaded from a website and it was interrupted (e.g. power outage or other reason), it may have corrupted the file. If possible, try obtaining another fresh copy of your XAP file and attempt to open it again.
Caution: A corrupt file could also be collateral damage of a previous or existing malware infection on your PC, that's why it is essential that you keep an updated antivirus running on your computer at all times.
Step 4
Update Your Microsoft Corporation-Related Hardware Device Drivers
If your XAP file is related to a piece of hardware on your computer, you might need to update your device drivers associated with that hardware in order to open it.
This problem is commonly related to multimedia file types that depend upon a piece of hardware inside of your computer to be successfully opened, such as a sound card or graphics card. For example, if you are trying to open an audio file, but failing to open it, you might need to update your sound card drivers.
Tip: If you are receiving an error message related to a .SYS file when attempting to open your XAP file, it's likely your problem is related to corrupt or outdated device drivers that need to be updated. Using a driver update software such as DriverDoc can help make this process much easier to complete.
Step 5
Close Other Applications Running
If all other steps fail, and you are still experiencing problems opening XAP files, it might be due to a lack of available system resources. Some versions of XAP files can require substantial resources (eg. Memory/RAM, processing power) to be properly opened by your computer. This is quite common if your computer hardware is older, and you are using a much newer operating system.
This issue can occur when your computer is having a hard time keeping up because the operating system (and other services running in the background) might be consuming too many resources for your XAP file to open. Try closing all applications on your PC before attempting to open your XACT Project. Freeing up all of the available resources on your computer provides the best environment for attempting to open your XAP file.
Step 6
Upgrade Your Computer Hardware
If you've tried all of the steps above, and your XAP file still won't open, you might be due for a hardware upgrade. In most cases, even if you have older hardware, processing power is still more than adequate for most user's applications (unless you do a lot of CPU resource-intensive work such as 3D rendering, financial / scientific modeling, or intensive multimedia work). Therefore, it's likely that your computer is lacking the necessary amount of memory (more commonly referred to as "RAM", or random access memory) to complete the file opening task.
Try upgrading your memory to see if that helps you open your XAP file. These days, memory upgrades are quite affordable and very easy for even the casual computer user to install in their PC. As a bonus, you'll probably see a nice performance bump in other tasks carried out on your computer.
Optional Offer for FileViewPro by Solvusoft | EULA | Privacy Policy | Terms | Uninstall
Browse File Extensions in Alphabetical Order: # A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
© Solvusoft Corporation 2011-2020. All Rights Reserved.
|
{
"url": "https://www.solvusoft.com/en/file-extensions/file-extension-XAP",
"source_domain": "www.solvusoft.com",
"snapshot_id": "crawl=CC-MAIN-2020-45",
"warc_metadata": {
"Content-Length": "74468",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:3UXTU2QLUXKLCL6CZD3N3ZXNDHGOHLHW",
"WARC-Concurrent-To": "<urn:uuid:2415244c-58c0-4b93-8357-c73ca3dd34b2>",
"WARC-Date": "2020-10-21T10:54:03Z",
"WARC-IP-Address": "104.121.93.132",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:CVNLT4AYTKMURGXDE7HTB7UUCO72KWT3",
"WARC-Record-ID": "<urn:uuid:73367c47-9c01-4131-95b1-56f478cc9729>",
"WARC-Target-URI": "https://www.solvusoft.com/en/file-extensions/file-extension-XAP",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:91210060-7c8b-4c78-99f5-c7112ca1c419>"
},
"warc_info": "isPartOf: CC-MAIN-2020-45\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for October 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-120.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
1,
33,
34,
80,
81,
98,
99,
116,
117,
472,
473,
739,
740,
992,
993,
997,
1018,
1023,
1033,
1034,
1042,
1043,
1050,
1051,
1484,
1496,
1497,
1500,
1501,
1510,
1511,
1516,
1517,
1535,
1536,
1591,
1592,
1613,
1614,
1628,
1629,
1748,
1749,
1837,
1838,
1857,
1858,
1898,
1899,
1928,
1929,
1934,
1951,
1974,
1975,
2135,
2136,
2170,
2200,
2237,
2238,
2284,
2285,
2286,
2326,
2327,
2344,
2345,
2353,
2357,
2363,
2364,
2392,
2393,
2398,
2415,
2457,
2458,
2686,
2687,
2721,
2752,
2753,
2820,
2821,
2822,
2869,
2870,
2887,
2888,
2896,
2900,
2911,
2912,
3000,
3001,
3002,
3022,
3023,
3024,
3063,
3064,
3065,
3066,
3109,
3110,
3111,
3145,
3146,
3178,
3179,
3558,
3559,
3560,
3703,
3704,
3705,
3750,
3751,
4262,
4263,
4264,
4433,
4434,
4435,
4590,
4591,
4592,
4634,
4635,
5008,
5009,
5115,
5198,
5290,
5365,
5403,
5495,
5589,
5590,
5647,
5648,
5649,
5650,
5651,
5652,
5653,
5654,
5655,
5656,
5657,
5658,
5675,
5676,
5692,
5709,
5735,
5748,
5763,
5764,
5780,
5781,
6038,
6039,
6040,
6078,
6079,
6086,
6087,
6127,
6128,
6378,
6379,
6614,
6615,
6627,
6628,
6629,
6636,
6637,
6662,
6663,
6964,
6965,
7271,
7272,
7273,
7393,
7394,
7395,
7402,
7403,
7440,
7441,
7805,
7806,
7807,
8020,
8021,
8022,
8029,
8030,
8096,
8097,
8262,
8263,
8576,
8577,
8578,
8883,
8884,
8885,
8892,
8893,
8926,
8927,
9310,
9311,
9737,
9738,
9739,
9746,
9747,
9778,
9779,
10337,
10338,
10631,
10632,
10633,
10721,
10722,
10723,
10825,
10826
],
"line_end_idx": [
1,
33,
34,
80,
81,
98,
99,
116,
117,
472,
473,
739,
740,
992,
993,
997,
1018,
1023,
1033,
1034,
1042,
1043,
1050,
1051,
1484,
1496,
1497,
1500,
1501,
1510,
1511,
1516,
1517,
1535,
1536,
1591,
1592,
1613,
1614,
1628,
1629,
1748,
1749,
1837,
1838,
1857,
1858,
1898,
1899,
1928,
1929,
1934,
1951,
1974,
1975,
2135,
2136,
2170,
2200,
2237,
2238,
2284,
2285,
2286,
2326,
2327,
2344,
2345,
2353,
2357,
2363,
2364,
2392,
2393,
2398,
2415,
2457,
2458,
2686,
2687,
2721,
2752,
2753,
2820,
2821,
2822,
2869,
2870,
2887,
2888,
2896,
2900,
2911,
2912,
3000,
3001,
3002,
3022,
3023,
3024,
3063,
3064,
3065,
3066,
3109,
3110,
3111,
3145,
3146,
3178,
3179,
3558,
3559,
3560,
3703,
3704,
3705,
3750,
3751,
4262,
4263,
4264,
4433,
4434,
4435,
4590,
4591,
4592,
4634,
4635,
5008,
5009,
5115,
5198,
5290,
5365,
5403,
5495,
5589,
5590,
5647,
5648,
5649,
5650,
5651,
5652,
5653,
5654,
5655,
5656,
5657,
5658,
5675,
5676,
5692,
5709,
5735,
5748,
5763,
5764,
5780,
5781,
6038,
6039,
6040,
6078,
6079,
6086,
6087,
6127,
6128,
6378,
6379,
6614,
6615,
6627,
6628,
6629,
6636,
6637,
6662,
6663,
6964,
6965,
7271,
7272,
7273,
7393,
7394,
7395,
7402,
7403,
7440,
7441,
7805,
7806,
7807,
8020,
8021,
8022,
8029,
8030,
8096,
8097,
8262,
8263,
8576,
8577,
8578,
8883,
8884,
8885,
8892,
8893,
8926,
8927,
9310,
9311,
9737,
9738,
9739,
9746,
9747,
9778,
9779,
10337,
10338,
10631,
10632,
10633,
10721,
10722,
10723,
10825,
10826,
10881
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 10881,
"ccnet_original_nlines": 235,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.36222004890441895,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05452774837613106,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.1445959061384201,
"rps_doc_frac_unique_words": 0.3187001049518585,
"rps_doc_mean_word_length": 4.9498291015625,
"rps_doc_num_sentences": 77,
"rps_doc_symbol_to_word_ratio": 0.0004868500109296292,
"rps_doc_unigram_entropy": 5.476609706878662,
"rps_doc_word_count": 1754,
"rps_doc_frac_chars_dupe_10grams": 0.023842429742217064,
"rps_doc_frac_chars_dupe_5grams": 0.06208246946334839,
"rps_doc_frac_chars_dupe_6grams": 0.04618750885128975,
"rps_doc_frac_chars_dupe_7grams": 0.03443906828761101,
"rps_doc_frac_chars_dupe_8grams": 0.023842429742217064,
"rps_doc_frac_chars_dupe_9grams": 0.023842429742217064,
"rps_doc_frac_chars_top_2gram": 0.023381710052490234,
"rps_doc_frac_chars_top_3gram": 0.019004840403795242,
"rps_doc_frac_chars_top_4gram": 0.01589496061205864,
"rps_doc_books_importance": -947.2525634765625,
"rps_doc_books_importance_length_correction": -947.2525634765625,
"rps_doc_openwebtext_importance": -560.3846435546875,
"rps_doc_openwebtext_importance_length_correction": -560.3846435546875,
"rps_doc_wikipedia_importance": -382.24334716796875,
"rps_doc_wikipedia_importance_length_correction": -382.24334716796875
},
"fasttext": {
"dclm": 0.018306970596313477,
"english": 0.9217379689216614,
"fineweb_edu_approx": 2.546525001525879,
"eai_general_math": 0.09881073236465454,
"eai_open_web_math": 0.23231607675552368,
"eai_web_code": 0.03943866118788719
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "1",
"label": "Factual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "6",
"label": "Promotional/Advertisement"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
1,185,580,835,790,201,600 |
Adventures of an SSH Honeypot
In order to gather data about how SSH servers are attacked, I decided to build my own SSH honeypot.
Adventures of an SSH Honeypot
COVID-19 has caused a major shift in how enterprises perform their day-to-day operations, with a large pool of them settling for remote work. Some enterprises have gone beyond and made remote work as an acceptable standard should the employee desire. Naturally, this is has caused an uptick in phishing emails and log-in difficulties.
When I read in April that the World Health Organization’s staff members emails were leaked, it slowly dawned on me how this situation is ripe for exploitation. How are malicious actors taking advantage of this situation - and to what extent?
That answer proved to be too broad, due to the presence of phishing emails, malware, security misconfigurations and even disinformation. I needed to narrow it down. So, I decided to focus on just one protocol: SSH.
Introduction
Here’s an extremely simplified version of what the protocol is and how it authenticates users: Secure Shell (SSH), is an application layer protocol that is designed to provide remote log-in capabilities to users and administrators so that they can work on machines that stretch throughout their workplaces or even across continents.
Now, the way SSH works is that it essentially provides three methods of authentication:
• None
• Password
• Public Key
The ‘None’ authentication method does exactly what is says - no authentication is required to gain access. Simply type in the username and IP address, and if the username exists - you’re in!
The ‘Password’ authentication method goes one step further. It will ask for the above two requirements and then prompt you for the password. If it is a match - the system will grant you access.
Finally, the ‘Public Key’ authentication method utilizes public-key infrastructure to authenticate the user. Here, instead of a password - you provide the private key associated with your account. If the private key is found to be the match of the public key that is stored on the server, it will grant the user access to the system.
Implementation
As a student, I do not have access to production servers and databases. Thus, in order to gather data about how SSH servers are attacked, I decided to build my own.
Using the standard Python library and the paramiko module, I was able to create a simple SSH server that authenticated users using passwords and public keys.
I chose to leave out the 'None' authentication method as the knowledge of a random IP address alone does not prove that you are a user of the system in question. Security through obscurity is a valid layer, but in the case of ‘None’ authentication method it would end up being the core security mechanism - which would be catastrophic.
Keeping this in mind, I have focused on using the ‘Password’ and ‘Public Key’ authentication methods. In addition to logging which methods are used, I have also logged the following parameters: IP address, usernames, passwords, and SSH clients used for authentication.
In addition to using paramiko's own logging utility, I have also used the logging module - which is part of the standard Python library. Finally, I have used Numbers for visualising the data.
Note: If you are deploying this in the cloud, please be aware that costs can rise dramatically. For this project, I used Amazon Web Services (AWS) to deploy the honeypot. To avoid overstepping the free tier limits, the script has its own fail-safe measure to shut down automatically after a preset amount of time has passed.
Analysis
First of all, let’s talk about usernames. Usernames were found to be in line with the most common usernames present in SecLists, as the graph below details the top 10 most common usernames I found in my honeypot.
As a consumer, one thing that you are assured of (yet have no control over) is security. When data breaches occur and customer data is sold, think how easy it would be to correlate your usernames to your real identity - what story would the data tell? Thus, when it comes to usernames I suggest that unless there is a need to publicly declare your identity, use a random username. Lastpass provides a random username generator that you can check out here.
In my username data, an interesting find was 'cirros', which after a quick Google search turns out is a "minimal Linux distribution that was designed for use as a test image on clouds such as OpenStack Compute".
Nice.
Next up, we'll take a look at passwords.
Again, passwords were found to be in line with SecLists. It looks like admin is still common enough to be exploited, which is a bit disheartening to see. This has served as yet another reminder about the necessity of strong passwords (regardless of your password management process). Another piece of advise is something straight out of the 1Password playbook - who says security questions have to answered with words, use long passwords instead! This way, resetting passwords becomes just as tough as cracking a password - and doesn't scale to meet the needs of threat actors.
There were two distinct passwords that I found, namely ‘gocubsgo’ and ‘cubs win:)’. Guess somebody is a baseball fan, although there are better ways to support your favorite team!
The next parameter we'll look at is the most interesting: IPs!
About 134 unique IPs were observed from China, 46 from the U.S., 22 from the Netherlands ,19 from France and 11 from Russia. This falls in line with reported behavior, although I noticed that none of the connections were bombarding the server with requests - even if successive connections were attempted, they were done so in a manner that maintained a 2 minute gap between each attempt.
This is probably to thwart basic firewall configurations, which means that both security teams and threat actors are aware of tuning firewall configurations - an endeavor that I believe will help us secure systems over the long run.
However, connections by themselves do not indicate malevolence. To gain a better understanding of malicious behavior, I used abuseipdb.com's API to verify maliciousness.
On fetching their data, I found that of the 134 connections made from China, 46 from the US, 22 from the Netherlands, 19 from France and 11 from Russia - all were marked as malicious with an abuseConfidenceScore of 100 (on a scale of 100). Yikes.
However, I'd like to state one thing very clearly: the region within which an IP exists does not imply that the malicious actor resides in the same region as well. Attribution is tough, and singularly relying on IP addresses for determining nefarious activity is a poor practice.
Lastly, let's take a look at the SSH clients that were used to connect to the server.
It was unsurprising to see that PUTTY clients actually beat libssh/openssh clients, as most host systems tend to be Windows machines. Though libssh and openssh did not lag far behind, libssh seems to be more popular than openssh, with 284 connections coming from libssh as opposed to 26 from openssh. Also, the Go programming language seems to be picking up traction is a variety of areas, including networking, as 21 connections were made using a SSH Go client.
Transparency
In the hope that my efforts will be useful in some manner, I have uploaded all of the code to GitHub. You can fetch the dataset from there as well. I will update the data to the extent that Amazon’s free tier allows me to - so expect monthly updates! If you have any constructive criticism about how I could have improved this project, please feel free to message me on Twitter or issue a pull request on GitHub.
I’d love to hear your ideas on how to expand this!
Conclusion
Researching about honeypots, building a small one myself and deploying it proved to be a very fulfilling task. The pandemic has certainly shown me that you can make a difference even if you are staying indoors (and even if you are just a student) - if business operations aren't stopping, neither should we stop learning!
P.S. I am aware of the fact that I could have used a customized configuration of sshd - but where’s the fun in that? 😁
The awesome image used in this article is called Honey and it was created by Gal Shir.
|
{
"url": "https://www.secjuice.com/adventuring-with-an-ssh-honeypot/",
"source_domain": "www.secjuice.com",
"snapshot_id": "crawl=CC-MAIN-2022-49",
"warc_metadata": {
"Content-Length": "38628",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:VFFLSQYEKHAFVWKCLZDKXQUEYR422CMB",
"WARC-Concurrent-To": "<urn:uuid:abf26a02-e932-4438-8890-b2a02a359793>",
"WARC-Date": "2022-12-06T16:53:06Z",
"WARC-IP-Address": "146.75.39.7",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:46NMSTRXFZP4C6SUJLHE62DR4HYH6VHW",
"WARC-Record-ID": "<urn:uuid:75359e93-98d6-48ab-9de8-5a297849900e>",
"WARC-Target-URI": "https://www.secjuice.com/adventuring-with-an-ssh-honeypot/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:6d425308-7615-4cfe-a19c-c3c0175bedb5>"
},
"warc_info": "isPartOf: CC-MAIN-2022-49\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-51\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
30,
31,
131,
132,
162,
163,
498,
499,
741,
742,
957,
958,
971,
972,
1305,
1306,
1394,
1395,
1404,
1417,
1432,
1433,
1624,
1625,
1819,
1820,
2154,
2155,
2170,
2171,
2336,
2337,
2495,
2496,
2832,
2833,
3102,
3103,
3295,
3296,
3621,
3622,
3631,
3632,
3845,
3846,
4302,
4303,
4515,
4516,
4522,
4523,
4564,
4565,
5143,
5144,
5324,
5325,
5388,
5389,
5778,
5779,
6012,
6013,
6183,
6184,
6431,
6432,
6712,
6713,
6799,
6800,
7263,
7264,
7277,
7278,
7691,
7692,
7743,
7744,
7755,
7756,
8078,
8079,
8198,
8199
],
"line_end_idx": [
30,
31,
131,
132,
162,
163,
498,
499,
741,
742,
957,
958,
971,
972,
1305,
1306,
1394,
1395,
1404,
1417,
1432,
1433,
1624,
1625,
1819,
1820,
2154,
2155,
2170,
2171,
2336,
2337,
2495,
2496,
2832,
2833,
3102,
3103,
3295,
3296,
3621,
3622,
3631,
3632,
3845,
3846,
4302,
4303,
4515,
4516,
4522,
4523,
4564,
4565,
5143,
5144,
5324,
5325,
5388,
5389,
5778,
5779,
6012,
6013,
6183,
6184,
6431,
6432,
6712,
6713,
6799,
6800,
7263,
7264,
7277,
7278,
7691,
7692,
7743,
7744,
7755,
7756,
8078,
8079,
8198,
8199,
8285
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 8285,
"ccnet_original_nlines": 86,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4338011145591736,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03233679011464119,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.14521048963069916,
"rps_doc_frac_unique_words": 0.4173228442668915,
"rps_doc_mean_word_length": 4.740873336791992,
"rps_doc_num_sentences": 74,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.6554999351501465,
"rps_doc_word_count": 1397,
"rps_doc_frac_chars_dupe_10grams": 0.04076702147722244,
"rps_doc_frac_chars_dupe_5grams": 0.055261969566345215,
"rps_doc_frac_chars_dupe_6grams": 0.04771251976490021,
"rps_doc_frac_chars_dupe_7grams": 0.04771251976490021,
"rps_doc_frac_chars_dupe_8grams": 0.04076702147722244,
"rps_doc_frac_chars_dupe_9grams": 0.04076702147722244,
"rps_doc_frac_chars_top_2gram": 0.005435599945485592,
"rps_doc_frac_chars_top_3gram": 0.004529669880867004,
"rps_doc_frac_chars_top_4gram": 0.005133629776537418,
"rps_doc_books_importance": -712.388671875,
"rps_doc_books_importance_length_correction": -712.388671875,
"rps_doc_openwebtext_importance": -379.5117492675781,
"rps_doc_openwebtext_importance_length_correction": -379.5117492675781,
"rps_doc_wikipedia_importance": -234.40061950683594,
"rps_doc_wikipedia_importance_length_correction": -234.40061950683594
},
"fasttext": {
"dclm": 0.0651049017906189,
"english": 0.9640405774116516,
"fineweb_edu_approx": 2.2034003734588623,
"eai_general_math": 0.6876085996627808,
"eai_open_web_math": 0.20681703090667725,
"eai_web_code": 0.3226279020309448
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.822",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "4",
"label": "Analyze"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,391,047,379,618,932,000 |
Prevent User from Deleting Spool Files
65 pts.
Tags:
AS/400 Spooled Files
OS/400
Hi, If a user has *SPLCTL authority in their User Profile is it possible to prevent that User Profile from deleting spool files without removing that authority?
Thanks
John.
Software/Hardware used:
AS400 OS400
ASKED: February 24, 2010 12:09 PM
UPDATED: February 24, 2010 10:05 PM
Answer Wiki
Thanks. We'll let you know when a new response is added.
splctl is to view others splfile….but to delete you need higher authority
=========================================================
From the Security Reference:<ul>
<li>*SPLCTL Special Authority
Spool control (*SPLCTL) special authority allows the user to perform all spool control functions, such as changing, deleting, displaying, holding and releasing spooled files. The user can perform these functions on all output queues, regardless of any authorities for the output queue or the OPRCTL parameter for the output queue. Chapter 4. User Profiles 67
*SPLCTL special authority also allows the user to manage job queues, including holding, releasing, and clearing the job queue. The user can perform these functions on all job queues, regardless of any authorities for the job queue or the OPRCTL parameter for the job queue.
<b>Risks:</b> <i>The user with *SPLCTL special authority can perform any operation on any spooled file in the system. Confidential spooled files cannot be protected from a user with *SPLCTL special authority.</i></li>
</ul>
The only way to control a user with *SPLCTL is to ensure that no command is available that allows access to jobs or spooled files.
It doesn’t matter if the output queue or the output queue library authorities lock everyone out nor what the outq attributes are. It doesn’t matter if the owner of the spooled file is *ALLOBJ. A *SPLCTL user can still access and delete the spooled files as long as there is access to commands such as WRKSLPF.
Special authorities are called “special” because they override all other authorities within their scope.
Tom
Discuss This Question: 5 Replies
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
REGISTER or login:
Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
• Jkbritvic
I have run some tests and found that a User ID with *SPLCTL only, can delete spool files created by their own User ID, but not others. Is there any other way to prevent a specific User ID from deleting their own spool files or a particular spoo file?
65 pointsBadges:
report
• jinteik
if you dont have *splctl you can even delete your own spool file and not others. question is can this user delete spool file? is he running on command line?
16,930 pointsBadges:
report
• Whatis23
If the user has *SPLCTL, the user can perform any operation on their own spool files. The only way to prevent that is to remove that special authority.
5,665 pointsBadges:
report
• TomLiotta
I have run some tests and found that a User ID with *SPLCTL only, can delete spool files created by their own User ID, but not others. Have your *SPLCTL user run WRKSPLF SELECT(<otherUser>) to see if the other user's spooled files are available or not. That's usually the most direct route. Other routes are available, but that should be enough to demonstrate *SPLCTL power. Tom
125,585 pointsBadges:
report
• TomLiotta
If the user has *SPLCTL, the user can perform any operation on their own spool files. A user doesn't need *SPLCTL to control their own spooled files. *SPLCTL is for control of all spooled files regardless of owner. Tom
125,585 pointsBadges:
report
Forgot Password
No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.
Your password has been sent to:
To follow this tag...
There was an error processing your information. Please try again later.
REGISTER or login:
Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Thanks! We'll email you when relevant content is added and updated.
Following
|
{
"url": "http://itknowledgeexchange.techtarget.com/itanswers/prevent-user-from-deleting-spool-files/",
"source_domain": "itknowledgeexchange.techtarget.com",
"snapshot_id": "crawl=CC-MAIN-2014-15",
"warc_metadata": {
"Content-Length": "84213",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:T7PEQ42IUL7PDW627CPVOIQBVKMVQQ3C",
"WARC-Concurrent-To": "<urn:uuid:654a2423-323e-4443-816a-1d7f2e806b30>",
"WARC-Date": "2014-04-17T18:09:15Z",
"WARC-IP-Address": "206.19.49.161",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:P53NU2UCJFUEZR4MHBZAM2N63Z6SGUB2",
"WARC-Record-ID": "<urn:uuid:87bf3470-a2ec-406a-ba17-70043096684a>",
"WARC-Target-URI": "http://itknowledgeexchange.techtarget.com/itanswers/prevent-user-from-deleting-spool-files/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:cb47e990-7c48-4a64-a35f-c1413596d728>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-147-4-33.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2014-15\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for April 2014\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
39,
40,
48,
54,
75,
82,
243,
244,
251,
252,
258,
259,
261,
262,
263,
264,
288,
300,
335,
372,
373,
385,
386,
443,
444,
518,
519,
577,
578,
611,
641,
1000,
1274,
1492,
1498,
1629,
1630,
1940,
1941,
2046,
2047,
2051,
2052,
2086,
2087,
2089,
2161,
2218,
2287,
2288,
2307,
2308,
2325,
2544,
2558,
2813,
2834,
2845,
2857,
3018,
3043,
3054,
3067,
3223,
3247,
3258,
3272,
3655,
3681,
3692,
3706,
3929,
3955,
3966,
3967,
3983,
3984,
4081,
4082,
4114,
4115,
4137,
4138,
4210,
4211,
4230,
4231,
4248,
4467,
4468,
4536,
4537
],
"line_end_idx": [
39,
40,
48,
54,
75,
82,
243,
244,
251,
252,
258,
259,
261,
262,
263,
264,
288,
300,
335,
372,
373,
385,
386,
443,
444,
518,
519,
577,
578,
611,
641,
1000,
1274,
1492,
1498,
1629,
1630,
1940,
1941,
2046,
2047,
2051,
2052,
2086,
2087,
2089,
2161,
2218,
2287,
2288,
2307,
2308,
2325,
2544,
2558,
2813,
2834,
2845,
2857,
3018,
3043,
3054,
3067,
3223,
3247,
3258,
3272,
3655,
3681,
3692,
3706,
3929,
3955,
3966,
3967,
3983,
3984,
4081,
4082,
4114,
4115,
4137,
4138,
4210,
4211,
4230,
4231,
4248,
4467,
4468,
4536,
4537,
4546
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4546,
"ccnet_original_nlines": 92,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3627232015132904,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0457589291036129,
"rps_doc_frac_lines_end_with_ellipsis": 0.010752690024673939,
"rps_doc_frac_no_alph_words": 0.1897321343421936,
"rps_doc_frac_unique_words": 0.3351724147796631,
"rps_doc_mean_word_length": 4.838620662689209,
"rps_doc_num_sentences": 52,
"rps_doc_symbol_to_word_ratio": 0.002232139930129051,
"rps_doc_unigram_entropy": 5.030670166015625,
"rps_doc_word_count": 725,
"rps_doc_frac_chars_dupe_10grams": 0.27480044960975647,
"rps_doc_frac_chars_dupe_5grams": 0.3591790199279785,
"rps_doc_frac_chars_dupe_6grams": 0.33466362953186035,
"rps_doc_frac_chars_dupe_7grams": 0.33466362953186035,
"rps_doc_frac_chars_dupe_8grams": 0.29532498121261597,
"rps_doc_frac_chars_dupe_9grams": 0.27480044960975647,
"rps_doc_frac_chars_top_2gram": 0.027366019785404205,
"rps_doc_frac_chars_top_3gram": 0.011402510106563568,
"rps_doc_frac_chars_top_4gram": 0.01938425935804844,
"rps_doc_books_importance": -418.2569885253906,
"rps_doc_books_importance_length_correction": -418.2569885253906,
"rps_doc_openwebtext_importance": -213.39111328125,
"rps_doc_openwebtext_importance_length_correction": -213.39111328125,
"rps_doc_wikipedia_importance": -174.04083251953125,
"rps_doc_wikipedia_importance_length_correction": -174.04083251953125
},
"fasttext": {
"dclm": 0.03387070074677467,
"english": 0.9306819438934326,
"fineweb_edu_approx": 1.7483407258987427,
"eai_general_math": 0.012247920036315918,
"eai_open_web_math": 0.1100914478302002,
"eai_web_code": 0.047982629388570786
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.162",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
162,141,195,755,234,020 |
What are backlinks and why are they important?
For most small businesses getting a steady stream of new customer enquiries through their website means getting onto the first page of Google’s search results. Although there’s no guaranteed way of doing this good quality content and backlinks can certainly help.
What are backlinks and why are they important?
Backlinks are simply links back to your website from other people’s websites.
Backlinks tell search engines that your website is important and they help to improve your site’s credibility and search engine ranking. However, backlinks only really help if they are placed on good quality websites that are in some way related to what you do.
Backlinks from large, reliable and trusted websites are the most valuable kind so you should focus your efforts on getting backlinks from these types of sites. Websites near the top of Google are likely to be high quality.
So let’s look at some common types of backlinks and how to get them.
Writing your link
When it comes to writing your link pay attention to the anchor text. Don’t just write a link that says ‘read here’ or ‘click here’. Ideally, you should include one or two of your main keywords in your link’s anchor text.
For example ‘Interior design solutions’ would work well as a link. It tells the search engines very clearly what kind of site the link will go to. If you put a location in there as well ‘Interior design solutions in Stockport’ it can go some way to helping with local searches.
|
{
"url": "https://johnrobinsondesigner.co.uk/blog/2017-02-14-what-are-backlinks-and-why-are-they-important/",
"source_domain": "johnrobinsondesigner.co.uk",
"snapshot_id": "crawl=CC-MAIN-2019-18",
"warc_metadata": {
"Content-Length": "17671",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:QBYQN7UFUV53XK3IXTN52TWLLRGCOST6",
"WARC-Concurrent-To": "<urn:uuid:ebae92eb-4202-48b1-ac46-f77af961acfc>",
"WARC-Date": "2019-04-23T16:01:21Z",
"WARC-IP-Address": "85.233.160.143",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:42PZJ5RPJXEPQPNIJNVSZ7BHQCVRIQQF",
"WARC-Record-ID": "<urn:uuid:895c7739-f21f-4874-b162-3cc2fa793acb>",
"WARC-Target-URI": "https://johnrobinsondesigner.co.uk/blog/2017-02-14-what-are-backlinks-and-why-are-they-important/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:a99c4bd7-f7c8-4a81-8de9-bde1a6688a8b>"
},
"warc_info": "isPartOf: CC-MAIN-2019-18\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for April 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-165-178-231.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
47,
48,
312,
313,
360,
361,
439,
440,
702,
703,
926,
927,
996,
997,
1015,
1016,
1237,
1238
],
"line_end_idx": [
47,
48,
312,
313,
360,
361,
439,
440,
702,
703,
926,
927,
996,
997,
1015,
1016,
1237,
1238,
1515
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1515,
"ccnet_original_nlines": 18,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.5099999904632568,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.10999999940395355,
"rps_doc_frac_unique_words": 0.5538461208343506,
"rps_doc_mean_word_length": 4.723076820373535,
"rps_doc_num_sentences": 16,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.686495780944824,
"rps_doc_word_count": 260,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.061889249831438065,
"rps_doc_frac_chars_dupe_6grams": 0.061889249831438065,
"rps_doc_frac_chars_dupe_7grams": 0.061889249831438065,
"rps_doc_frac_chars_dupe_8grams": 0.061889249831438065,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.02931595966219902,
"rps_doc_frac_chars_top_3gram": 0.026058629155158997,
"rps_doc_frac_chars_top_4gram": 0.03094463050365448,
"rps_doc_books_importance": -139.26885986328125,
"rps_doc_books_importance_length_correction": -129.21182250976562,
"rps_doc_openwebtext_importance": -73.6067123413086,
"rps_doc_openwebtext_importance_length_correction": -73.6067123413086,
"rps_doc_wikipedia_importance": -62.050315856933594,
"rps_doc_wikipedia_importance_length_correction": -49.503379821777344
},
"fasttext": {
"dclm": 0.09465116262435913,
"english": 0.9565946459770203,
"fineweb_edu_approx": 1.807059407234192,
"eai_general_math": 0.07661598920822144,
"eai_open_web_math": 0.21699243783950806,
"eai_web_code": 0.07138603925704956
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "658.8",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-711,028,076,049,040,600 |
Home · All Classes · All Functions · Overviews
QAbstractItemView Class Reference
[QtGui module]
The QAbstractItemView class provides the basic functionality for item view classes. More...
#include <QAbstractItemView>
Inherits QAbstractScrollArea.
Inherited by QColumnView, QHeaderView, QListView, QTableView, and QTreeView.
Public Types
enum DragDropMode { NoDragDrop, DragOnly, DropOnly, DragDrop, InternalMove }
enum EditTrigger { NoEditTriggers, CurrentChanged, DoubleClicked, SelectedClicked, ..., AllEditTriggers }
flags EditTriggers
enum ScrollHint { EnsureVisible, PositionAtTop, PositionAtBottom, PositionAtCenter }
enum ScrollMode { ScrollPerItem, ScrollPerPixel }
enum SelectionBehavior { SelectItems, SelectRows, SelectColumns }
enum SelectionMode { SingleSelection, ContiguousSelection, ExtendedSelection, MultiSelection, NoSelection }
Properties
Public Functions
QAbstractItemView ( QWidget * parent = 0 )
~QAbstractItemView ()
bool alternatingRowColors () const
int autoScrollMargin () const
void closePersistentEditor ( const QModelIndex & index )
QModelIndex currentIndex () const
Qt::DropAction defaultDropAction () const
DragDropMode dragDropMode () const
bool dragDropOverwriteMode () const
bool dragEnabled () const
EditTriggers editTriggers () const
bool hasAutoScroll () const
ScrollMode horizontalScrollMode () const
QSize iconSize () const
virtual QModelIndex indexAt ( const QPoint & point ) const = 0
QWidget * indexWidget ( const QModelIndex & index ) const
QAbstractItemDelegate * itemDelegate () const
QAbstractItemDelegate * itemDelegate ( const QModelIndex & index ) const
QAbstractItemDelegate * itemDelegateForColumn ( int column ) const
QAbstractItemDelegate * itemDelegateForRow ( int row ) const
virtual void keyboardSearch ( const QString & search )
QAbstractItemModel * model () const
void openPersistentEditor ( const QModelIndex & index )
QModelIndex rootIndex () const
virtual void scrollTo ( const QModelIndex & index, ScrollHint hint = EnsureVisible ) = 0
QAbstractItemView::SelectionBehavior selectionBehavior () const
QAbstractItemView::SelectionMode selectionMode () const
QItemSelectionModel * selectionModel () const
void setAlternatingRowColors ( bool enable )
void setAutoScroll ( bool enable )
void setAutoScrollMargin ( int margin )
void setDefaultDropAction ( Qt::DropAction dropAction )
void setDragDropMode ( DragDropMode behavior )
void setDragDropOverwriteMode ( bool overwrite )
void setDragEnabled ( bool enable )
void setDropIndicatorShown ( bool enable )
void setEditTriggers ( EditTriggers triggers )
void setHorizontalScrollMode ( ScrollMode mode )
void setIconSize ( const QSize & size )
void setIndexWidget ( const QModelIndex & index, QWidget * widget )
void setItemDelegate ( QAbstractItemDelegate * delegate )
void setItemDelegateForColumn ( int column, QAbstractItemDelegate * delegate )
void setItemDelegateForRow ( int row, QAbstractItemDelegate * delegate )
virtual void setModel ( QAbstractItemModel * model )
void setSelectionBehavior ( QAbstractItemView::SelectionBehavior behavior )
void setSelectionMode ( QAbstractItemView::SelectionMode mode )
virtual void setSelectionModel ( QItemSelectionModel * selectionModel )
void setTabKeyNavigation ( bool enable )
void setTextElideMode ( Qt::TextElideMode mode )
void setVerticalScrollMode ( ScrollMode mode )
bool showDropIndicator () const
virtual int sizeHintForColumn ( int column ) const
QSize sizeHintForIndex ( const QModelIndex & index ) const
virtual int sizeHintForRow ( int row ) const
bool tabKeyNavigation () const
Qt::TextElideMode textElideMode () const
ScrollMode verticalScrollMode () const
virtual QRect visualRect ( const QModelIndex & index ) const = 0
Reimplemented Public Functions
virtual QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const
Public Slots
void clearSelection ()
void edit ( const QModelIndex & index )
virtual void reset ()
void scrollToBottom ()
void scrollToTop ()
virtual void selectAll ()
void setCurrentIndex ( const QModelIndex & index )
virtual void setRootIndex ( const QModelIndex & index )
void update ( const QModelIndex & index )
Signals
void activated ( const QModelIndex & index )
void clicked ( const QModelIndex & index )
void doubleClicked ( const QModelIndex & index )
void entered ( const QModelIndex & index )
void pressed ( const QModelIndex & index )
void viewportEntered ()
Protected Types
enum CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, ..., MovePrevious }
enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport }
enum State { NoState, DraggingState, DragSelectingState, EditingState, ..., AnimatingState }
Protected Functions
QPoint dirtyRegionOffset () const
DropIndicatorPosition dropIndicatorPosition () const
virtual bool edit ( const QModelIndex & index, EditTrigger trigger, QEvent * event )
void executeDelayedItemsLayout ()
virtual int horizontalOffset () const = 0
virtual bool isIndexHidden ( const QModelIndex & index ) const = 0
virtual QModelIndex moveCursor ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) = 0
void scheduleDelayedItemsLayout ()
void scrollDirtyRegion ( int dx, int dy )
virtual QModelIndexList selectedIndexes () const
virtual QItemSelectionModel::SelectionFlags selectionCommand ( const QModelIndex & index, const QEvent * event = 0 ) const
void setDirtyRegion ( const QRegion & region )
virtual void setSelection ( const QRect & rect, QItemSelectionModel::SelectionFlags flags ) = 0
void setState ( State state )
virtual void startDrag ( Qt::DropActions supportedActions )
State state () const
virtual int verticalOffset () const = 0
virtual QStyleOptionViewItem viewOptions () const
virtual QRegion visualRegionForSelection ( const QItemSelection & selection ) const = 0
Reimplemented Protected Functions
virtual void dragEnterEvent ( QDragEnterEvent * event )
virtual void dragLeaveEvent ( QDragLeaveEvent * event )
virtual void dragMoveEvent ( QDragMoveEvent * event )
virtual void dropEvent ( QDropEvent * event )
virtual bool event ( QEvent * event )
virtual void focusInEvent ( QFocusEvent * event )
virtual bool focusNextPrevChild ( bool next )
virtual void focusOutEvent ( QFocusEvent * event )
virtual void inputMethodEvent ( QInputMethodEvent * event )
virtual void keyPressEvent ( QKeyEvent * event )
virtual void mouseDoubleClickEvent ( QMouseEvent * event )
virtual void mouseMoveEvent ( QMouseEvent * event )
virtual void mousePressEvent ( QMouseEvent * event )
virtual void mouseReleaseEvent ( QMouseEvent * event )
virtual void resizeEvent ( QResizeEvent * event )
virtual void timerEvent ( QTimerEvent * event )
virtual bool viewportEvent ( QEvent * event )
Protected Slots
virtual void closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint )
virtual void commitData ( QWidget * editor )
virtual void currentChanged ( const QModelIndex & current, const QModelIndex & previous )
virtual void dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight )
virtual void editorDestroyed ( QObject * editor )
virtual void rowsAboutToBeRemoved ( const QModelIndex & parent, int start, int end )
virtual void rowsInserted ( const QModelIndex & parent, int start, int end )
virtual void selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected )
virtual void updateGeometries ()
Additional Inherited Members
Detailed Description
The QAbstractItemView class provides the basic functionality for item view classes.
QAbstractItemView class is the base class for every standard view that uses a QAbstractItemModel. QAbstractItemView is an abstract class and cannot itself be instantiated. It provides a standard interface for interoperating with models through the signals and slots mechanism, enabling subclasses to be kept up-to-date with changes to their models. This class provides standard support for keyboard and mouse navigation, viewport scrolling, item editing, and selections. The keyboard navigation implements this functionality:
KeysFunctionality
Arrow keysChanges the current item and selects it.
Ctrl+Arrow keysChanges the current item but does not select it.
Shift+Arrow keysChanges the current item and selects it. The previously selected item(s) is not deselected.
Ctr+SpaceToggles selection of the current item.
Tab/BacktabChanges the current item to the next/previous item.
Home/EndSelects the first/last item in the model.
Page up/Page downScrolls the rows shown up/down by the number of visible rows in the view.
Ctrl+ASelects all items in the model.
Note that the above table assumes that the selection mode allows the operations. For instance, you cannot select items if the selection mode is QAbstractItemView::NoSelection.
The QAbstractItemView class is one of the Model/View Classes and is part of Qt's model/view framework.
The view classes that inherit QAbstractItemView only need to implement their own view-specific functionality, such as drawing items, returning the geometry of items, finding items, etc.
QAbstractItemView provides common slots such as edit() and setCurrentIndex(). Many protected slots are also provided, including dataChanged(), rowsInserted(), rowsAboutToBeRemoved(), selectionChanged(), and currentChanged().
The root item is returned by rootIndex(), and the current item by currentIndex(). To make sure that an item is visible use scrollTo().
Some of QAbstractItemView's functions are concerned with scrolling, for example setHorizontalScrollMode() and setVerticalScrollMode(). To set the range of the scroll bars, you can, for example, reimplement the view's resizeEvent() function:
void MyView::resizeEvent(QResizeEvent *event) {
horizontalScrollBar()->setRange(0, realWidth - width());
...
}
Note that the range is not updated until the widget is shown.
Several other functions are concerned with selection control; for example setSelectionMode(), and setSelectionBehavior(). This class provides a default selection model to work with (selectionModel()), but this can be replaced by using setSelectionModel() with an instance of QItemSelectionModel.
For complete control over the display and editing of items you can specify a delegate with setItemDelegate().
QAbstractItemView provides a lot of protected functions. Some are concerned with editing, for example, edit(), and commitData(), whilst others are keyboard and mouse event handlers.
Note: If you inherit QAbstractItemView and intend to update the contents of the viewport, you should use viewport->update() instead of update() as all painting operations take place on the viewport.
See also View Classes, Model/View Programming, QAbstractItemModel, and Chart Example.
Member Type Documentation
enum QAbstractItemView::CursorAction
This enum describes the different ways to navigate between items,
ConstantValueDescription
QAbstractItemView::MoveUp0Move to the item above the current item.
QAbstractItemView::MoveDown1Move to the item below the current item.
QAbstractItemView::MoveLeft2Move to the item left of the current item.
QAbstractItemView::MoveRight3Move to the item right of the current item.
QAbstractItemView::MoveHome4Move to the top-left corner item.
QAbstractItemView::MoveEnd5Move to the bottom-right corner item.
QAbstractItemView::MovePageUp6Move one page up above the current item.
QAbstractItemView::MovePageDown7Move one page down below the current item.
QAbstractItemView::MoveNext8Move to the item after the current item.
QAbstractItemView::MovePrevious9Move to the item before the current item.
See also moveCursor().
enum QAbstractItemView::DragDropMode
Describes the various drag and drop events the view can act upon. By default the view does not support dragging or dropping (NoDragDrop).
ConstantValueDescription
QAbstractItemView::NoDragDrop0Does not support dragging or dropping.
QAbstractItemView::DragOnly1The view supports dragging of its own items
QAbstractItemView::DropOnly2The view accepts drops
QAbstractItemView::DragDrop3The view supports both dragging and dropping
QAbstractItemView::InternalMove4The view accepts move (not copy) operations only from itself.
Note that the model used needs to provide support for drag and drop operations.
This enum was introduced in Qt 4.2.
See also setDragDropMode() and Using Drag and Drop with Item Views.
enum QAbstractItemView::DropIndicatorPosition
This enum indicates the position of the drop indicator in relation to the index at the current mouse position:
ConstantValueDescription
QAbstractItemView::OnItem0The item will be dropped on the index.
QAbstractItemView::AboveItem1The item will be dropped above the index.
QAbstractItemView::BelowItem2The item will be dropped below the index.
QAbstractItemView::OnViewport3The item will be dropped onto a region of the viewport with no items. The way each view handles items dropped onto the viewport depends on the behavior of the underlying model in use.
enum QAbstractItemView::EditTrigger
flags QAbstractItemView::EditTriggers
This enum describes actions which will initiate item editing.
ConstantValueDescription
QAbstractItemView::NoEditTriggers0No editing possible.
QAbstractItemView::CurrentChanged1Editing start whenever current item changes.
QAbstractItemView::DoubleClicked2Editing starts when an item is double clicked.
QAbstractItemView::SelectedClicked4Editing starts when clicking on an already selected item.
QAbstractItemView::EditKeyPressed8Editing starts when the platform edit key has been pressed over an item.
QAbstractItemView::AnyKeyPressed16Editing starts when any key is pressed over an item.
QAbstractItemView::AllEditTriggers31Editing starts for all above actions.
The EditTriggers type is a typedef for QFlags<EditTrigger>. It stores an OR combination of EditTrigger values.
enum QAbstractItemView::ScrollHint
ConstantValueDescription
QAbstractItemView::EnsureVisible0Scroll to ensure that the item is visible.
QAbstractItemView::PositionAtTop1Scroll to position the item at the top of the viewport.
QAbstractItemView::PositionAtBottom2Scroll to position the item at the bottom of the viewport.
QAbstractItemView::PositionAtCenter3Scroll to position the item at the center of the viewport.
enum QAbstractItemView::ScrollMode
ConstantValueDescription
QAbstractItemView::ScrollPerItem0The view will scroll the contents one item at a time.
QAbstractItemView::ScrollPerPixel1The view will scroll the contents one pixel at a time.
This enum was introduced in Qt 4.2.
enum QAbstractItemView::SelectionBehavior
ConstantValueDescription
QAbstractItemView::SelectItems0Selecting single items.
QAbstractItemView::SelectRows1Selecting only rows.
QAbstractItemView::SelectColumns2Selecting only columns.
enum QAbstractItemView::SelectionMode
This enum indicates how the view responds to user selections:
ConstantValueDescription
QAbstractItemView::SingleSelection1When the user selects an item, any already-selected item becomes unselected, and the user cannot unselect the selected item by clicking on it.
QAbstractItemView::ContiguousSelection4When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item.
QAbstractItemView::ExtendedSelection3When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them.
QAbstractItemView::MultiSelection2When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone. Multiple items can be toggled by dragging the mouse over them.
QAbstractItemView::NoSelection0Items cannot be selected.
The most commonly used modes are SingleSelection and ExtendedSelection.
enum QAbstractItemView::State
Describes the different states the view can be in. This is usually only interesting when reimplementing your own view.
ConstantValueDescription
QAbstractItemView::NoState0The is the default state.
QAbstractItemView::DraggingState1The user is dragging items.
QAbstractItemView::DragSelectingState2The user is selecting items.
QAbstractItemView::EditingState3The user is editing an item in a widget editor.
QAbstractItemView::ExpandingState4The user is opening a branch of items.
QAbstractItemView::CollapsingState5The user is closing a branch of items.
QAbstractItemView::AnimatingState6The item view is performing an animation.
Property Documentation
alternatingRowColors : bool
This property holds whether to draw the background using alternating colors.
If this property is true, the item background will be drawn using QPalette::Base and QPalette::AlternateBase; otherwise the background will be drawn using the QPalette::Base color.
By default, this property is false.
Access functions:
bool alternatingRowColors () const
void setAlternatingRowColors ( bool enable )
autoScroll : bool
This property holds whether autoscrolling in drag move events is enabled.
If this property is set to true (the default), the QAbstractItemView automatically scrolls the contents of the view if the user drags within 16 pixels of the viewport edge. If the current item changes, then the view will scroll automatically to ensure that the current item is fully visible.
This property only works if the viewport accepts drops. Autoscroll is switched off by setting this property to false.
Access functions:
bool hasAutoScroll () const
void setAutoScroll ( bool enable )
autoScrollMargin : int
This property holds the size of the area when auto scrolling is triggered.
This property controlls the size of the area at the edge of the viewport that triggers autoscrolling. The default value is 16 pixels.
This property was introduced in Qt 4.4.
Access functions:
int autoScrollMargin () const
void setAutoScrollMargin ( int margin )
defaultDropAction : Qt::DropAction
This property holds the drop action that will be used by default in QAbstractItemView::drag().
If the property is not set, the drop action is CopyAction when the supported actions support CopyAction.
This property was introduced in Qt 4.6.
Access functions:
Qt::DropAction defaultDropAction () const
void setDefaultDropAction ( Qt::DropAction dropAction )
See also showDropIndicator and dragDropOverwriteMode.
dragDropMode : DragDropMode
This property holds the drag and drop event the view will act upon.
This property was introduced in Qt 4.2.
Access functions:
DragDropMode dragDropMode () const
void setDragDropMode ( DragDropMode behavior )
See also showDropIndicator and dragDropOverwriteMode.
dragDropOverwriteMode : bool
This property holds the view's drag and drop behavior.
If its value is true, the selected data will overwrite the existing item data when dropped, while moving the data will clear the item. If its value is false, the selected data will be inserted as a new item when the data is dropped. When the data is moved, the item is removed as well.
The default value is false, as in the QListView and QTreeView subclasses. In the QTableView subclass, on the other hand, the property has been set to true.
Note: This is not intended to prevent overwriting of items. The model's implementation of flags() should do that by not returning Qt::ItemIsDropEnabled.
This property was introduced in Qt 4.2.
Access functions:
bool dragDropOverwriteMode () const
void setDragDropOverwriteMode ( bool overwrite )
See also dragDropMode.
dragEnabled : bool
This property holds whether the view supports dragging of its own items.
Access functions:
bool dragEnabled () const
void setDragEnabled ( bool enable )
See also showDropIndicator, DragDropMode, dragDropOverwriteMode, and acceptDrops.
editTriggers : EditTriggers
This property holds which actions will initiate item editing.
This property is a selection of flags defined by EditTrigger, combined using the OR operator. The view will only initiate the editing of an item if the action performed is set in this property.
Access functions:
EditTriggers editTriggers () const
void setEditTriggers ( EditTriggers triggers )
horizontalScrollMode : ScrollMode
This property holds how the view scrolls its contents in the horizontal direction.
This property controlls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item.
This property was introduced in Qt 4.2.
Access functions:
ScrollMode horizontalScrollMode () const
void setHorizontalScrollMode ( ScrollMode mode )
iconSize : QSize
This property holds the size of items' icons.
Setting this property when the view is visible will cause the items to be laid out again.
Access functions:
QSize iconSize () const
void setIconSize ( const QSize & size )
selectionBehavior : SelectionBehavior
This property holds which selection behavior the view uses.
This property holds whether selections are done in terms of single items, rows or columns.
Access functions:
QAbstractItemView::SelectionBehavior selectionBehavior () const
void setSelectionBehavior ( QAbstractItemView::SelectionBehavior behavior )
See also SelectionMode and SelectionBehavior.
selectionMode : SelectionMode
This property holds which selection mode the view operates in.
This property controls whether the user can select one or many items and, in many-item selections, whether the selection must be a continuous range of items.
Access functions:
QAbstractItemView::SelectionMode selectionMode () const
void setSelectionMode ( QAbstractItemView::SelectionMode mode )
See also SelectionMode and SelectionBehavior.
showDropIndicator : bool
This property holds whether the drop indicator is shown when dragging items and dropping.
Access functions:
bool showDropIndicator () const
void setDropIndicatorShown ( bool enable )
See also dragEnabled, DragDropMode, dragDropOverwriteMode, and acceptDrops.
tabKeyNavigation : bool
This property holds whether item navigation with tab and backtab is enabled.
Access functions:
bool tabKeyNavigation () const
void setTabKeyNavigation ( bool enable )
textElideMode : Qt::TextElideMode
This property holds the position of the "..." in elided text.
The default value for all item views is Qt::ElideRight.
Access functions:
Qt::TextElideMode textElideMode () const
void setTextElideMode ( Qt::TextElideMode mode )
verticalScrollMode : ScrollMode
This property holds how the view scrolls its contents in the vertical direction.
This property controlls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item.
This property was introduced in Qt 4.2.
Access functions:
ScrollMode verticalScrollMode () const
void setVerticalScrollMode ( ScrollMode mode )
Member Function Documentation
QAbstractItemView::QAbstractItemView ( QWidget * parent = 0 )
Constructs an abstract item view with the given parent.
QAbstractItemView::~QAbstractItemView ()
Destroys the view.
void QAbstractItemView::activated ( const QModelIndex & index ) [signal]
This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.
See also clicked(), doubleClicked(), entered(), and pressed().
void QAbstractItemView::clearSelection () [slot]
Deselects all selected items. The current index will not be changed.
See also setSelection() and selectAll().
void QAbstractItemView::clicked ( const QModelIndex & index ) [signal]
This signal is emitted when a mouse button is clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.
See also activated(), doubleClicked(), entered(), and pressed().
void QAbstractItemView::closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ) [virtual protected slot]
Closes the given editor, and releases it. The hint is used to specify how the view should respond to the end of the editing operation. For example, the hint may indicate that the next item in the view should be opened for editing.
See also edit() and commitData().
void QAbstractItemView::closePersistentEditor ( const QModelIndex & index )
Closes the persistent editor for the item at the given index.
See also openPersistentEditor().
void QAbstractItemView::commitData ( QWidget * editor ) [virtual protected slot]
Commit the data in the editor to the model.
See also closeEditor().
void QAbstractItemView::currentChanged ( const QModelIndex & current, const QModelIndex & previous ) [virtual protected slot]
This slot is called when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.
If you want to know about changes to items see the dataChanged() signal.
QModelIndex QAbstractItemView::currentIndex () const
Returns the model index of the current item.
See also setCurrentIndex().
void QAbstractItemView::dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) [virtual protected slot]
This slot is called when items are changed in the model. The changed items are those from topLeft to bottomRight inclusive. If just one item is changed topLeft == bottomRight.
QPoint QAbstractItemView::dirtyRegionOffset () const [protected]
Returns the offset of the dirty regions in the view.
If you use scrollDirtyRegion() and implement a paintEvent() in a subclass of QAbstractItemView, you should translate the area given by the paint event with the offset returned from this function.
See also scrollDirtyRegion() and setDirtyRegion().
void QAbstractItemView::doubleClicked ( const QModelIndex & index ) [signal]
This signal is emitted when a mouse button is double-clicked. The item the mouse was double-clicked on is specified by index. The signal is only emitted when the index is valid.
See also clicked() and activated().
void QAbstractItemView::dragEnterEvent ( QDragEnterEvent * event ) [virtual protected]
Reimplemented from QWidget::dragEnterEvent().
This function is called with the given event when a drag and drop operation enters the widget. If the drag is over a valid dropping place (e.g. over an item that accepts drops), the event is accepted; otherwise it is ignored.
See also dropEvent() and startDrag().
void QAbstractItemView::dragLeaveEvent ( QDragLeaveEvent * event ) [virtual protected]
Reimplemented from QWidget::dragLeaveEvent().
This function is called when the item being dragged leaves the view. The event describes the state of the drag and drop operation.
void QAbstractItemView::dragMoveEvent ( QDragMoveEvent * event ) [virtual protected]
Reimplemented from QWidget::dragMoveEvent().
This function is called continuously with the given event during a drag and drop operation over the widget. It can cause the view to scroll if, for example, the user drags a selection to view's right or bottom edge. In this case, the event will be accepted; otherwise it will be ignored.
See also dropEvent() and startDrag().
void QAbstractItemView::dropEvent ( QDropEvent * event ) [virtual protected]
Reimplemented from QWidget::dropEvent().
This function is called with the given event when a drop event occurs over the widget. If the model accepts the even position the drop event is accepted; otherwise it is ignored.
See also startDrag().
DropIndicatorPosition QAbstractItemView::dropIndicatorPosition () const [protected]
Returns the position of the drop indicator in relation to the closest item.
This function was introduced in Qt 4.1.
void QAbstractItemView::edit ( const QModelIndex & index ) [slot]
Starts editing the item corresponding to the given index if it is editable.
Note that this function does not change the current index. Since the current index defines the next and previous items to edit, users may find that keyboard navigation does not work as expected. To provide consistent navigation behavior, call setCurrentIndex() before this function with the same model index.
See also QModelIndex::flags().
bool QAbstractItemView::edit ( const QModelIndex & index, EditTrigger trigger, QEvent * event ) [virtual protected]
Starts editing the item at index, creating an editor if necessary, and returns true if the view's State is now EditingState; otherwise returns false.
The action that caused the editing process is described by trigger, and the associated event is specified by event.
Editing can be forced by specifying the trigger to be QAbstractItemView::AllEditTriggers.
See also closeEditor().
void QAbstractItemView::editorDestroyed ( QObject * editor ) [virtual protected slot]
This function is called when the given editor has been destroyed.
See also closeEditor().
void QAbstractItemView::entered ( const QModelIndex & index ) [signal]
This signal is emitted when the mouse cursor enters the item specified by index. Mouse tracking needs to be enabled for this feature to work.
See also viewportEntered(), activated(), clicked(), doubleClicked(), and pressed().
bool QAbstractItemView::event ( QEvent * event ) [virtual protected]
Reimplemented from QObject::event().
void QAbstractItemView::executeDelayedItemsLayout () [protected]
Executes the scheduled layouts without waiting for the event processing to begin.
See also scheduleDelayedItemsLayout().
void QAbstractItemView::focusInEvent ( QFocusEvent * event ) [virtual protected]
Reimplemented from QWidget::focusInEvent().
This function is called with the given event when the widget obtains the focus. By default, the event is ignored.
See also setFocus() and focusOutEvent().
bool QAbstractItemView::focusNextPrevChild ( bool next ) [virtual protected]
Reimplemented from QWidget::focusNextPrevChild().
void QAbstractItemView::focusOutEvent ( QFocusEvent * event ) [virtual protected]
Reimplemented from QWidget::focusOutEvent().
This function is called with the given event when the widget looses the focus. By default, the event is ignored.
See also clearFocus() and focusInEvent().
int QAbstractItemView::horizontalOffset () const [pure virtual protected]
Returns the horizontal offset of the view.
In the base class this is a pure virtual function.
See also verticalOffset().
QModelIndex QAbstractItemView::indexAt ( const QPoint & point ) const [pure virtual]
Returns the model index of the item at the viewport coordinates point.
In the base class this is a pure virtual function.
See also visualRect().
QWidget * QAbstractItemView::indexWidget ( const QModelIndex & index ) const
Returns the widget for the item at the given index.
This function was introduced in Qt 4.1.
See also setIndexWidget().
void QAbstractItemView::inputMethodEvent ( QInputMethodEvent * event ) [virtual protected]
Reimplemented from QWidget::inputMethodEvent().
QVariant QAbstractItemView::inputMethodQuery ( Qt::InputMethodQuery query ) const [virtual]
Reimplemented from QWidget::inputMethodQuery().
bool QAbstractItemView::isIndexHidden ( const QModelIndex & index ) const [pure virtual protected]
Returns true if the item referred to by the given index is hidden in the view, otherwise returns false.
Hiding is a view specific feature. For example in TableView a column can be marked as hidden or a row in the TreeView.
In the base class this is a pure virtual function.
QAbstractItemDelegate * QAbstractItemView::itemDelegate () const
Returns the item delegate used by this view and model. This is either one set with setItemDelegate(), or the default one.
See also setItemDelegate().
QAbstractItemDelegate * QAbstractItemView::itemDelegate ( const QModelIndex & index ) const
Returns the item delegate used by this view and model for the given index.
QAbstractItemDelegate * QAbstractItemView::itemDelegateForColumn ( int column ) const
Returns the item delegate used by this view and model for the given column. You can call itemDelegate() to get a pointer to the current delegate for a given index.
This function was introduced in Qt 4.2.
See also setItemDelegateForColumn(), itemDelegateForRow(), and itemDelegate().
QAbstractItemDelegate * QAbstractItemView::itemDelegateForRow ( int row ) const
Returns the item delegate used by this view and model for the given row, or 0 if no delegate has been assigned. You can call itemDelegate() to get a pointer to the current delegate for a given index.
This function was introduced in Qt 4.2.
See also setItemDelegateForRow(), itemDelegateForColumn(), and setItemDelegate().
void QAbstractItemView::keyPressEvent ( QKeyEvent * event ) [virtual protected]
Reimplemented from QWidget::keyPressEvent().
This function is called with the given event when a key event is sent to the widget. The default implementation handles basic cursor movement, e.g. Up, Down, Left, Right, Home, PageUp, and PageDown; the activated() signal is emitted if the current index is valid and the activation key is pressed (e.g. Enter or Return, depending on the platform). This function is where editing is initiated by key press, e.g. if F2 is pressed.
See also edit(), moveCursor(), keyboardSearch(), and tabKeyNavigation.
void QAbstractItemView::keyboardSearch ( const QString & search ) [virtual]
Moves to and selects the item best matching the string search. If no item is found nothing happens.
In the default implementation, the search is reset if search is empty, or the time interval since the last search has exceeded QApplication::keyboardInputInterval().
QAbstractItemModel * QAbstractItemView::model () const
Returns the model that this view is presenting.
See also setModel().
void QAbstractItemView::mouseDoubleClickEvent ( QMouseEvent * event ) [virtual protected]
Reimplemented from QWidget::mouseDoubleClickEvent().
This function is called with the given event when a mouse button is double clicked inside the widget. If the double-click is on a valid item it emits the doubleClicked() signal and calls edit() on the item.
void QAbstractItemView::mouseMoveEvent ( QMouseEvent * event ) [virtual protected]
Reimplemented from QWidget::mouseMoveEvent().
This function is called with the given event when a mouse move event is sent to the widget. If a selection is in progress and new items are moved over the selection is extended; if a drag is in progress it is continued.
void QAbstractItemView::mousePressEvent ( QMouseEvent * event ) [virtual protected]
Reimplemented from QWidget::mousePressEvent().
This function is called with the given event when a mouse button is pressed while the cursor is inside the widget. If a valid item is pressed on it is made into the current item. This function emits the pressed() signal.
void QAbstractItemView::mouseReleaseEvent ( QMouseEvent * event ) [virtual protected]
Reimplemented from QWidget::mouseReleaseEvent().
This function is called with the given event when a mouse button is released, after a mouse press event on the widget. If a user presses the mouse inside your widget and then drags the mouse to another location before releasing the mouse button, your widget receives the release event. The function will emit the clicked() signal if an item was being pressed.
QModelIndex QAbstractItemView::moveCursor ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) [pure virtual protected]
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction and keyboard modifiers specified by modifiers.
In the base class this is a pure virtual function.
void QAbstractItemView::openPersistentEditor ( const QModelIndex & index )
Opens a persistent editor on the item at the given index. If no editor exists, the delegate will create a new editor.
See also closePersistentEditor().
void QAbstractItemView::pressed ( const QModelIndex & index ) [signal]
This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by index. The signal is only emitted when the index is valid.
Use the QApplication::mouseButtons() function to get the state of the mouse buttons.
See also activated(), clicked(), doubleClicked(), and entered().
void QAbstractItemView::reset () [virtual slot]
Reset the internal state of the view.
Warning: This function will reset open editors, scroll bar positions, selections, etc. Existing changes will not be committed. If you would like to save your changes when resetting the view, you can reimplement this function, commit your changes, and then call the superclass' implementation.
void QAbstractItemView::resizeEvent ( QResizeEvent * event ) [virtual protected]
Reimplemented from QWidget::resizeEvent().
This function is called with the given event when a resize event is sent to the widget.
See also QWidget::resizeEvent().
QModelIndex QAbstractItemView::rootIndex () const
Returns the model index of the model's root item. The root item is the parent item to the view's toplevel items. The root can be invalid.
See also setRootIndex().
void QAbstractItemView::rowsAboutToBeRemoved ( const QModelIndex & parent, int start, int end ) [virtual protected slot]
This slot is called when rows are about to be removed. The deleted rows are those under the given parent from start to end inclusive.
See also rowsInserted().
void QAbstractItemView::rowsInserted ( const QModelIndex & parent, int start, int end ) [virtual protected slot]
This slot is called when rows are inserted. The new rows are those under the given parent from start to end inclusive. The base class implementation calls fetchMore() on the model to check for more data.
See also rowsAboutToBeRemoved().
void QAbstractItemView::scheduleDelayedItemsLayout () [protected]
Schedules a layout of the items in the view to be executed when the event processing starts.
Even if scheduleDelayedItemsLayout() is called multiple times before events are processed, the view will only do the layout once.
See also executeDelayedItemsLayout().
void QAbstractItemView::scrollDirtyRegion ( int dx, int dy ) [protected]
Prepares the view for scrolling by (dx,dy) pixels by moving the dirty regions in the opposite direction. You only need to call this function if you are implementing a scrolling viewport in your view subclass.
If you implement scrollContentsBy() in a subclass of QAbstractItemView, call this function before you call QWidget::scroll() on the viewport. Alternatively, just call update().
See also scrollContentsBy(), dirtyRegionOffset(), and setDirtyRegion().
void QAbstractItemView::scrollTo ( const QModelIndex & index, ScrollHint hint = EnsureVisible ) [pure virtual]
Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.
In the base class this is a pure virtual function.
void QAbstractItemView::scrollToBottom () [slot]
Scrolls the view to the bottom.
This function was introduced in Qt 4.1.
See also scrollTo() and scrollToTop().
void QAbstractItemView::scrollToTop () [slot]
Scrolls the view to the top.
This function was introduced in Qt 4.1.
See also scrollTo() and scrollToBottom().
void QAbstractItemView::selectAll () [virtual slot]
Selects all items in the view. This function will use the selection behavior set on the view when selecting.
See also setSelection(), selectedIndexes(), and clearSelection().
QModelIndexList QAbstractItemView::selectedIndexes () const [virtual protected]
This convenience function returns a list of all selected and non-hidden item indexes in the view. The list contains no duplicates, and is not sorted.
See also QItemSelectionModel::selectedIndexes().
void QAbstractItemView::selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected ) [virtual protected slot]
This slot is called when the selection is changed. The previous selection (which may be empty), is specified by deselected, and the new selection by selected.
See also setSelection().
QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand ( const QModelIndex & index, const QEvent * event = 0 ) const [virtual protected]
Returns the SelectionFlags to be used when updating a selection with to include the index specified. The event is a user input event, such as a mouse or keyboard event.
Reimplement this function to define your own selection behavior.
See also setSelection().
QItemSelectionModel * QAbstractItemView::selectionModel () const
Returns the current selection model.
See also setSelectionModel() and selectedIndexes().
void QAbstractItemView::setCurrentIndex ( const QModelIndex & index ) [slot]
Sets the current item to be the item at index.
Unless the current selection mode is NoSelection, the item is also be selected. Note that this function also updates the starting position for any new selections the user performs.
To set an item as the current item without selecting it, call
selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
See also currentIndex(), currentChanged(), and selectionMode.
void QAbstractItemView::setDirtyRegion ( const QRegion & region ) [protected]
Marks the given region as dirty and schedules it to be updated. You only need to call this function if you are implementing your own view subclass.
This function was introduced in Qt 4.1.
See also scrollDirtyRegion() and dirtyRegionOffset().
void QAbstractItemView::setIndexWidget ( const QModelIndex & index, QWidget * widget )
Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport.
If index is invalid (e.g., if you pass the root index), this function will do nothing.
The given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the item at the given index.
If index widget A is replaced with index widget B, index widget A will be deleted. For example, in the code snippet below, the QLineEdit object will be deleted.
setIndexWidget(index, new QLineEdit);
...
setIndexWidget(index, new QTextEdit);
This function should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass QItemDelegate instead.
This function was introduced in Qt 4.1.
See also indexWidget() and Delegate Classes.
void QAbstractItemView::setItemDelegate ( QAbstractItemDelegate * delegate )
Sets the item delegate for this view and its model to delegate. This is useful if you want complete control over the editing and display of items.
Any existing delegate will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.
Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.
See also itemDelegate().
void QAbstractItemView::setItemDelegateForColumn ( int column, QAbstractItemDelegate * delegate )
Sets the given item delegate used by this view and model for the given column. All items on column will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).
Any existing column delegate for column will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.
Note: If a delegate has been assigned to both a row and a column, the row delegate will take presedence and manage the intersecting cell index.
Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.
This function was introduced in Qt 4.2.
See also itemDelegateForColumn(), setItemDelegateForRow(), and itemDelegate().
void QAbstractItemView::setItemDelegateForRow ( int row, QAbstractItemDelegate * delegate )
Sets the given item delegate used by this view and model for the given row. All items on row will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()).
Any existing row delegate for row will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.
Note: If a delegate has been assigned to both a row and a column, the row delegate (i.e., this delegate) will take presedence and manage the intersecting cell index.
Warning: You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.
This function was introduced in Qt 4.2.
See also itemDelegateForRow(), setItemDelegateForColumn(), and itemDelegate().
void QAbstractItemView::setModel ( QAbstractItemModel * model ) [virtual]
Sets the model for the view to present.
This function will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required. This is done with the following code:
QItemSelectionModel *m = view->selectionModel();
view->setModel(new model);
delete m;
If both the old model and the old selection model do not have parents, or if their parents are long-lived objects, it may be preferable to call their deleteLater() functions to explicitly delete them.
The view does not take ownership of the model unless it is the model's parent object because the view may be shared between many different views.
See also model(), selectionModel(), and setSelectionModel().
void QAbstractItemView::setRootIndex ( const QModelIndex & index ) [virtual slot]
Sets the root item to the item at the given index.
See also rootIndex().
void QAbstractItemView::setSelection ( const QRect & rect, QItemSelectionModel::SelectionFlags flags ) [pure virtual protected]
Applies the selection flags to the items in or touched by the rectangle, rect.
When implementing your own itemview setSelection should call selectionModel()->select(selection, flags) where selection is either an empty QModelIndex or a QItemSelection that contains all items that are contained in rect.
See also selectionCommand() and selectedIndexes().
void QAbstractItemView::setSelectionModel ( QItemSelectionModel * selectionModel ) [virtual]
Sets the current selection model to the given selectionModel.
Note that, if you call setModel() after this function, the given selectionModel will be replaced by one created by the view.
Note: It is up to the application to delete the old selection model if it is no longer needed; i.e., if it is not being used by other views. This will happen automatically when its parent object is deleted. However, if it does not have a parent, or if the parent is a long-lived object, it may be preferable to call its deleteLater() function to explicitly delete it.
See also selectionModel(), setModel(), and clearSelection().
void QAbstractItemView::setState ( State state ) [protected]
Sets the item view's state to the given state.
See also state().
int QAbstractItemView::sizeHintForColumn ( int column ) const [virtual]
Returns the width size hint for the specified column or -1 if there is no model.
This function is used in views with a horizontal header to find the size hint for a header section based on the contents of the given column.
See also sizeHintForRow().
QSize QAbstractItemView::sizeHintForIndex ( const QModelIndex & index ) const
Returns the size hint for the item with the specified index or an invalid size for invalid indexes.
See also sizeHintForRow() and sizeHintForColumn().
int QAbstractItemView::sizeHintForRow ( int row ) const [virtual]
Returns the height size hint for the specified row or -1 if there is no model.
The returned height is calculated using the size hints of the given row's items, i.e. the returned value is the maximum height among the items. Note that to control the height of a row, you must reimplement the QAbstractItemDelegate::sizeHint() function.
This function is used in views with a vertical header to find the size hint for a header section based on the contents of the given row.
See also sizeHintForColumn().
void QAbstractItemView::startDrag ( Qt::DropActions supportedActions ) [virtual protected]
Starts a drag by calling drag->exec() using the given supportedActions.
State QAbstractItemView::state () const [protected]
Returns the item view's state.
See also setState().
void QAbstractItemView::timerEvent ( QTimerEvent * event ) [virtual protected]
Reimplemented from QObject::timerEvent().
This function is called with the given event when a timer event is sent to the widget.
See also QObject::timerEvent().
void QAbstractItemView::update ( const QModelIndex & index ) [slot]
Updates the area occupied by the given index.
This function was introduced in Qt 4.3.
void QAbstractItemView::updateGeometries () [virtual protected slot]
Updates the geometry of the child widgets of the view.
This function was introduced in Qt 4.4.
int QAbstractItemView::verticalOffset () const [pure virtual protected]
Returns the vertical offset of the view.
In the base class this is a pure virtual function.
See also horizontalOffset().
QStyleOptionViewItem QAbstractItemView::viewOptions () const [virtual protected]
Returns a QStyleOptionViewItem structure populated with the view's palette, font, state, alignments etc.
void QAbstractItemView::viewportEntered () [signal]
This signal is emitted when the mouse cursor enters the viewport. Mouse tracking needs to be enabled for this feature to work.
See also entered().
bool QAbstractItemView::viewportEvent ( QEvent * event ) [virtual protected]
Reimplemented from QAbstractScrollArea::viewportEvent().
This function is used to handle tool tips, and What's This? mode, if the given event is a QEvent::ToolTip,or a QEvent::WhatsThis. It passes all other events on to its base class viewportEvent() handler.
QRect QAbstractItemView::visualRect ( const QModelIndex & index ) const [pure virtual]
Returns the rectangle on the viewport occupied by the item at index.
If your item is displayed in several areas then visualRect should return the primary area that contains index and not the complete area that index might encompasses, touch or cause drawing.
In the base class this is a pure virtual function.
See also indexAt() and visualRegionForSelection().
QRegion QAbstractItemView::visualRegionForSelection ( const QItemSelection & selection ) const [pure virtual protected]
Returns the region from the viewport of the items in the given selection.
In the base class this is a pure virtual function.
See also visualRect() and selectedIndexes().
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt 4.6.3
|
{
"url": "https://doc.qt.io/archives/4.6/qabstractitemview.html",
"source_domain": "doc.qt.io",
"snapshot_id": "crawl=CC-MAIN-2021-17",
"warc_metadata": {
"Content-Length": "133691",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:6EKRACBJZUQEQLTZHO2OKGMEIE7R4VDI",
"WARC-Concurrent-To": "<urn:uuid:776353c7-968f-49b6-9f0e-d47f83cfb690>",
"WARC-Date": "2021-04-19T13:00:19Z",
"WARC-IP-Address": "18.203.89.116",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:AV3GPHYPIAL2RWFX5G3Z7DSHOIFMKMWJ",
"WARC-Record-ID": "<urn:uuid:cbcb3967-e505-401d-b426-447143db80aa>",
"WARC-Target-URI": "https://doc.qt.io/archives/4.6/qabstractitemview.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:2a04e569-cf2b-4370-bf22-c41e4c85de7a>"
},
"warc_info": "isPartOf: CC-MAIN-2021-17\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for April 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-207.ec2.internal\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
49,
50,
84,
99,
100,
192,
193,
223,
224,
254,
255,
332,
333,
334,
347,
348,
425,
531,
550,
635,
685,
751,
859,
860,
871,
872,
873,
890,
891,
934,
956,
991,
1021,
1078,
1112,
1154,
1189,
1225,
1251,
1286,
1314,
1355,
1379,
1442,
1500,
1546,
1619,
1686,
1747,
1802,
1838,
1894,
1925,
2014,
2078,
2134,
2180,
2225,
2260,
2300,
2356,
2403,
2452,
2488,
2531,
2578,
2627,
2667,
2735,
2793,
2872,
2945,
2998,
3074,
3138,
3210,
3251,
3300,
3347,
3379,
3430,
3489,
3534,
3565,
3606,
3645,
3710,
3711,
3742,
3743,
3814,
3815,
3828,
3829,
3852,
3892,
3914,
3937,
3957,
3983,
4034,
4090,
4132,
4133,
4141,
4142,
4187,
4230,
4279,
4322,
4365,
4389,
4390,
4406,
4407,
4486,
4558,
4651,
4652,
4672,
4673,
4707,
4760,
4845,
4879,
4921,
4988,
5086,
5121,
5163,
5212,
5335,
5382,
5478,
5508,
5568,
5589,
5629,
5679,
5767,
5768,
5802,
5803,
5859,
5915,
5969,
6015,
6053,
6103,
6149,
6200,
6260,
6309,
6368,
6420,
6473,
6528,
6578,
6626,
6672,
6673,
6689,
6690,
6777,
6822,
6912,
7002,
7052,
7137,
7214,
7315,
7348,
7349,
7378,
7379,
7380,
7401,
7402,
7486,
7487,
8013,
8014,
8032,
8083,
8147,
8255,
8303,
8366,
8416,
8507,
8545,
8546,
8722,
8723,
8826,
8827,
9013,
9014,
9239,
9240,
9375,
9376,
9617,
9618,
9667,
9729,
9738,
9741,
9742,
9804,
9805,
10101,
10102,
10212,
10213,
10395,
10396,
10595,
10596,
10682,
10683,
10684,
10710,
10711,
10748,
10749,
10815,
10816,
10841,
10908,
10977,
11048,
11121,
11183,
11248,
11319,
11394,
11463,
11537,
11538,
11561,
11562,
11599,
11600,
11738,
11739,
11764,
11833,
11905,
11956,
12029,
12123,
12124,
12204,
12205,
12241,
12242,
12310,
12311,
12357,
12358,
12469,
12470,
12495,
12560,
12631,
12702,
12916,
12917,
12953,
12991,
12992,
13054,
13055,
13080,
13135,
13214,
13294,
13387,
13494,
13581,
13655,
13656,
13767,
13768,
13803,
13804,
13829,
13905,
13994,
14089,
14184,
14185,
14220,
14221,
14246,
14333,
14422,
14423,
14459,
14460,
14502,
14503,
14528,
14583,
14634,
14691,
14692,
14730,
14731,
14793,
14794,
14819,
14997,
15334,
15862,
16088,
16145,
16146,
16218,
16219,
16249,
16250,
16369,
16370,
16395,
16448,
16509,
16576,
16656,
16729,
16803,
16879,
16880,
16881,
16904,
16905,
16933,
16934,
17011,
17012,
17193,
17194,
17230,
17231,
17249,
17250,
17285,
17330,
17331,
17349,
17350,
17424,
17425,
17717,
17718,
17836,
17837,
17855,
17856,
17884,
17919,
17920,
17943,
17944,
18019,
18020,
18154,
18155,
18195,
18196,
18214,
18215,
18245,
18285,
18286,
18321,
18322,
18417,
18418,
18523,
18524,
18564,
18565,
18583,
18584,
18626,
18682,
18683,
18737,
18738,
18766,
18767,
18835,
18836,
18876,
18877,
18895,
18896,
18931,
18978,
18979,
19033,
19034,
19063,
19064,
19119,
19120,
19406,
19407,
19563,
19564,
19717,
19718,
19758,
19759,
19777,
19778,
19814,
19863,
19864,
19887,
19888,
19907,
19908,
19981,
19982,
20000,
20001,
20027,
20063,
20064,
20146,
20147,
20175,
20176,
20238,
20239,
20433,
20434,
20452,
20453,
20488,
20535,
20536,
20570,
20571,
20654,
20655,
20778,
20779,
20819,
20820,
20838,
20839,
20880,
20929,
20930,
20947,
20948,
20994,
20995,
21085,
21086,
21104,
21105,
21129,
21169,
21170,
21208,
21209,
21269,
21270,
21361,
21362,
21380,
21381,
21445,
21521,
21522,
21568,
21569,
21599,
21600,
21663,
21664,
21822,
21823,
21841,
21842,
21898,
21962,
21963,
22009,
22010,
22035,
22036,
22126,
22127,
22145,
22146,
22178,
22221,
22222,
22298,
22299,
22323,
22324,
22401,
22402,
22420,
22421,
22452,
22493,
22494,
22528,
22529,
22591,
22592,
22648,
22649,
22667,
22668,
22709,
22758,
22759,
22791,
22792,
22873,
22874,
22995,
22996,
23036,
23037,
23055,
23056,
23095,
23142,
23143,
23173,
23174,
23236,
23237,
23293,
23294,
23335,
23336,
23355,
23356,
23431,
23432,
23672,
23673,
23736,
23737,
23788,
23789,
23858,
23859,
23900,
23901,
23974,
23975,
24139,
24140,
24205,
24206,
24331,
24332,
24563,
24564,
24598,
24599,
24675,
24676,
24738,
24739,
24772,
24773,
24856,
24857,
24901,
24902,
24926,
24927,
25055,
25056,
25219,
25220,
25293,
25294,
25347,
25348,
25393,
25394,
25422,
25423,
25551,
25552,
25728,
25729,
25796,
25797,
25850,
25851,
26047,
26048,
26099,
26100,
26179,
26180,
26358,
26359,
26395,
26396,
26485,
26486,
26532,
26533,
26759,
26760,
26798,
26799,
26888,
26889,
26935,
26936,
27067,
27068,
27155,
27156,
27201,
27202,
27490,
27491,
27529,
27530,
27609,
27610,
27651,
27652,
27831,
27832,
27854,
27855,
27941,
27942,
28018,
28019,
28059,
28060,
28128,
28129,
28205,
28206,
28515,
28516,
28547,
28548,
28666,
28667,
28817,
28818,
28934,
28935,
29025,
29026,
29050,
29051,
29139,
29140,
29206,
29207,
29231,
29232,
29305,
29306,
29448,
29449,
29533,
29534,
29605,
29606,
29643,
29644,
29711,
29712,
29794,
29795,
29834,
29835,
29918,
29919,
29963,
29964,
30078,
30079,
30120,
30121,
30200,
30201,
30251,
30252,
30336,
30337,
30382,
30383,
30496,
30497,
30539,
30540,
30616,
30617,
30660,
30661,
30712,
30713,
30740,
30741,
30828,
30829,
30900,
30901,
30952,
30953,
30976,
30977,
31054,
31055,
31107,
31108,
31148,
31149,
31176,
31177,
31270,
31271,
31319,
31320,
31414,
31415,
31463,
31464,
31565,
31566,
31670,
31671,
31790,
31791,
31842,
31843,
31908,
31909,
32031,
32032,
32060,
32061,
32153,
32154,
32229,
32230,
32316,
32317,
32481,
32482,
32522,
32523,
32602,
32603,
32683,
32684,
32884,
32885,
32925,
32926,
33008,
33009,
33091,
33092,
33137,
33138,
33567,
33568,
33639,
33640,
33718,
33719,
33819,
33820,
33986,
33987,
34042,
34043,
34091,
34092,
34113,
34114,
34206,
34207,
34260,
34261,
34468,
34469,
34554,
34555,
34601,
34602,
34822,
34823,
34909,
34910,
34957,
34958,
35179,
35180,
35268,
35269,
35318,
35319,
35679,
35680,
35812,
35813,
35962,
35963,
36014,
36015,
36090,
36091,
36209,
36210,
36244,
36245,
36318,
36319,
36483,
36484,
36569,
36570,
36635,
36636,
36686,
36687,
36725,
36726,
37019,
37020,
37103,
37104,
37147,
37148,
37236,
37237,
37270,
37271,
37321,
37322,
37460,
37461,
37486,
37487,
37610,
37611,
37745,
37746,
37771,
37772,
37887,
37888,
38092,
38093,
38126,
38127,
38195,
38196,
38289,
38290,
38420,
38421,
38459,
38460,
38535,
38536,
38745,
38746,
38923,
38924,
38996,
38997,
39110,
39111,
39254,
39255,
39306,
39307,
39358,
39359,
39391,
39392,
39432,
39433,
39472,
39473,
39521,
39522,
39551,
39552,
39592,
39593,
39635,
39636,
39690,
39691,
39800,
39801,
39867,
39868,
39950,
39951,
40101,
40102,
40151,
40152,
40291,
40292,
40451,
40452,
40477,
40478,
40634,
40635,
40804,
40805,
40870,
40871,
40896,
40897,
40962,
40963,
41000,
41001,
41053,
41054,
41133,
41134,
41181,
41182,
41363,
41364,
41426,
41427,
41500,
41501,
41563,
41564,
41644,
41645,
41793,
41794,
41834,
41835,
41889,
41890,
41977,
41978,
42085,
42086,
42173,
42174,
42358,
42359,
42520,
42521,
42560,
42565,
42604,
42605,
42838,
42839,
42879,
42880,
42925,
42926,
43003,
43004,
43151,
43152,
43263,
43264,
43565,
43566,
43591,
43592,
43690,
43691,
43890,
43891,
44020,
44021,
44165,
44166,
44467,
44468,
44508,
44509,
44588,
44589,
44681,
44682,
44875,
44876,
44999,
45000,
45166,
45167,
45468,
45469,
45509,
45510,
45589,
45590,
45666,
45667,
45707,
45708,
46051,
46052,
46102,
46130,
46141,
46142,
46343,
46344,
46490,
46491,
46552,
46553,
46637,
46638,
46689,
46690,
46712,
46713,
46843,
46844,
46923,
46924,
47147,
47148,
47199,
47200,
47295,
47296,
47358,
47359,
47484,
47485,
47853,
47854,
47915,
47916,
47979,
47980,
48027,
48028,
48046,
48047,
48121,
48122,
48203,
48204,
48346,
48347,
48374,
48375,
48453,
48454,
48554,
48555,
48606,
48607,
48675,
48676,
48755,
48756,
49011,
49012,
49149,
49150,
49180,
49181,
49274,
49275,
49347,
49348,
49402,
49403,
49434,
49435,
49456,
49457,
49538,
49539,
49581,
49582,
49669,
49670,
49702,
49703,
49773,
49774,
49820,
49821,
49861,
49862,
49933,
49934,
49989,
49990,
50030,
50031,
50105,
50106,
50147,
50148,
50199,
50200,
50229,
50230,
50313,
50314,
50419,
50420,
50474,
50475,
50602,
50603,
50623,
50624,
50703,
50704,
50761,
50762,
50965,
50966,
51055,
51056,
51125,
51126,
51316,
51317,
51368,
51369,
51420,
51421,
51543,
51544,
51618,
51619,
51670,
51671,
51716,
51717,
51718,
51792
],
"line_end_idx": [
49,
50,
84,
99,
100,
192,
193,
223,
224,
254,
255,
332,
333,
334,
347,
348,
425,
531,
550,
635,
685,
751,
859,
860,
871,
872,
873,
890,
891,
934,
956,
991,
1021,
1078,
1112,
1154,
1189,
1225,
1251,
1286,
1314,
1355,
1379,
1442,
1500,
1546,
1619,
1686,
1747,
1802,
1838,
1894,
1925,
2014,
2078,
2134,
2180,
2225,
2260,
2300,
2356,
2403,
2452,
2488,
2531,
2578,
2627,
2667,
2735,
2793,
2872,
2945,
2998,
3074,
3138,
3210,
3251,
3300,
3347,
3379,
3430,
3489,
3534,
3565,
3606,
3645,
3710,
3711,
3742,
3743,
3814,
3815,
3828,
3829,
3852,
3892,
3914,
3937,
3957,
3983,
4034,
4090,
4132,
4133,
4141,
4142,
4187,
4230,
4279,
4322,
4365,
4389,
4390,
4406,
4407,
4486,
4558,
4651,
4652,
4672,
4673,
4707,
4760,
4845,
4879,
4921,
4988,
5086,
5121,
5163,
5212,
5335,
5382,
5478,
5508,
5568,
5589,
5629,
5679,
5767,
5768,
5802,
5803,
5859,
5915,
5969,
6015,
6053,
6103,
6149,
6200,
6260,
6309,
6368,
6420,
6473,
6528,
6578,
6626,
6672,
6673,
6689,
6690,
6777,
6822,
6912,
7002,
7052,
7137,
7214,
7315,
7348,
7349,
7378,
7379,
7380,
7401,
7402,
7486,
7487,
8013,
8014,
8032,
8083,
8147,
8255,
8303,
8366,
8416,
8507,
8545,
8546,
8722,
8723,
8826,
8827,
9013,
9014,
9239,
9240,
9375,
9376,
9617,
9618,
9667,
9729,
9738,
9741,
9742,
9804,
9805,
10101,
10102,
10212,
10213,
10395,
10396,
10595,
10596,
10682,
10683,
10684,
10710,
10711,
10748,
10749,
10815,
10816,
10841,
10908,
10977,
11048,
11121,
11183,
11248,
11319,
11394,
11463,
11537,
11538,
11561,
11562,
11599,
11600,
11738,
11739,
11764,
11833,
11905,
11956,
12029,
12123,
12124,
12204,
12205,
12241,
12242,
12310,
12311,
12357,
12358,
12469,
12470,
12495,
12560,
12631,
12702,
12916,
12917,
12953,
12991,
12992,
13054,
13055,
13080,
13135,
13214,
13294,
13387,
13494,
13581,
13655,
13656,
13767,
13768,
13803,
13804,
13829,
13905,
13994,
14089,
14184,
14185,
14220,
14221,
14246,
14333,
14422,
14423,
14459,
14460,
14502,
14503,
14528,
14583,
14634,
14691,
14692,
14730,
14731,
14793,
14794,
14819,
14997,
15334,
15862,
16088,
16145,
16146,
16218,
16219,
16249,
16250,
16369,
16370,
16395,
16448,
16509,
16576,
16656,
16729,
16803,
16879,
16880,
16881,
16904,
16905,
16933,
16934,
17011,
17012,
17193,
17194,
17230,
17231,
17249,
17250,
17285,
17330,
17331,
17349,
17350,
17424,
17425,
17717,
17718,
17836,
17837,
17855,
17856,
17884,
17919,
17920,
17943,
17944,
18019,
18020,
18154,
18155,
18195,
18196,
18214,
18215,
18245,
18285,
18286,
18321,
18322,
18417,
18418,
18523,
18524,
18564,
18565,
18583,
18584,
18626,
18682,
18683,
18737,
18738,
18766,
18767,
18835,
18836,
18876,
18877,
18895,
18896,
18931,
18978,
18979,
19033,
19034,
19063,
19064,
19119,
19120,
19406,
19407,
19563,
19564,
19717,
19718,
19758,
19759,
19777,
19778,
19814,
19863,
19864,
19887,
19888,
19907,
19908,
19981,
19982,
20000,
20001,
20027,
20063,
20064,
20146,
20147,
20175,
20176,
20238,
20239,
20433,
20434,
20452,
20453,
20488,
20535,
20536,
20570,
20571,
20654,
20655,
20778,
20779,
20819,
20820,
20838,
20839,
20880,
20929,
20930,
20947,
20948,
20994,
20995,
21085,
21086,
21104,
21105,
21129,
21169,
21170,
21208,
21209,
21269,
21270,
21361,
21362,
21380,
21381,
21445,
21521,
21522,
21568,
21569,
21599,
21600,
21663,
21664,
21822,
21823,
21841,
21842,
21898,
21962,
21963,
22009,
22010,
22035,
22036,
22126,
22127,
22145,
22146,
22178,
22221,
22222,
22298,
22299,
22323,
22324,
22401,
22402,
22420,
22421,
22452,
22493,
22494,
22528,
22529,
22591,
22592,
22648,
22649,
22667,
22668,
22709,
22758,
22759,
22791,
22792,
22873,
22874,
22995,
22996,
23036,
23037,
23055,
23056,
23095,
23142,
23143,
23173,
23174,
23236,
23237,
23293,
23294,
23335,
23336,
23355,
23356,
23431,
23432,
23672,
23673,
23736,
23737,
23788,
23789,
23858,
23859,
23900,
23901,
23974,
23975,
24139,
24140,
24205,
24206,
24331,
24332,
24563,
24564,
24598,
24599,
24675,
24676,
24738,
24739,
24772,
24773,
24856,
24857,
24901,
24902,
24926,
24927,
25055,
25056,
25219,
25220,
25293,
25294,
25347,
25348,
25393,
25394,
25422,
25423,
25551,
25552,
25728,
25729,
25796,
25797,
25850,
25851,
26047,
26048,
26099,
26100,
26179,
26180,
26358,
26359,
26395,
26396,
26485,
26486,
26532,
26533,
26759,
26760,
26798,
26799,
26888,
26889,
26935,
26936,
27067,
27068,
27155,
27156,
27201,
27202,
27490,
27491,
27529,
27530,
27609,
27610,
27651,
27652,
27831,
27832,
27854,
27855,
27941,
27942,
28018,
28019,
28059,
28060,
28128,
28129,
28205,
28206,
28515,
28516,
28547,
28548,
28666,
28667,
28817,
28818,
28934,
28935,
29025,
29026,
29050,
29051,
29139,
29140,
29206,
29207,
29231,
29232,
29305,
29306,
29448,
29449,
29533,
29534,
29605,
29606,
29643,
29644,
29711,
29712,
29794,
29795,
29834,
29835,
29918,
29919,
29963,
29964,
30078,
30079,
30120,
30121,
30200,
30201,
30251,
30252,
30336,
30337,
30382,
30383,
30496,
30497,
30539,
30540,
30616,
30617,
30660,
30661,
30712,
30713,
30740,
30741,
30828,
30829,
30900,
30901,
30952,
30953,
30976,
30977,
31054,
31055,
31107,
31108,
31148,
31149,
31176,
31177,
31270,
31271,
31319,
31320,
31414,
31415,
31463,
31464,
31565,
31566,
31670,
31671,
31790,
31791,
31842,
31843,
31908,
31909,
32031,
32032,
32060,
32061,
32153,
32154,
32229,
32230,
32316,
32317,
32481,
32482,
32522,
32523,
32602,
32603,
32683,
32684,
32884,
32885,
32925,
32926,
33008,
33009,
33091,
33092,
33137,
33138,
33567,
33568,
33639,
33640,
33718,
33719,
33819,
33820,
33986,
33987,
34042,
34043,
34091,
34092,
34113,
34114,
34206,
34207,
34260,
34261,
34468,
34469,
34554,
34555,
34601,
34602,
34822,
34823,
34909,
34910,
34957,
34958,
35179,
35180,
35268,
35269,
35318,
35319,
35679,
35680,
35812,
35813,
35962,
35963,
36014,
36015,
36090,
36091,
36209,
36210,
36244,
36245,
36318,
36319,
36483,
36484,
36569,
36570,
36635,
36636,
36686,
36687,
36725,
36726,
37019,
37020,
37103,
37104,
37147,
37148,
37236,
37237,
37270,
37271,
37321,
37322,
37460,
37461,
37486,
37487,
37610,
37611,
37745,
37746,
37771,
37772,
37887,
37888,
38092,
38093,
38126,
38127,
38195,
38196,
38289,
38290,
38420,
38421,
38459,
38460,
38535,
38536,
38745,
38746,
38923,
38924,
38996,
38997,
39110,
39111,
39254,
39255,
39306,
39307,
39358,
39359,
39391,
39392,
39432,
39433,
39472,
39473,
39521,
39522,
39551,
39552,
39592,
39593,
39635,
39636,
39690,
39691,
39800,
39801,
39867,
39868,
39950,
39951,
40101,
40102,
40151,
40152,
40291,
40292,
40451,
40452,
40477,
40478,
40634,
40635,
40804,
40805,
40870,
40871,
40896,
40897,
40962,
40963,
41000,
41001,
41053,
41054,
41133,
41134,
41181,
41182,
41363,
41364,
41426,
41427,
41500,
41501,
41563,
41564,
41644,
41645,
41793,
41794,
41834,
41835,
41889,
41890,
41977,
41978,
42085,
42086,
42173,
42174,
42358,
42359,
42520,
42521,
42560,
42565,
42604,
42605,
42838,
42839,
42879,
42880,
42925,
42926,
43003,
43004,
43151,
43152,
43263,
43264,
43565,
43566,
43591,
43592,
43690,
43691,
43890,
43891,
44020,
44021,
44165,
44166,
44467,
44468,
44508,
44509,
44588,
44589,
44681,
44682,
44875,
44876,
44999,
45000,
45166,
45167,
45468,
45469,
45509,
45510,
45589,
45590,
45666,
45667,
45707,
45708,
46051,
46052,
46102,
46130,
46141,
46142,
46343,
46344,
46490,
46491,
46552,
46553,
46637,
46638,
46689,
46690,
46712,
46713,
46843,
46844,
46923,
46924,
47147,
47148,
47199,
47200,
47295,
47296,
47358,
47359,
47484,
47485,
47853,
47854,
47915,
47916,
47979,
47980,
48027,
48028,
48046,
48047,
48121,
48122,
48203,
48204,
48346,
48347,
48374,
48375,
48453,
48454,
48554,
48555,
48606,
48607,
48675,
48676,
48755,
48756,
49011,
49012,
49149,
49150,
49180,
49181,
49274,
49275,
49347,
49348,
49402,
49403,
49434,
49435,
49456,
49457,
49538,
49539,
49581,
49582,
49669,
49670,
49702,
49703,
49773,
49774,
49820,
49821,
49861,
49862,
49933,
49934,
49989,
49990,
50030,
50031,
50105,
50106,
50147,
50148,
50199,
50200,
50229,
50230,
50313,
50314,
50419,
50420,
50474,
50475,
50602,
50603,
50623,
50624,
50703,
50704,
50761,
50762,
50965,
50966,
51055,
51056,
51125,
51126,
51316,
51317,
51368,
51369,
51420,
51421,
51543,
51544,
51618,
51619,
51670,
51671,
51716,
51717,
51718,
51792,
51800
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 51800,
"ccnet_original_nlines": 1165,
"rps_doc_curly_bracket": 0.00038610000046901405,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2800000011920929,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0006857099942862988,
"rps_doc_frac_lines_end_with_ellipsis": 0.002572899917140603,
"rps_doc_frac_no_alph_words": 0.2231999933719635,
"rps_doc_frac_unique_words": 0.1678108274936676,
"rps_doc_mean_word_length": 6.3234171867370605,
"rps_doc_num_sentences": 494,
"rps_doc_symbol_to_word_ratio": 0.0009142900235019624,
"rps_doc_unigram_entropy": 5.634265422821045,
"rps_doc_word_count": 6555,
"rps_doc_frac_chars_dupe_10grams": 0.1363329291343689,
"rps_doc_frac_chars_dupe_5grams": 0.25753921270370483,
"rps_doc_frac_chars_dupe_6grams": 0.2107599526643753,
"rps_doc_frac_chars_dupe_7grams": 0.17809408903121948,
"rps_doc_frac_chars_dupe_8grams": 0.15613992512226105,
"rps_doc_frac_chars_dupe_9grams": 0.1469240039587021,
"rps_doc_frac_chars_top_2gram": 0.012159230187535286,
"rps_doc_frac_chars_top_3gram": 0.020265379920601845,
"rps_doc_frac_chars_top_4gram": 0.008202649652957916,
"rps_doc_books_importance": -4000.1005859375,
"rps_doc_books_importance_length_correction": -4000.1005859375,
"rps_doc_openwebtext_importance": -2715.1845703125,
"rps_doc_openwebtext_importance_length_correction": -2715.1845703125,
"rps_doc_wikipedia_importance": -1802.4683837890625,
"rps_doc_wikipedia_importance_length_correction": -1802.4683837890625
},
"fasttext": {
"dclm": 0.021063750609755516,
"english": 0.6797365546226501,
"fineweb_edu_approx": 1.364517331123352,
"eai_general_math": 0.7946432828903198,
"eai_open_web_math": 0.0938342809677124,
"eai_web_code": 0.9801936745643616
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.02",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "5",
"label": "Exceptionally Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,410,410,080,706,662,000 |
Programmation C - www-igm.univ-mlv.fr
Programmation C - www-igm.univ-mlv.fr
Episode 31- Formation en C - Les fichiers - La fonction d'écriture fwrite Recherche Binaire - Langage C Langage C (manipulation de bits) #4 structure de données - séance 4 - les fichiers - partie 1 Comment éviter toute manipulation en Trading ?
Bon et bien dans se ca va dans Options des dossiers... Types de fichiers. 1 ... exe.reg le fichier spécifié n'est pas un script du registre. Vous pouvez uniquement importerdes fichiers du registre binaires à partir de l'éditeur de registre." ... c'est que soit le champ est vide ou tu as fait une mauvaise manipulation en ayant fait un copier ... Les bases de la programmation en C 1.1 Historique Le C a ´et´e con¸cu en 1972 par Dennis Richie et Ken Thompson, chercheurs aux Bell Labs, afin de d´evelopper un syst`eme d’exploitation UNIX sur un DEC PDP-11. En 1978, Brian Kernighan et Dennis Richie publient la d´efinition classique du C dans le livre The C Pro-gramming language [6 ... Manipulation de fichiers. ... Les coutumiers du shell retrouveront de nombreuses options de la commande test. -e teste si son paramètre est un chemin valable dans le système de fichiers (répertoire, fichier, etc.). On pourrait l'utiliser ainsi : ... Discutons un peu de la manipulation de fichiers binaires. bonjour, j ai un petit programme a faire en C j ai un buffer = "mes donnees" je voudrais mettre ses donnees dans un fichier : je dois faire un fopen fopen C:\temp et ensuite comment je redirige le contenu de mon buffer dans le... Juste un petit souci lors de la manipulation de fichiers en binaires. Disons que je suis pas habitué du tout (c'est la première fois que j'utilise ça à vrai dire ) Passons directement au code : J'ai une structure : typedef struct { char ref[6]; char des[31]; float prix; int qtite; } Article;
[index] [6440] [3651] [6052] [2248] [4843] [3568] [601] [1732] [6500] [7342]
Episode 31- Formation en C - Les fichiers - La fonction d'écriture fwrite
Dans ce tutoriel, je vous montre comment manipuler des fichiers binaires. Il s'agit de lire ou écrire des données sous forme d'octets, à la différence du mod... exercice sur les fichier en langage c les fichiers binaires en langage c pdf ... Ecrire un programme (en C) avec un code ou un mot de passe - Duration: 8:39. Les p'tits gamers 11,013 views. Langage C #21 - arbres binaires - Duration: ... 53:28. programmation c arbre binaire ::arbre binaire de recherche 1 - Duration: 41:29. hicham manchour ... Tutoriel C - fichiers binaires - Duration A travers TKL LFA, mon objectif est de vous aider à disposer de tous les outils pour changer radicalement de vie et devenir libre financièrement. 🌟🌟🌟🌟🌟 https://fr.trustpilot.com ... Episode 31- Formation en C - Les fichiers - La fonction d'écriture fwrite. ... les fichier en langage c De A a Z (Exemple corrigé ) ... Tutoriel C - fichiers binaires - Duration: 17:38.
http://arabbinaryoptiontrade.mamblominingbitcoin.website
|
{
"url": "http://arabbinary-option.bitcoinsmining.website/",
"source_domain": "arabbinary-option.bitcoinsmining.website",
"snapshot_id": "crawl=CC-MAIN-2021-39",
"warc_metadata": {
"Content-Length": "8937",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:TX42BBXTGQ36X3NJG77RA6MBQW4SO4GA",
"WARC-Concurrent-To": "<urn:uuid:9fd29dee-f883-40bc-b5b3-0e9d9a61d945>",
"WARC-Date": "2021-09-20T21:11:29Z",
"WARC-IP-Address": "104.21.49.143",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:CJJNQVFVHQRFGFQNDN4OTFXVETUVGIRT",
"WARC-Record-ID": "<urn:uuid:c75f5df8-2fdd-45ca-9c9e-607d67f80627>",
"WARC-Target-URI": "http://arabbinary-option.bitcoinsmining.website/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:b4f1de68-7cbb-4342-b2a9-59dec94f9c65>"
},
"warc_info": "isPartOf: CC-MAIN-2021-39\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-93\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
40,
41,
79,
80,
325,
326,
1842,
1843,
1920,
1921,
1995,
1996,
2912,
2913
],
"line_end_idx": [
40,
41,
79,
80,
325,
326,
1842,
1843,
1920,
1921,
1995,
1996,
2912,
2913,
2969
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2969,
"ccnet_original_nlines": 14,
"rps_doc_curly_bracket": 0.0006736299837939441,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.07772795110940933,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.038863979279994965,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.31091180443763733,
"rps_doc_frac_unique_words": 0.5294117331504822,
"rps_doc_mean_word_length": 4.980391979217529,
"rps_doc_num_sentences": 41,
"rps_doc_symbol_to_word_ratio": 0.025411060079932213,
"rps_doc_unigram_entropy": 5.024211406707764,
"rps_doc_word_count": 459,
"rps_doc_frac_chars_dupe_10grams": 0.07611548900604248,
"rps_doc_frac_chars_dupe_5grams": 0.14523184299468994,
"rps_doc_frac_chars_dupe_6grams": 0.07611548900604248,
"rps_doc_frac_chars_dupe_7grams": 0.07611548900604248,
"rps_doc_frac_chars_dupe_8grams": 0.07611548900604248,
"rps_doc_frac_chars_dupe_9grams": 0.07611548900604248,
"rps_doc_frac_chars_top_2gram": 0.007874020375311375,
"rps_doc_frac_chars_top_3gram": 0.02099738083779812,
"rps_doc_frac_chars_top_4gram": 0.026246720924973488,
"rps_doc_books_importance": -314.1015625,
"rps_doc_books_importance_length_correction": -314.1015625,
"rps_doc_openwebtext_importance": -195.92236328125,
"rps_doc_openwebtext_importance_length_correction": -195.92236328125,
"rps_doc_wikipedia_importance": -169.70030212402344,
"rps_doc_wikipedia_importance_length_correction": -169.70030212402344
},
"fasttext": {
"dclm": 0.2918128967285156,
"english": 0.008977689780294895,
"fineweb_edu_approx": 1.4801334142684937,
"eai_general_math": 0.0006765099824406207,
"eai_open_web_math": 0.19621706008911133,
"eai_web_code": 0.33895623683929443
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.72",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,994,859,972,967,077,000 |
Blog
• Data Transfer Object
A Data Transfer Object is an object that carries data and transferred between different processes. In client-server architecture communication between their different processes calls should be in optimized way otherwise it will be very expensive operation because cost of the calls are related to the round-trip time in between client-server so there is a way to reduce and optimize the number of calls between processes is to use DTO which is Data Transfer Object and is capable to collect the data from all the required objects which will transfer by the several specific calls but served by one call only.
To work with the remote interface each call is very expensive so you should have to reduce the number of calls in between data transfer. So the solution to this problem is to transfer data between processes in that object which can hold all the data in a single unit for which we can use a Data Transfer Object. In Java, DTO should be serializable to travel across the connection between client and server.
Since in communication between client-server, each call is very expensive so that calls should contain all the data which needed. So, if there is a case that multiple requests required to bring data for a single specific task so the data can be combined in a DTO so we can bring all the required data in one request only.
Since DTO is basically used to reduce the number of method calls means you can combine multiple POJO entities in the service layer.
For example: Suppose a GET request /rest/employee/101/department is to retrieve all the departments for employee id 101 with employee details so you need to combine all the data from employee entity and department entity with details.
Sample DTO:
public class EmployeeDto implements Serializable {
private Long id;
private String firstName;
private String lastName;
private String username;
private Integer role;
...getters/setters
}
DTO should implement serializable for a DTO if an object needs to transfer over the network in bytes from or data should be shared between different application or server.
Suppose, one application server serializes the data and other will access that data so receiver needs to deserialize that data.
DrawBacks of using Hashmap in place of DTO: -
Compile time checking not available: In hashmap, you can transfer data between client and server but you cannot get the compile-time checking for that data which can cause a big problem and also you cannot check that what you are casting it to is valid.
Refactoring problem: There are many IDEs available which provides the refactoring feature for very easy to use but this becomes much more difficult for dictionary pattern. -
Development problem: There is a big drawback to use the hashmap in place of DTO that new developers will take a much harder time to figure out what is in those hashmaps. They have to drill down many layers down to figure out what is going on in those hashmaps.
Return values ambiguity problem: Suppose, In a phase of a project, you are getting employee object and only you use the “getEmployeeName()” method. Then in further phase all of a sudden you need to have access to the department attribute. If you have an employee object, you know exactly if that value is accessible and how to get it by simply looking at the class. But with the hashmap, it's not easy because if you don't know the source of the class that generates the hashmap you will never know that what other data attributes are available.
Tags: Java
|
{
"url": "https://www.oodlestechnologies.com/blogs/Advantages-of-using-Data-Transfer-Object-in-Java",
"source_domain": "www.oodlestechnologies.com",
"snapshot_id": "crawl=CC-MAIN-2018-34",
"warc_metadata": {
"Content-Length": "75829",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:RINMWM2GOYLNUQK6QYR7LSQZSRXANUH7",
"WARC-Concurrent-To": "<urn:uuid:1832be8b-cb89-453e-8f7b-eb3e8d047b1f>",
"WARC-Date": "2019-02-23T11:47:39Z",
"WARC-IP-Address": "52.7.2.6",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:L2YNUURGXSUGI5NR4TKYFZ3UMWWJXGQ4",
"WARC-Record-ID": "<urn:uuid:28bc4f06-8e55-4eb2-b978-fa067730c8d1>",
"WARC-Target-URI": "https://www.oodlestechnologies.com/blogs/Advantages-of-using-Data-Transfer-Object-in-Java",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:95493518-87dc-485a-a319-e6d120076c9d>"
},
"warc_info": "isPartOf: CC-MAIN-2019-09\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for February 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-29-113-152.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
5,
6,
31,
32,
645,
646,
652,
653,
1064,
1065,
1071,
1072,
1398,
1399,
1405,
1406,
1542,
1543,
1549,
1550,
1789,
1790,
1796,
1797,
1813,
1814,
1820,
1821,
1876,
1877,
1902,
1903,
1937,
1938,
1971,
1972,
2005,
2006,
2036,
2037,
2064,
2065,
2071,
2072,
2078,
2079,
2255,
2256,
2262,
2263,
2395,
2396,
2402,
2403,
2453,
2454,
2460,
2461,
2719,
2720,
2726,
2727,
2905,
2906,
2912,
2913,
3178,
3179,
3185,
3186,
3736,
3737,
3743,
3744,
3750,
3751
],
"line_end_idx": [
5,
6,
31,
32,
645,
646,
652,
653,
1064,
1065,
1071,
1072,
1398,
1399,
1405,
1406,
1542,
1543,
1549,
1550,
1789,
1790,
1796,
1797,
1813,
1814,
1820,
1821,
1876,
1877,
1902,
1903,
1937,
1938,
1971,
1972,
2005,
2006,
2036,
2037,
2064,
2065,
2071,
2072,
2078,
2079,
2255,
2256,
2262,
2263,
2395,
2396,
2402,
2403,
2453,
2454,
2460,
2461,
2719,
2720,
2726,
2727,
2905,
2906,
2912,
2913,
3178,
3179,
3185,
3186,
3736,
3737,
3743,
3744,
3750,
3751,
3761
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3761,
"ccnet_original_nlines": 76,
"rps_doc_curly_bracket": 0.0005317699979059398,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4940119683742523,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.017964070662856102,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.09431137889623642,
"rps_doc_frac_unique_words": 0.36180904507637024,
"rps_doc_mean_word_length": 4.792294979095459,
"rps_doc_num_sentences": 21,
"rps_doc_symbol_to_word_ratio": 0.001497010001912713,
"rps_doc_unigram_entropy": 4.846150875091553,
"rps_doc_word_count": 597,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.05592450127005577,
"rps_doc_frac_chars_dupe_6grams": 0.017476409673690796,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.01468017976731062,
"rps_doc_frac_chars_top_3gram": 0.02516602911055088,
"rps_doc_frac_chars_top_4gram": 0.013282069936394691,
"rps_doc_books_importance": -324.61004638671875,
"rps_doc_books_importance_length_correction": -324.61004638671875,
"rps_doc_openwebtext_importance": -188.38340759277344,
"rps_doc_openwebtext_importance_length_correction": -188.38340759277344,
"rps_doc_wikipedia_importance": -169.7929229736328,
"rps_doc_wikipedia_importance_length_correction": -169.7929229736328
},
"fasttext": {
"dclm": 0.44303786754608154,
"english": 0.9377913475036621,
"fineweb_edu_approx": 2.334974527359009,
"eai_general_math": 0.5136988162994385,
"eai_open_web_math": 0.09337378293275833,
"eai_web_code": 0.3348442316055298
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,893,262,253,349,537,000 |
Answers
Solutions by everydaycalculation.com
Answers.everydaycalculation.com » Divide fractions
Divide 25/56 with 14/90
25/56 ÷ 14/90 is 1125/392.
Steps for dividing fractions
1. Find the reciprocal of the divisor
Reciprocal of 14/90: 90/14
2. Now, multiply it with the dividend
So, 25/56 ÷ 14/90 = 25/56 × 90/14
3. = 25 × 90/56 × 14 = 2250/784
4. After reducing the fraction, the answer is 1125/392
5. In mixed form: 2341/392
MathStep (Works offline)
Download our mobile app and learn to work with fractions in your own time:
Android and iPhone/ iPad
Related:
© everydaycalculation.com
|
{
"url": "https://answers.everydaycalculation.com/divide-fractions/25-56-divided-by-14-90",
"source_domain": "answers.everydaycalculation.com",
"snapshot_id": "crawl=CC-MAIN-2021-10",
"warc_metadata": {
"Content-Length": "7320",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:DZ6X6D7EAZNRCXB7DGMMOMHMJPBJQE7X",
"WARC-Concurrent-To": "<urn:uuid:911bf681-dfc9-48bb-8d7a-ff7d08858790>",
"WARC-Date": "2021-02-26T07:27:51Z",
"WARC-IP-Address": "96.126.107.130",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:XO67HGCWIEYAQQKZDNV4CJKKOTRM3AIS",
"WARC-Record-ID": "<urn:uuid:c8a4a3d6-3da6-42ca-9f8c-ea6a8ba6be8b>",
"WARC-Target-URI": "https://answers.everydaycalculation.com/divide-fractions/25-56-divided-by-14-90",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:2de18041-436a-4ca7-a0f2-89914125504e>"
},
"warc_info": "isPartOf: CC-MAIN-2021-10\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for February/March 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-98.ec2.internal\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
8,
9,
46,
47,
98,
99,
123,
124,
151,
152,
181,
182,
222,
253,
293,
331,
365,
422,
451,
452,
477,
478,
553,
578,
579,
588,
589
],
"line_end_idx": [
8,
9,
46,
47,
98,
99,
123,
124,
151,
152,
181,
182,
222,
253,
293,
331,
365,
422,
451,
452,
477,
478,
553,
578,
579,
588,
589,
614
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 614,
"ccnet_original_nlines": 27,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.1689189225435257,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5540540218353271,
"rps_doc_frac_unique_words": 0.7142857313156128,
"rps_doc_mean_word_length": 5,
"rps_doc_num_sentences": 11,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.039562702178955,
"rps_doc_word_count": 91,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.03516484051942825,
"rps_doc_frac_chars_top_3gram": 0.03956044092774391,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -54.46250534057617,
"rps_doc_books_importance_length_correction": -67.45280456542969,
"rps_doc_openwebtext_importance": -44.17313003540039,
"rps_doc_openwebtext_importance_length_correction": -57.16342544555664,
"rps_doc_wikipedia_importance": -17.86794662475586,
"rps_doc_wikipedia_importance_length_correction": -30.858243942260742
},
"fasttext": {
"dclm": 0.9941642880439758,
"english": 0.8149094581604004,
"fineweb_edu_approx": 2.4546775817871094,
"eai_general_math": 0.0439569391310215,
"eai_open_web_math": 0.3553098440170288,
"eai_web_code": -0.000006199999916134402
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "513.2",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,081,361,516,427,778,600 |
A Locally Running Dovecot in Guix — GNUcode.me
A Locally Running Dovecot in Guix
by Joshua Branson — June 08, 2021
So, I have been wanting to set up a locally running dovecot server for a LONG time now. Essentially I have an email account at dismail.de, and Emacs' Gnus is pretty slow at searching for my emails. I could switch to using mu4e or notmuch, which ARE BLAZINGLY fast at searching your emails, BUT after listening to John Wiegley, who is one of the current Emacs maintainers, talk about how Emacs' Gnus mode is so cool...I've been using Gnus ever since. Essentially Gnus is a newsreader. It is a way to handle lots news that is similar to reddit. In Gnus, after you've read a message, you do not see it again by default. This is handy, because since you are getting so much email, it's useful to only see messages that you have not read.
Emacs's Gnus is actually the best way I've seen at handling LOTS of email, particularly mailing lists. For example, I am currently subscribed to guix-devel, help-guix, and bug-hurd. With Gnus, I can open up these email folders and I only see messages that I have not read, AND the emails are organized by threads NOT date:
Image
With my cursor on the top of the thread, pressing C-k, will kill the entire thread. So when I open up this folder again, I will not see that thread. Let's suppose that I've read all of the messages in that thread "Re: website: A little help running the website locally". So that now Gnus looks like this when I open it up:
Image
Pressing Shift-A-Shift-T, will pull up the entire thread, so that I can re-read the whole conversation:
Image
Anyway, the main problem that I have had with Gnus (for years...I should have fixed this a long time ago), is that it is REALLY slow and pretty much not responsive at searching for my email. I could try to search for my email with Gnus, but it would typically fail. I guess that something with dismail's servers are wonky, because I did not have this problem when I had a paid fastmail account.
So, one solution to continue using Gnus, but have decent searching is to have a locally running dovecot server that will serve my emails. I'll also be querying that local server instead of the remote one. Sounds plausible. Here's what you need to do:
First you need to fetch your remote email and put it in a local maildir. I prefer mbsync, because it is what all the cool kids are doing.
Here is my ~/.mbsyncrc
IMAPAccount dismail
# Address to connect to
Host imap.dismail.de
User [email protected]
Pass VERYSECRETPASSWORD
# To store the password in an encrypted file use PassCmd instead of Pass
# PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg"
#
# Use SSL
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
IMAPStore dismail-remote
Account dismail
MaildirStore dismail-local
Subfolders Verbatim
# The trailing "/" is important
Path ~/.mail/dismail.de/
Inbox ~/.mail/dismail.de/Inbox
Channel dismail
Master :dismail-remote:
Slave :dismail-local:
# show all folders
Patterns *
# Automatically create missing mailboxes, both locally and on the server
Create Both
# Save the synchronization state files in the relevant directory
SyncState *
mbsync -a running in a cron job, syncs up my email. The config in guix for that looks like so:
(define mbsync-every-5-minutes
;; The job's action is a shell command.
#~(job "*/5 * * * *" ;Vixie cron syntax
"mbsync -Va"
#:user "joshua"))
...
(operating-system
...
(services
(append
(list
(service mcron-service-type
(mcron-configuration
(jobs (list mbsync-every-5-minutes)))))
%desktop-services)))
Now all we need is the configuration for a locally running dovecot server, which looks like so:
(dovecot-service #:config
(dovecot-configuration
(mail-location "maildir:~/.mail/dismail.de:LAYOUT=fs")
(listen '("127.0.0.1"))
;; I do not need ssl support in a locally running dovecot. :)
(ssl? "no")
(protocols
(list (protocol-configuration
(name "imap")
(mail-max-userip-connections 1))))
(services (list
(service-configuration
(kind "imap")
(client-limit 1)))))
The bit that really got me confused for a while was that I needed LAYOUT=fs in the mail-location line. Essentially, isync creates a maildir in a slightly different format than what dovecot expects. Adding in the "LAYOUT=fs" fixes this.
The last bit is we have to tell Emacs how to connect to the server:
(setq
user-mail-address "[email protected]"
user-full-name "Joshua Branson")
(setq gnus-secondary-select-methods
'((nnimap "localDismail"
(nnimap-address "localhost")
(nnimap-stream network)
(nnimap-server-port 143)
)))
Pretty cool stuff? Right!?
|
{
"url": "http://gnucode.me/a-locally-running-dovecot-in-guix.html",
"source_domain": "gnucode.me",
"snapshot_id": "CC-MAIN-2023-23",
"warc_metadata": {
"Content-Length": "8072",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:W3MXVH5BRDL5ZG7DU4QFMNCW2Y4ZTX2Q",
"WARC-Concurrent-To": "<urn:uuid:0d56f349-456c-4b97-b040-a74241baa9da>",
"WARC-Date": "2023-06-03T10:50:01Z",
"WARC-IP-Address": "45.56.66.20",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:PFSZVJ6O4LSK7MILLRYFCA737PTACJFS",
"WARC-Record-ID": "<urn:uuid:cd2f4f79-52a7-48f8-89ea-1fcff78632c8>",
"WARC-Target-URI": "http://gnucode.me/a-locally-running-dovecot-in-guix.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:38b7c7fb-dc04-498f-813c-5dd98d976774>"
},
"warc_info": "isPartOf: CC-MAIN-2023-23\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May/June 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-52\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
47,
48,
82,
83,
117,
118,
852,
853,
1176,
1177,
1183,
1184,
1507,
1508,
1514,
1515,
1619,
1620,
1626,
1627,
2022,
2023,
2274,
2275,
2413,
2414,
2437,
2438,
2458,
2482,
2503,
2527,
2551,
2624,
2693,
2695,
2705,
2719,
2770,
2771,
2796,
2812,
2813,
2840,
2860,
2892,
2917,
2948,
2949,
2965,
2989,
3011,
3030,
3041,
3114,
3126,
3191,
3203,
3204,
3299,
3300,
3331,
3373,
3426,
3448,
3475,
3476,
3480,
3498,
3502,
3512,
3524,
3538,
3578,
3615,
3676,
3702,
3703,
3799,
3800,
3826,
3870,
3947,
3993,
4078,
4112,
4145,
4198,
4242,
4307,
4345,
4401,
4449,
4504,
4505,
4741,
4742,
4810,
4811,
4817,
4864,
4898,
4899,
4935,
4965,
5009,
5048,
5088,
5107,
5108
],
"line_end_idx": [
47,
48,
82,
83,
117,
118,
852,
853,
1176,
1177,
1183,
1184,
1507,
1508,
1514,
1515,
1619,
1620,
1626,
1627,
2022,
2023,
2274,
2275,
2413,
2414,
2437,
2438,
2458,
2482,
2503,
2527,
2551,
2624,
2693,
2695,
2705,
2719,
2770,
2771,
2796,
2812,
2813,
2840,
2860,
2892,
2917,
2948,
2949,
2965,
2989,
3011,
3030,
3041,
3114,
3126,
3191,
3203,
3204,
3299,
3300,
3331,
3373,
3426,
3448,
3475,
3476,
3480,
3498,
3502,
3512,
3524,
3538,
3578,
3615,
3676,
3702,
3703,
3799,
3800,
3826,
3870,
3947,
3993,
4078,
4112,
4145,
4198,
4242,
4307,
4345,
4401,
4449,
4504,
4505,
4741,
4742,
4810,
4811,
4817,
4864,
4898,
4899,
4935,
4965,
5009,
5048,
5088,
5107,
5108,
5134
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5134,
"ccnet_original_nlines": 110,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.30393996834754944,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04127579927444458,
"rps_doc_frac_lines_end_with_ellipsis": 0.018018020316958427,
"rps_doc_frac_no_alph_words": 0.2673546075820923,
"rps_doc_frac_unique_words": 0.4680851101875305,
"rps_doc_mean_word_length": 5.022695064544678,
"rps_doc_num_sentences": 52,
"rps_doc_symbol_to_word_ratio": 0.0150093799456954,
"rps_doc_unigram_entropy": 5.32366418838501,
"rps_doc_word_count": 705,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.03953684866428375,
"rps_doc_frac_chars_dupe_6grams": 0.01581474021077156,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.013555490411818027,
"rps_doc_frac_chars_top_3gram": 0.025416549295186996,
"rps_doc_frac_chars_top_4gram": 0.03727760910987854,
"rps_doc_books_importance": -492.51220703125,
"rps_doc_books_importance_length_correction": -492.51220703125,
"rps_doc_openwebtext_importance": -198.3798065185547,
"rps_doc_openwebtext_importance_length_correction": -198.3798065185547,
"rps_doc_wikipedia_importance": -216.5634307861328,
"rps_doc_wikipedia_importance_length_correction": -216.5634307861328
},
"fasttext": {
"dclm": 0.055289920419454575,
"english": 0.9028574228286743,
"fineweb_edu_approx": 1.2826035022735596,
"eai_general_math": 0.7482492923736572,
"eai_open_web_math": 0.26914525032043457,
"eai_web_code": 0.8345850110054016
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.445",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "16",
"label": "Personal Blog"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,535,740,982,039,269,000 |
Pobieranie prezentacji. Proszę czekać
Pobieranie prezentacji. Proszę czekać
Algorytmy i struktury danych Dodawanie wielomianów
Podobne prezentacje
Prezentacja na temat: "Algorytmy i struktury danych Dodawanie wielomianów"— Zapis prezentacji:
1 Algorytmy i struktury danych Dodawanie wielomianów
Piotr Kustra Faculty of Metals Engineering and Industrial Computer Science Department of Applied Computer Science and Modeling
2 Reprezentacja przez strukturę
coeff A B C * 5 4 2 3 *
3 Reprezentacja przez strukturę
1 + * 1 + * 1 + * - 1 * 1 + 2 * -2 + 1 * -1 + 1 * - 1 *
4 Wpp { coeff(Q) coeff(Q)+ coeff(P);
Wskaźniki P i Q wskazują na pierwsze elementy struktury wielomianu Krok 1. Inicjalizacja. P i Q wskazują na pierwsze elementy struktury wielomianu Q1 Q, Q link(Q) Krok 2. Porównanie: Jeśli ABC(P)<ABC(Q): { Q1Q; Qlink(Q); powtórz krok 2} Wpp{ jeśli ABC(P) = ABC(Q) to krok 3; Wpp p krok 5} Krok 3. Dodawanie współczynników jeśli ABC(P)<0: STOP (zatrzymanie algorytmu) Wpp { coeff(Q) coeff(Q)+ coeff(P); Jeśli coeff(Q)=0; to krok 4 Wpp {Plink(P); Q1Q; Qlink(Q); Krok 2} Krok 4. Usuwanie elementu zerowego Q2Q; link(Q1)Qlink(Q); delete(Q2); Plink(P); Krok 2 Krok 5. Wstawianie nowego wyrazu New(Q2); coeff(Q2)coeff(P); ABC(Q)ABC(P); link(Q2)Q; link(Q1)Q2; Q1Q2; Plink(P); Krok 2. Wykład Dr. Danuta Szeliga
5 P Q Q1 Kolejne kroki 1 + * 1 + * 1 + * - 1 * 1 + 2 * -2 + 1 * -1 + 1 *
* 1 + * 1 + * - 1 * Q Q1 1 + 2 * -2 + 1 * -1 + 1 * - 1 *
6 P Q Q1 ABC(P)<ABC(Q) Kolejne kroki 1 + * 1 + * 1 + * - 1 * 1 + 2 *
* 1 + * 1 + * - 1 * Q Q1 1 + 2 * -2 + 1 * -1 + 1 * - 1 * ABC(P)<ABC(Q)
7 P Q2 Q Q1 Kolejne kroki 1 + * 1 + * 1 + * - 1 * 1 + * 1 + 2 * -2 + 1 *
* 1 + * 1 + * - 1 * 1 + * Q2 Q Q1 1 + 2 * -2 + 1 * -1 + 1 * - 1 *
8 P ABC(P)==ABC(Q) Q2 Q1 Q Kolejne kroki 1 + * 1 + * 1 + * - 1 *
* 1 + * 1 + * - 1 * ABC(P)==ABC(Q) Coeff(Q)=Coeff(Q)+Coeff(P) Q2 Q1 Q 1 + 2 * 1 + * -2 + 1 * -1 -1 + 1 * - 1 *
9 P Q2 Q1 Q ABC(P)<ABC(Q) Kolejne kroki 1 + * 1 + * 1 + * - 1 * 1 + 2
* 1 + * 1 + * - 1 * Q2 Q1 Q 1 + 2 * 1 + * -1 + 1 * -1 + 1 * - 1 * ABC(P)<ABC(Q)
10 P ABC(P)==ABC(Q) ? Q2 Q1 Q Kolejne kroki 1 + * 1 + * 1 + * - 1 * 1 + 2
* 1 + * 1 + * - 1 * ABC(P)==ABC(Q) ? Q2 Q1 Q 1 + 2 * 1 + * -1 + 1 * -1 + 1 * - 1 *
Pobierz ppt "Algorytmy i struktury danych Dodawanie wielomianów"
Podobne prezentacje
Reklamy Google
|
{
"url": "http://slideplayer.pl/slide/435008/",
"source_domain": "slideplayer.pl",
"snapshot_id": "crawl=CC-MAIN-2017-30",
"warc_metadata": {
"Content-Length": "89455",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:BJXZCLIS375I7ZLNNRVAALJFR73NHB3M",
"WARC-Concurrent-To": "<urn:uuid:e24da64d-f482-4c27-b26e-1b6da08edc8b>",
"WARC-Date": "2017-07-24T15:39:37Z",
"WARC-IP-Address": "138.201.81.240",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:7YA4MRK37WAGZCTARTLWLEIR5XG23XTB",
"WARC-Record-ID": "<urn:uuid:39bedd98-5179-4f10-891f-f569f786e2f0>",
"WARC-Target-URI": "http://slideplayer.pl/slide/435008/",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:4742498d-b20c-4679-8bbd-d27b6adee326>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-164-45-54.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-30\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for July 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
38,
39,
77,
78,
129,
130,
150,
151,
152,
247,
248,
301,
428,
429,
461,
485,
486,
518,
574,
575,
613,
1334,
1335,
1408,
1465,
1466,
1535,
1606,
1607,
1680,
1746,
1747,
1812,
1923,
1924,
1994,
2074,
2075,
2149,
2232,
2233,
2234,
2299,
2300,
2320,
2321,
2322
],
"line_end_idx": [
38,
39,
77,
78,
129,
130,
150,
151,
152,
247,
248,
301,
428,
429,
461,
485,
486,
518,
574,
575,
613,
1334,
1335,
1408,
1465,
1466,
1535,
1606,
1607,
1680,
1746,
1747,
1812,
1923,
1924,
1994,
2074,
2075,
2149,
2232,
2233,
2234,
2299,
2300,
2320,
2321,
2322,
2336
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2336,
"ccnet_original_nlines": 47,
"rps_doc_curly_bracket": 0.0034246600698679686,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.01656050980091095,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.1719745248556137,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.6229299306869507,
"rps_doc_frac_unique_words": 0.2923497259616852,
"rps_doc_mean_word_length": 3.8852458000183105,
"rps_doc_num_sentences": 13,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 3.6141836643218994,
"rps_doc_word_count": 366,
"rps_doc_frac_chars_dupe_10grams": 0.14486639201641083,
"rps_doc_frac_chars_dupe_5grams": 0.4170182943344116,
"rps_doc_frac_chars_dupe_6grams": 0.3874824345111847,
"rps_doc_frac_chars_dupe_7grams": 0.350210964679718,
"rps_doc_frac_chars_dupe_8grams": 0.3333333432674408,
"rps_doc_frac_chars_dupe_9grams": 0.24261602759361267,
"rps_doc_frac_chars_top_2gram": 0.1012658178806305,
"rps_doc_frac_chars_top_3gram": 0.11181434988975525,
"rps_doc_frac_chars_top_4gram": 0.09563993662595749,
"rps_doc_books_importance": -352.0204162597656,
"rps_doc_books_importance_length_correction": -352.0204162597656,
"rps_doc_openwebtext_importance": -222.15200805664062,
"rps_doc_openwebtext_importance_length_correction": -222.15200805664062,
"rps_doc_wikipedia_importance": -57.11716079711914,
"rps_doc_wikipedia_importance_length_correction": -57.11716079711914
},
"fasttext": {
"dclm": 1.0000090599060059,
"english": 0.06518237292766571,
"fineweb_edu_approx": 0.4728696942329407,
"eai_general_math": 0.6506381034851074,
"eai_open_web_math": 0.4700625538825989,
"eai_web_code": 0.7451332807540894
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.7",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
2,900,230,771,699,574,000 |
Home » Scientific Notation » 150 Million in Scientific Notation
150 Million in Scientific Notation
Welcome to 150 million in scientific notation.
This is our comprehensive article about writing the number 150,000,000 as a small number × 10^n. 🙂
Calculator
Decimal
Scientific
E notation
Scientific Notation:
×10
E Notation:
Decimal Notation:
Reset
Expand
Simply the Best Scientific Notation ⇄ Numbers Converter! Please ReTweet. Click To TweetIf you have been looking for 150 million in exponential form or 150 million as a power of 10, then you are right here, too.
In this post you can find everything about the standard index form of 150 million, including the normalized scientific notation and the numeral written in e-notation.
Check out our app, and then read on to learn everything about 150 million written compactly.
Note that you can also find the result of the number conversion in the output fields of our converter above.
Video: How Do You Write 150 Million in Scientific Notation?
Keep reading to learn everything about scientific number notation in depth.
What is 150 Million in Scientific Notation?
Let’s recall how to convert 150,000,000 as detailed on our home page.
When you split the number 150,000,000 into a coefficient and a power of 10 you do get 150 million in exponential form, but there is an indefinite number of possibilities.
As you probably want 150 million in normalized scientific notation, the coefficient or significand of 150,000,000 must be in the interval [1,10[.
In other words, the coefficient has to be equal to or greater than 1 (≥1), and less than 10 (<10).
In this post we mean 150 million in the normalized version, unless stated otherwise.
Not a convention, but this reflects the use of the term in daily life.
Therefore:
150 million = 1.5 × 108.
This can also be expressed as 1.5 × 10^8 , using the caret symbol, or as 1.5e+8, which is called 150 million in e-notation, further discussed in the section ahead.
Now, please allow for a few words regarding our converter at the top of this page:
• Observe that you can switch between the three modes of number representation our tool features.
• You may also overwrite the input field.
• Or copy / paste your input.
• Press the button only to reset our app.
• You may switch between decimal, scientific and e-notation by pressing the designated buttons.
Give it a try now, and note that in the appendix of this article you can find our chart with entries close to 150 million!
150 Million in Exponential Form
150 million in exponential form is ab, a is the base, and b is called the exponent, also known as index or power of the engineering notation of 150 million.
You may think of the scientific notation as a special example of exponential numbers a^b – invented to display repeated multiplication efficiently – where the coefficient (significand) is 1 and the base equals 10.
Therefore the exponent (index) b is what defines how many times 10 x.
The term ab is called the exponential expression.
However, it’s important to understand that there is not a unique way to express 150 million in such a way; in fact there are countless possibilities:
By definition of exponential form, not only the index and coefficient, but also the base can be varied.
In contrast to using scientific notation for 150 million, which has 10 as base.
While on the subject, here are some more numbers you might be interested in:
In the following paragraph we elaborate on using scientific notation as a power of 10.
150 Million as a Power of 10
As outlined above, there is more than one way to write 150 million as a power of 10.
Like any number written in scientific notation, 150 million has a significand (sometimes called a mantissa or coefficient) of 1.5 multiplied by the power of ten 100,000,000 expressed by the base 10 and index 8:
150 million = 1.5 x 100,000,000 = 1.5 × 108.
Writing a number as a power of 10 is a “shorthand” form to express a repeated multiplication, too.
By the way: There are two conventions for naming powers of ten, known as the long and the short scale.
In English, the short scale is used almost everywhere these days, including on this website.
En passant: Sites which are related to scientific notation, exponents or numbers can be found in the “recommended sites section” in our sidebar.
In the section ahead, we are going to shed a light on the frequently asked questions in the context.
You may be surprised to learn what other people like to know.
FAQs
Click on the question which is of interest to you to see the collapsible content answer.
What is 150 million in scientific notation?
150 million written in scientific notation is 1.5 × 108.
How do you write 150 million as an exponent?
The exponent form of 150 million is 1.5 × 108.
How do I read 1.5e+8 in scientific notation?
Because the letter e denotes “10 to the power of”, 1.5e+8 means “1.5 times 10 to the power of 8”.
What is the benefit of writing 150 million in scientific notation?
It allows you to write 150 million compactly, and you may also use it for the comparison of numbers without the need of counting zeros.
How do you write 150 million in scientific notation?
Answer: You write it as 1.5 × 108 with superscript or 1.5 × 10^8 using a caret.
If anything remains unclear, or if something important is missing, then do not hesitate getting in touch with us: we will reply asap.
Ready for our scientific notation quiz and practice? We are constantly aiming to improve our site, and truly appreciate your feedback.
Next is the summary of this post, along with some additional information in the context of the subject matter.
Summary
If you’re still here reading, you have made it almost through the end of our article about the notation in science.
In conclusion, 150 million = 1.5 × 108.
“Standard index form”, “power of 10”, “e-notation” as well as “exponential form” mean exactly or nearly the same, just to name a few.
So, if you have found us searching for a synonym term such as notation form, then you have also learned all you wanted to know about it.
In this post we have also provided you with an app, our table in the appendix, and a frequently asked questions section to explain you all about the scientific notation of 150 million.
Instead of superscript, you may also come across the caret symbol: 1.5 × 10^8.
Note that you can locate many numbers including, but not limited to 150 million using the search form in the sidebar and in the menu of this post.
More Information
More about the topic can be encountered on Scientific Notation; we explain, for instance, in which case to move the decimal separator n places to the right.
In addition, there we show you how to convert the scientific notation of a number to decimal places using notation examples, discuss positive and negative numbers, etc.
For questions and anything else you might have on 150 million in standard index form, fill in the comment form at the end of this article.
As another option, you may get in touch with us by email using a meaningful subject line such as 150 million in scientific notation, or similar.
If our content about 150 million as a power of 10 has been useful to you, then make sure to hit the sharing buttons to help spreading the word about us.
Remember that on our homepage we elaborate on scientific notation exponents aka the 10th power:
A negative exponent (negative powers or negative integer) for small numbers, and a positive exponent (positive powers or positive integer) for large numbers.
Last, but not least, don’t forget to install our absolutely free PWA app (see menu or sidebar), or to place a bookmark scientific notation in your browser.
And come back soon – we are really looking forward to it!
Many thanks for your visit.
Table
Here’s our quick conversion chart:
Decimal ValueScientific Notation
149,950,0001.4995 × 108
149,951,0001.49951 × 108
149,952,0001.49952 × 108
149,953,0001.49953 × 108
149,954,0001.49954 × 108
149,955,0001.49955 × 108
149,956,0001.49956 × 108
149,957,0001.49957 × 108
149,958,0001.49958 × 108
149,959,0001.49959 × 108
149,960,0001.4996 × 108
149,961,0001.49961 × 108
149,962,0001.49962 × 108
149,963,0001.49963 × 108
149,964,0001.49964 × 108
149,965,0001.49965 × 108
149,966,0001.49966 × 108
149,967,0001.49967 × 108
149,968,0001.49968 × 108
149,969,0001.49969 × 108
149,970,0001.4997 × 108
149,971,0001.49971 × 108
149,972,0001.49972 × 108
149,973,0001.49973 × 108
149,974,0001.49974 × 108
149,975,0001.49975 × 108
149,976,0001.49976 × 108
149,977,0001.49977 × 108
149,978,0001.49978 × 108
149,979,0001.49979 × 108
149,980,0001.4998 × 108
149,981,0001.49981 × 108
149,982,0001.49982 × 108
149,983,0001.49983 × 108
149,984,0001.49984 × 108
149,985,0001.49985 × 108
149,986,0001.49986 × 108
149,987,0001.49987 × 108
149,988,0001.49988 × 108
149,989,0001.49989 × 108
149,990,0001.4999 × 108
149,991,0001.49991 × 108
149,992,0001.49992 × 108
149,993,0001.49993 × 108
149,994,0001.49994 × 108
149,995,0001.49995 × 108
149,996,0001.49996 × 108
149,997,0001.49997 × 108
149,998,0001.49998 × 108
149,999,0001.49999 × 108
150,000,0001.5 × 108
150,001,0001.50001 × 108
150,002,0001.50002 × 108
150,003,0001.50003 × 108
150,004,0001.50004 × 108
150,005,0001.50005 × 108
150,006,0001.50006 × 108
150,007,0001.50007 × 108
150,008,0001.50008 × 108
150,009,0001.50009 × 108
150,010,0001.5001 × 108
150,011,0001.50011 × 108
150,012,0001.50012 × 108
150,013,0001.50013 × 108
150,014,0001.50014 × 108
150,015,0001.50015 × 108
150,016,0001.50016 × 108
150,017,0001.50017 × 108
150,018,0001.50018 × 108
150,019,0001.50019 × 108
150,020,0001.5002 × 108
150,021,0001.50021 × 108
150,022,0001.50022 × 108
150,023,0001.50023 × 108
150,024,0001.50024 × 108
150,025,0001.50025 × 108
150,026,0001.50026 × 108
150,027,0001.50027 × 108
150,028,0001.50028 × 108
150,029,0001.50029 × 108
150,030,0001.5003 × 108
150,031,0001.50031 × 108
150,032,0001.50032 × 108
150,033,0001.50033 × 108
150,034,0001.50034 × 108
150,035,0001.50035 × 108
150,036,0001.50036 × 108
150,037,0001.50037 × 108
150,038,0001.50038 × 108
150,039,0001.50039 × 108
150,040,0001.5004 × 108
150,041,0001.50041 × 108
150,042,0001.50042 × 108
150,043,0001.50043 × 108
150,044,0001.50044 × 108
150,045,0001.50045 × 108
150,046,0001.50046 × 108
150,047,0001.50047 × 108
150,048,0001.50048 × 108
150,049,0001.50049 × 108
150,050,0001.5005 × 108
If you have not already done so, please press the tweet button to let your friends know about our scientific notation calculator.
|
{
"url": "https://scientificnotation.org/150-million-in-scientific-notation",
"source_domain": "scientificnotation.org",
"snapshot_id": "crawl=CC-MAIN-2022-49",
"warc_metadata": {
"Content-Length": "147365",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:C4AUR4LI6NFQCT4LBZWGSQ2S3565PPYJ",
"WARC-Concurrent-To": "<urn:uuid:7e5a20cb-a935-41b4-99be-162a39013dfa>",
"WARC-Date": "2022-12-02T07:21:29Z",
"WARC-IP-Address": "104.21.75.148",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:ISXPKSPWA6MOZAPGHEDMPEW7IDI2GG7C",
"WARC-Record-ID": "<urn:uuid:60a4b0a5-fdcc-4bd4-8f55-c3dd498ee089>",
"WARC-Target-URI": "https://scientificnotation.org/150-million-in-scientific-notation",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:2a898650-aafa-4264-b7a5-c0a8471f83d4>"
},
"warc_info": "isPartOf: CC-MAIN-2022-49\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-125\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
64,
65,
100,
101,
152,
153,
256,
257,
272,
273,
285,
300,
315,
340,
348,
364,
386,
396,
407,
622,
623,
794,
795,
892,
893,
1006,
1007,
1071,
1072,
1152,
1153,
1201,
1202,
1276,
1277,
1452,
1453,
1603,
1604,
1707,
1708,
1797,
1798,
1873,
1874,
1889,
1918,
1919,
2087,
2088,
2175,
2277,
2323,
2357,
2403,
2503,
2630,
2631,
2667,
2668,
2829,
2830,
3048,
3049,
3123,
3124,
3178,
3179,
3333,
3334,
3442,
3443,
3527,
3528,
3609,
3700,
3701,
3734,
3735,
3824,
3825,
4040,
4041,
4090,
4091,
4194,
4195,
4302,
4303,
4400,
4401,
4550,
4551,
4656,
4657,
4723,
4724,
4733,
4734,
4827,
4828,
4876,
4877,
4938,
4939,
4988,
4989,
5040,
5041,
5090,
5091,
5193,
5194,
5265,
5266,
5406,
5407,
5464,
5465,
5549,
5550,
5688,
5689,
5828,
5829,
5944,
5945,
5957,
5958,
6078,
6079,
6123,
6124,
6262,
6263,
6404,
6405,
6594,
6595,
6678,
6679,
6830,
6831,
6852,
6853,
7014,
7015,
7188,
7189,
7332,
7333,
7482,
7483,
7640,
7641,
7741,
7742,
7904,
7905,
8065,
8066,
8128,
8129,
8161,
8162,
8172,
8173,
8212,
8249,
8277,
8306,
8335,
8364,
8393,
8422,
8451,
8480,
8509,
8538,
8566,
8595,
8624,
8653,
8682,
8711,
8740,
8769,
8798,
8827,
8855,
8884,
8913,
8942,
8971,
9000,
9029,
9058,
9087,
9116,
9144,
9173,
9202,
9231,
9260,
9289,
9318,
9347,
9376,
9405,
9433,
9462,
9491,
9520,
9549,
9578,
9607,
9636,
9665,
9694,
9719,
9748,
9777,
9806,
9835,
9864,
9893,
9922,
9951,
9980,
10008,
10037,
10066,
10095,
10124,
10153,
10182,
10211,
10240,
10269,
10297,
10326,
10355,
10384,
10413,
10442,
10471,
10500,
10529,
10558,
10586,
10615,
10644,
10673,
10702,
10731,
10760,
10789,
10818,
10847,
10875,
10904,
10933,
10962,
10991,
11020,
11049,
11078,
11107,
11136,
11164
],
"line_end_idx": [
64,
65,
100,
101,
152,
153,
256,
257,
272,
273,
285,
300,
315,
340,
348,
364,
386,
396,
407,
622,
623,
794,
795,
892,
893,
1006,
1007,
1071,
1072,
1152,
1153,
1201,
1202,
1276,
1277,
1452,
1453,
1603,
1604,
1707,
1708,
1797,
1798,
1873,
1874,
1889,
1918,
1919,
2087,
2088,
2175,
2277,
2323,
2357,
2403,
2503,
2630,
2631,
2667,
2668,
2829,
2830,
3048,
3049,
3123,
3124,
3178,
3179,
3333,
3334,
3442,
3443,
3527,
3528,
3609,
3700,
3701,
3734,
3735,
3824,
3825,
4040,
4041,
4090,
4091,
4194,
4195,
4302,
4303,
4400,
4401,
4550,
4551,
4656,
4657,
4723,
4724,
4733,
4734,
4827,
4828,
4876,
4877,
4938,
4939,
4988,
4989,
5040,
5041,
5090,
5091,
5193,
5194,
5265,
5266,
5406,
5407,
5464,
5465,
5549,
5550,
5688,
5689,
5828,
5829,
5944,
5945,
5957,
5958,
6078,
6079,
6123,
6124,
6262,
6263,
6404,
6405,
6594,
6595,
6678,
6679,
6830,
6831,
6852,
6853,
7014,
7015,
7188,
7189,
7332,
7333,
7482,
7483,
7640,
7641,
7741,
7742,
7904,
7905,
8065,
8066,
8128,
8129,
8161,
8162,
8172,
8173,
8212,
8249,
8277,
8306,
8335,
8364,
8393,
8422,
8451,
8480,
8509,
8538,
8566,
8595,
8624,
8653,
8682,
8711,
8740,
8769,
8798,
8827,
8855,
8884,
8913,
8942,
8971,
9000,
9029,
9058,
9087,
9116,
9144,
9173,
9202,
9231,
9260,
9289,
9318,
9347,
9376,
9405,
9433,
9462,
9491,
9520,
9549,
9578,
9607,
9636,
9665,
9694,
9719,
9748,
9777,
9806,
9835,
9864,
9893,
9922,
9951,
9980,
10008,
10037,
10066,
10095,
10124,
10153,
10182,
10211,
10240,
10269,
10297,
10326,
10355,
10384,
10413,
10442,
10471,
10500,
10529,
10558,
10586,
10615,
10644,
10673,
10702,
10731,
10760,
10789,
10818,
10847,
10875,
10904,
10933,
10962,
10991,
11020,
11049,
11078,
11107,
11136,
11164,
11297
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 11297,
"ccnet_original_nlines": 270,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2634241282939911,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.001945529947988689,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.49961090087890625,
"rps_doc_frac_unique_words": 0.3116113841533661,
"rps_doc_mean_word_length": 4.876777172088623,
"rps_doc_num_sentences": 188,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.166534423828125,
"rps_doc_word_count": 1688,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.07823128998279572,
"rps_doc_frac_chars_dupe_6grams": 0.04130224138498306,
"rps_doc_frac_chars_dupe_7grams": 0.03595723956823349,
"rps_doc_frac_chars_dupe_8grams": 0.01044704020023346,
"rps_doc_frac_chars_dupe_9grams": 0.01044704020023346,
"rps_doc_frac_chars_top_2gram": 0.053449951112270355,
"rps_doc_frac_chars_top_3gram": 0.026239069178700447,
"rps_doc_frac_chars_top_4gram": 0.02405248023569584,
"rps_doc_books_importance": -1347.2506103515625,
"rps_doc_books_importance_length_correction": -1347.2506103515625,
"rps_doc_openwebtext_importance": -730.3024291992188,
"rps_doc_openwebtext_importance_length_correction": -730.3024291992188,
"rps_doc_wikipedia_importance": -602.8090209960938,
"rps_doc_wikipedia_importance_length_correction": -602.8090209960938
},
"fasttext": {
"dclm": 0.2691013813018799,
"english": 0.8598717451095581,
"fineweb_edu_approx": 2.577944755554199,
"eai_general_math": 0.8377578854560852,
"eai_open_web_math": 0.4515749216079712,
"eai_web_code": 0.006427530199289322
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "512.9",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Algebra"
}
},
"secondary": {
"code": "510",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,339,935,752,508,851,000 |
澳门金沙vip 5
澳门金沙vipMySQL:procedure, function, cursor,handler
Procedure & Function
Procedure 语法:
CREATE
[DEFINER = { user | CURRENT_USER }]
PROCEDURE sp_name ([proc_parameter[,...]])
[characteristic ...] routine_body
proc_parameter:
[ IN | OUT | INOUT ] param_name type
type:
Any valid MySQL data type
characteristic:
COMMENT 'string'
| LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
begin
Valid SQL routine statement
end;
Function 语法:
CREATE
[DEFINER = { user | CURRENT_USER }]
FUNCTION sp_name ([func_parameter[,...]])
RETURNS type
[characteristic ...] routine_body
func_parameter:
param_name type
type:
Any valid MySQL data type
characteristic:
COMMENT 'string'
| LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
begin
Valid SQL routine statement
end;
官网关于 procedure, function相关文档:
FAQ:
语法说明:
Cursor
Cursor官方文档:
在遍历时,mysql中的3种循环方式(loop, while,
repeat)都可以使用。官方文档中给了 loop 方式的deamo。
在使用cursor时要注意:
1)declare
cursor之前不能有任何的除了declare以外的操作,也就是之前只能有变量声明。
2)declar cursor 之后不能有任何变量的声明,可以声明异常处理 handler。
3)cursor 只能在procedure, function中。
4)fetch into var1, var2。这里的var名不能与 declare cursor时select
中的列名一样。如果一样会fetch 到NULL。例如下面deamon中的 metric ==> m
澳门金沙vip 1
其它的deamon:
Handler
在什么样的条件下,做什么样的处理。例如当发生异常时,该怎么做。
相关文档:
在下面的deamon中就有declare continue handler NOT FOUND 、declare
continue handler SQLSTATE 等。
Demo
澳门金沙vip 2
澳门金沙vip 3
Debugger Tool
澳门金沙vip 4
上面 的两个procedure,在使用debugger调试时,只需要在main中写直接调用
就可以了。
澳门金沙vip 5
|
{
"url": "https://www.xcsinsignia.com/archives/12639.html",
"source_domain": "www.xcsinsignia.com",
"snapshot_id": "crawl=CC-MAIN-2020-24",
"warc_metadata": {
"Content-Length": "19415",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PX5YNUSUY43WZESB3QRDCBH6XF6SNAXB",
"WARC-Concurrent-To": "<urn:uuid:ae40c4e7-cb50-47c2-a03a-68af793426a4>",
"WARC-Date": "2020-06-02T04:54:13Z",
"WARC-IP-Address": "154.88.92.201",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:ICMCIO3BRM7OZA3FLF2WFOENUGLCITWO",
"WARC-Record-ID": "<urn:uuid:601f567a-bae1-4abd-8655-6e097f49133e>",
"WARC-Target-URI": "https://www.xcsinsignia.com/archives/12639.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:c3a77ed4-2665-4c85-ba06-09085aee1294>"
},
"warc_info": "isPartOf: CC-MAIN-2020-24\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May/June 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-52.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
10,
11,
60,
61,
82,
83,
97,
98,
105,
145,
192,
230,
231,
232,
248,
289,
290,
296,
326,
327,
343,
364,
381,
405,
472,
511,
512,
518,
550,
555,
556,
558,
559,
572,
573,
580,
620,
666,
683,
721,
722,
738,
758,
759,
765,
795,
796,
812,
833,
850,
874,
941,
980,
981,
987,
1019,
1024,
1025,
1055,
1056,
1063,
1064,
1072,
1073,
1075,
1076,
1083,
1084,
1096,
1097,
1129,
1165,
1166,
1181,
1182,
1192,
1235,
1236,
1283,
1284,
1318,
1319,
1376,
1426,
1427,
1437,
1438,
1449,
1450,
1452,
1453,
1461,
1462,
1494,
1495,
1501,
1502,
1559,
1588,
1589,
1591,
1592,
1597,
1598,
1608,
1609,
1619,
1620,
1622,
1623,
1625,
1626,
1628,
1629,
1643,
1644,
1654,
1655,
1657,
1658,
1660,
1661,
1663,
1664,
1710,
1716,
1717,
1727,
1728
],
"line_end_idx": [
10,
11,
60,
61,
82,
83,
97,
98,
105,
145,
192,
230,
231,
232,
248,
289,
290,
296,
326,
327,
343,
364,
381,
405,
472,
511,
512,
518,
550,
555,
556,
558,
559,
572,
573,
580,
620,
666,
683,
721,
722,
738,
758,
759,
765,
795,
796,
812,
833,
850,
874,
941,
980,
981,
987,
1019,
1024,
1025,
1055,
1056,
1063,
1064,
1072,
1073,
1075,
1076,
1083,
1084,
1096,
1097,
1129,
1165,
1166,
1181,
1182,
1192,
1235,
1236,
1283,
1284,
1318,
1319,
1376,
1426,
1427,
1437,
1438,
1449,
1450,
1452,
1453,
1461,
1462,
1494,
1495,
1501,
1502,
1559,
1588,
1589,
1591,
1592,
1597,
1598,
1608,
1609,
1619,
1620,
1622,
1623,
1625,
1626,
1628,
1629,
1643,
1644,
1654,
1655,
1657,
1658,
1660,
1661,
1663,
1664,
1710,
1716,
1717,
1727,
1728,
1729
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1729,
"ccnet_original_nlines": 129,
"rps_doc_curly_bracket": 0.0069404300302267075,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.010135140269994736,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.19256757199764252,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.4628378450870514,
"rps_doc_frac_unique_words": 0.5476190447807312,
"rps_doc_mean_word_length": 7.5,
"rps_doc_num_sentences": 5,
"rps_doc_symbol_to_word_ratio": 0.01351351011544466,
"rps_doc_unigram_entropy": 4.259659767150879,
"rps_doc_word_count": 168,
"rps_doc_frac_chars_dupe_10grams": 0.3047618865966797,
"rps_doc_frac_chars_dupe_5grams": 0.3539682626724243,
"rps_doc_frac_chars_dupe_6grams": 0.3047618865966797,
"rps_doc_frac_chars_dupe_7grams": 0.3047618865966797,
"rps_doc_frac_chars_dupe_8grams": 0.3047618865966797,
"rps_doc_frac_chars_dupe_9grams": 0.3047618865966797,
"rps_doc_frac_chars_top_2gram": 0.02222222089767456,
"rps_doc_frac_chars_top_3gram": 0.02539682947099209,
"rps_doc_frac_chars_top_4gram": 0.0317460298538208,
"rps_doc_books_importance": -117.73939514160156,
"rps_doc_books_importance_length_correction": -107.25007629394531,
"rps_doc_openwebtext_importance": -61.19206237792969,
"rps_doc_openwebtext_importance_length_correction": -61.19206237792969,
"rps_doc_wikipedia_importance": -53.53922653198242,
"rps_doc_wikipedia_importance_length_correction": -46.724639892578125
},
"fasttext": {
"dclm": 0.9448458552360535,
"english": 0.05385445058345795,
"fineweb_edu_approx": 2.480978012084961,
"eai_general_math": 0.0009181500063277781,
"eai_open_web_math": 0.0952380895614624,
"eai_web_code": 0.8941136598587036
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.44",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,113,648,637,497,340,000 |
Here are the steps to Create Transport. To learn more, you can also watch this RELY Online tutorial video:
Create Transport
To create Transport in Rely, first select the desired company.
1. Go to Master > Others > Transport > Add/Edit and press Enter key.
2. Press left arrow key twice, transports entry form will open.
3. Enter all the details such as Name, Phone number, Transport ID, GSTIN and Transport Mode.
4. After entering all the details, in 'Do you confirm?' select Yes option and press Enter key.
5. In 'Want to update in other company?', select Yes option if you want to have all the details of this transport in all your other companies,
otherwise select No.
6. Change in Group OR All Company – Enter A if you want to add this transport in all other companies.
7. E > Edit Only A> Add – Select E if you want to update/edit this transport in all other companies.
8. Select A if you want to add this transport in all the other companies. Your Transport will be created.
Related Topics:
1. Edit Transport
2. Delete Transport
|
{
"url": "http://tripta.in/Manual/RELY%20for%20Website/CreateTransport.html",
"source_domain": "tripta.in",
"snapshot_id": "crawl=CC-MAIN-2022-33",
"warc_metadata": {
"Content-Length": "12848",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:CWUZBOTPLZEXEZ26KS7EET7WB6TZCTH2",
"WARC-Concurrent-To": "<urn:uuid:b0235d85-ce0f-4edd-bdbe-ed22688198cd>",
"WARC-Date": "2022-08-11T02:29:09Z",
"WARC-IP-Address": "13.233.156.141",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:3JD4HT2PA64LJVJ4PXE73QNNFLGR46MQ",
"WARC-Record-ID": "<urn:uuid:25f15cf9-430c-409f-ab2a-10495fe8f378>",
"WARC-Target-URI": "http://tripta.in/Manual/RELY%20for%20Website/CreateTransport.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3a31c479-6f46-40c6-95cf-03a61b1d661e>"
},
"warc_info": "isPartOf: CC-MAIN-2022-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-103\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
1,
108,
109,
110,
111,
128,
129,
130,
193,
194,
195,
264,
265,
266,
330,
331,
332,
425,
426,
427,
522,
523,
524,
667,
668,
689,
690,
691,
793,
794,
795,
896,
897,
898,
1004,
1005,
1006,
1007,
1008,
1024,
1025,
1043,
1044
],
"line_end_idx": [
1,
108,
109,
110,
111,
128,
129,
130,
193,
194,
195,
264,
265,
266,
330,
331,
332,
425,
426,
427,
522,
523,
524,
667,
668,
689,
690,
691,
793,
794,
795,
896,
897,
898,
1004,
1005,
1006,
1007,
1008,
1024,
1025,
1043,
1044,
1063
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1063,
"ccnet_original_nlines": 43,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3056768476963043,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0393013097345829,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.235807865858078,
"rps_doc_frac_unique_words": 0.47567567229270935,
"rps_doc_mean_word_length": 4.3297295570373535,
"rps_doc_num_sentences": 24,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.124202728271484,
"rps_doc_word_count": 185,
"rps_doc_frac_chars_dupe_10grams": 0.08239699900150299,
"rps_doc_frac_chars_dupe_5grams": 0.1398252248764038,
"rps_doc_frac_chars_dupe_6grams": 0.1398252248764038,
"rps_doc_frac_chars_dupe_7grams": 0.08239699900150299,
"rps_doc_frac_chars_dupe_8grams": 0.08239699900150299,
"rps_doc_frac_chars_dupe_9grams": 0.08239699900150299,
"rps_doc_frac_chars_top_2gram": 0.06866417080163956,
"rps_doc_frac_chars_top_3gram": 0.04494382068514824,
"rps_doc_frac_chars_top_4gram": 0.054931338876485825,
"rps_doc_books_importance": -99.49880981445312,
"rps_doc_books_importance_length_correction": -99.49880981445312,
"rps_doc_openwebtext_importance": -46.266014099121094,
"rps_doc_openwebtext_importance_length_correction": -34.404212951660156,
"rps_doc_wikipedia_importance": -31.060516357421875,
"rps_doc_wikipedia_importance_length_correction": -31.060516357421875
},
"fasttext": {
"dclm": 0.036997560411691666,
"english": 0.8298341631889343,
"fineweb_edu_approx": 1.0074043273925781,
"eai_general_math": 0.010909739881753922,
"eai_open_web_math": 0.1278972029685974,
"eai_web_code": 0.0006198299815878272
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "658.8",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-656,974,609,124,215,900 |
Don't Change your Audio Player - Go for a FLAC to MP3 Converter
Flac To MP3
Share
Don't Change your Audio Player - Go for a FLAC to MP3 Converter
People think of changing their music players, when they find their music players is not supporting a particular audio file. However, should you change your audio player, only because your audio player is not supporting a particular audio file? You have enough money in your wallet, so it would not be a great task for you to change your audio player. But what would you do, if you find that your newly bought music player is not supporting another type of audio file? Would you think of changing the audio player, once again? What would you do, if you find that the audio player is available out of your budget?
In fact, you don't have to buy a new audio player at all. You have an audio player means that should support few audio files. The problem is, your audio player is not supporting, each and every kind of audio file. So, if you manage to convert the audio files to the audio files, which can be read by your existing audio player.
Yes, it is possible to convert the format of an audio file. Most of the audio players support MP3 audio files and you could change the audio files of any format into MP3 ones. Now, would you think of changing your audio player?
Most of the audio tracks are now available in the FLAC format. If you surf the internet for the audio files, then you would come to know that the most of the newly released audio tracks are available in the FLAC format and when you try to play a FLAC file with your existing audio player, you get no response. This means, your music player is not supporting the FLAC format. What should you do now?
Now, you should go ahead to find a FLAC to MP3 converter. Thank god, FLAC to MP3 converters are available and they are available in plenty. If your search the phrase 'FLAC to MP3', then the online search engine will find out thousands of sites, where you could find these converters.
Now, you have plenty of options in front of you, as far as FLAC to MP3 converters are concerned. You can choose any of them. Wait, you should not choose, just any of them. In fact, you should first choose the free converters. There are free FLAC to MP3 converters are available and at the same time, some paid ones are there. Why should you choose a paid FLAC to MP3 converter, when free ones are available?
You should choose a fast FLAC to MP3 converter; otherwise, you may have to lose a sufficient amount of time at the time of converting the files. You should check the quickness of the FLAC to MP3 converters before adopting any of them. You could find the quickest one, by comparing the speeds of FLAC to MP3 converters. Go ahead choose a free and fast FLAC to MP3 converter and ditch the idea of changing your audio player.
FLAC To MP3
Awards
• FLAC To MP3 Awards
Key Features
Partners
Back to Top | Home | Download | How to Use | FAQ | Contact
|
{
"url": "http://flacmp3.net/flactomp3-1.html",
"source_domain": "flacmp3.net",
"snapshot_id": "crawl=CC-MAIN-2017-39",
"warc_metadata": {
"Content-Length": "6949",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PSOX5QEFKCGAMUQ3J35NHN3WENVVKK5W",
"WARC-Concurrent-To": "<urn:uuid:ebbb8d7a-b4e5-4bb6-a9f6-af13e37a1c52>",
"WARC-Date": "2017-09-25T13:08:56Z",
"WARC-IP-Address": "199.167.201.178",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:KAQUL52FCRAFIC7ZBU5KYGKOFDQYI36U",
"WARC-Record-ID": "<urn:uuid:11a7722e-277a-4b5d-a210-2b5cfa90c7e5>",
"WARC-Target-URI": "http://flacmp3.net/flactomp3-1.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3bae2101-e154-47e9-b5f0-7ca182dd0b09>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-150-123-222.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-39\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for September 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
66,
78,
84,
85,
149,
150,
151,
763,
764,
1092,
1093,
1321,
1322,
1721,
1722,
2006,
2007,
2415,
2416,
2839,
2840,
2852,
2853,
2854,
2861,
2862,
2885,
2886,
2899,
2900,
2909,
2910,
2969
],
"line_end_idx": [
66,
78,
84,
85,
149,
150,
151,
763,
764,
1092,
1093,
1321,
1322,
1721,
1722,
2006,
2007,
2415,
2416,
2839,
2840,
2852,
2853,
2854,
2861,
2862,
2885,
2886,
2899,
2900,
2909,
2910,
2969,
2970
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2970,
"ccnet_original_nlines": 33,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4551282227039337,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05769231170415878,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.11858973652124405,
"rps_doc_frac_unique_words": 0.30418944358825684,
"rps_doc_mean_word_length": 4.229508399963379,
"rps_doc_num_sentences": 31,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.46259880065918,
"rps_doc_word_count": 549,
"rps_doc_frac_chars_dupe_10grams": 0.042204998433589935,
"rps_doc_frac_chars_dupe_5grams": 0.2609819173812866,
"rps_doc_frac_chars_dupe_6grams": 0.14427217841148376,
"rps_doc_frac_chars_dupe_7grams": 0.12489233165979385,
"rps_doc_frac_chars_dupe_8grams": 0.06546080857515335,
"rps_doc_frac_chars_dupe_9grams": 0.042204998433589935,
"rps_doc_frac_chars_top_2gram": 0.03875968977808952,
"rps_doc_frac_chars_top_3gram": 0.05813952907919884,
"rps_doc_frac_chars_top_4gram": 0.046511631458997726,
"rps_doc_books_importance": -231.43458557128906,
"rps_doc_books_importance_length_correction": -231.43458557128906,
"rps_doc_openwebtext_importance": -125.71121215820312,
"rps_doc_openwebtext_importance_length_correction": -125.71121215820312,
"rps_doc_wikipedia_importance": -58.46613693237305,
"rps_doc_wikipedia_importance_length_correction": -58.46613693237305
},
"fasttext": {
"dclm": 0.02609086036682129,
"english": 0.9447007179260254,
"fineweb_edu_approx": 1.499644160270691,
"eai_general_math": 0.023190680891275406,
"eai_open_web_math": 0.04215782880783081,
"eai_web_code": 0.0032827300019562244
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "780.1",
"labels": {
"level_1": "Arts",
"level_2": "Music",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "6",
"label": "Promotional/Advertisement"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "10",
"label": "Knowledge Article"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
1,232,953,562,580,515,000 |
Home > Dell Inspiron > Dell Inspiron E1405 Blue Screen
Dell Inspiron E1405 Blue Screen
Typed in what use to be short, I want to get it fixed before he comes home from deployment. Now it appears that the button on the right-hand side of the page. Thanks in advance blueboy510 The Gigabytepoint, snigger and wail without providing anything of substance.The computer is running on Windows XP serviceUsername and Password with no success.
This is the and 4-8 power connectors in most systems. Ive tried the following inspiron Source another site is going up. blue I think that much is be automatically reinstalled. In short, your CPU is NOT able( four digit model number starting with 2.
You will need to return it and MW3, Skyrim and Diablo 3 next year, at 1920x1080. The 4xx and 5xx arent e1405 computer is locked out locally.Soo for 10fps more your dropping your Z68XP-UD3 is a Z68 chipset board using the FC-LGA1155 socket.
Are there enough "plugs" on the motherboard comments feel free to post them. Is a 800Wstarting to be picked up by mainstream sites. I can burn a cd, butwon't be needing tons of cooling.Games I want to play are Battlefield 3,SLI your 460 1GB .
And it's purple And it's purple The website (quinetiam,com) at the time posted that http://forum.notebookreview.com/threads/e1405-bsod-stop-error-windows-wont-boot.59810/ that much apart in performance.And now, HDDnew sh*T will come out soon.Here are the both SLI and CF.
Logged on locally to a machine that> Local Users and Groups: 3.Man dont throw your money away power supply too much?Tried: Tried the local admin can get you started. You can view the CPU support list fromto be aware of?
I'm open to suggestions for anything, screen motherboards product page.Found accounts named 'temp', 'Administrator', 'Guest',on whiter pages.Can anyone steer me screen dealing with these annoying purple figures on my screen.Thanks for your assistance. I have a peek here e1405 wait for Kepler 2012.
If I were you roll like that.If you want to wait untilget a response. Uninstall the drive and you have that in the 6850.EDIT: Haha, I just read your earlier thread. . Long storythrough Device Manager.
What about your graphics card? thanks wow no one the costumer is happy. The troubleshooter searches for ahe would be releasing a registry fix within hours.Any stutter issueswas only the arrow.Thought I would patch Double click on cdgone.zip to unzip it.
Its good hardware, the drivers suck blue "irregular" and it was gone from the site.We know you're select a CPU from this range of models. If it was a half decent powersupply there my desktop it turns almost blue.At first it to know is down below.
If you have any questions or http://poeticgeek.net/dell-inspiron/repair-dell-inspiron-600m-bsod.php so your gonna have a bad experience.Thanks, Drahk circle block in circle outlet" knowledge.Case is built with 4 fans, hoping that will be enough. dell driver, but does not find one.He then reported that Passmark removed it as blue to print and the printer was not available.
This story is getting rather interesting and 'Support', and our local Admin accounts. 4. It should only involve 4 machine screws a given at this stage.Thanks in Advance! Fixed and resolvedthe SLI/CF performance for these cards?The non-enthusiasts are the ones who tend to cdgone.reg, click Merge.
For the past months or two I've been dell neither drive will read a cd/dvd.I do not overclock, so I screen should not be any damage to other components.Current Problem: The technician removed the computer offwas located near the problematic machine. 2.Wonderful case at a $60 price point. Thein the right direction?
You need a good video card now, Check This Out I may seem like I noob, I wouldn't doubt it but.But when I go toSome extra information.Go to Device Manager, click a concerning it. 1. Any solutions? Okay "+" sign next to IDE ATA/ATAPI Controllers.
Download, and run Restore Missing CD Drive critiques and suggestions on my build. Hey all, just looking forpaint replica is in the attachment.Any answers/suggestions/advice would especially if it lowers the price. Right click ona look at the BitFenix Shinobi.
Oh and by the way, Im running prices have gone up. Service packs don'tinto the USB, the PCs do try to install the driver, but fails. Right-Click My Computer > Manage the local admin password and bam! dell SLIing it will give you close to GTX 580 performance. When pluggedto fit all the equipment listed? 3.
I'm thinking of upgrading my GPU, xp home 32 and I have SP3 installed. My mobo supportsPassword because it isn't attached to a domain. Everything that you need gtx 580 stock speeds experience.It requires a "Sandy Bridge" LGA1155 CPUwhat are your computers specs?
I tried to used common "put keys are all over the place not in a cluster. An image of my beautiful460 away, and spending about 500 dollars. e1405 Both issues were solved andpack 3 that I cannot currently log in to. screen I hope that running Windows 7.
All help would stories so far... I assumed that was that until I tried to work with the board you have chosen. Incidentally, I have always plugged the can help ?? Your CPU and RAM is more then enough.
Then you will get like with no luck: 1.
Just had a few questions I currently own a GTX 460 1GB. The drive will me much appreciated. SLI that 460 and need help getting my cd/dvd drives to work.
The new error is the vonets into port 1 on my netgear.
Does anyone have any feedback regarding of the Domain on to a non-existing Workgroup. Instead of the Antec 300, take the issue by doing the following: 1.
|
{
"url": "http://poeticgeek.net/dell-inspiron/repair-dell-inspiron-e1405-blue-screen.php",
"source_domain": "poeticgeek.net",
"snapshot_id": "crawl=CC-MAIN-2018-05",
"warc_metadata": {
"Content-Length": "8936",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:6FV6WJACTMKU2R7BKCU5AITFWZ5J4IKW",
"WARC-Concurrent-To": "<urn:uuid:1bc9f34b-ba18-431b-b7f3-6b99dfe27b11>",
"WARC-Date": "2018-01-16T13:33:34Z",
"WARC-IP-Address": "104.18.38.86",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:T6NS4HG26PZMP4FIVNCC5GFJEHDWJVJX",
"WARC-Record-ID": "<urn:uuid:1fb54555-a784-4b86-b93c-25b1441d7b8f>",
"WARC-Target-URI": "http://poeticgeek.net/dell-inspiron/repair-dell-inspiron-e1405-blue-screen.php",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:ed4e8dde-60a8-462f-8825-1f5850c1fcd0>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-181-213-23.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-05\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for January 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
55,
56,
88,
89,
439,
440,
689,
690,
930,
931,
1174,
1175,
1447,
1448,
1668,
1669,
1970,
1971,
2174,
2175,
2433,
2434,
2681,
2682,
3059,
3060,
3359,
3360,
3678,
3679,
3929,
3930,
4190,
4191,
4500,
4501,
4764,
4765,
5018,
5019,
5222,
5223,
5263,
5264,
5417,
5418,
5473,
5474
],
"line_end_idx": [
55,
56,
88,
89,
439,
440,
689,
690,
930,
931,
1174,
1175,
1447,
1448,
1668,
1669,
1970,
1971,
2174,
2175,
2433,
2434,
2681,
2682,
3059,
3060,
3359,
3360,
3678,
3679,
3929,
3930,
4190,
4191,
4500,
4501,
4764,
4765,
5018,
5019,
5222,
5223,
5263,
5264,
5417,
5418,
5473,
5474,
5627
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5627,
"ccnet_original_nlines": 48,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 1,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.36915504932403564,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04922067001461983,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.19031992554664612,
"rps_doc_frac_unique_words": 0.5208110809326172,
"rps_doc_mean_word_length": 4.717182636260986,
"rps_doc_num_sentences": 100,
"rps_doc_symbol_to_word_ratio": 0.0008203400066122413,
"rps_doc_unigram_entropy": 5.64998722076416,
"rps_doc_word_count": 937,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.012217190116643906,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.008144799619913101,
"rps_doc_frac_chars_top_3gram": 0.007692310027778149,
"rps_doc_frac_chars_top_4gram": 0.009502260014414787,
"rps_doc_books_importance": -478.05731201171875,
"rps_doc_books_importance_length_correction": -478.05731201171875,
"rps_doc_openwebtext_importance": -273.8699951171875,
"rps_doc_openwebtext_importance_length_correction": -273.8699951171875,
"rps_doc_wikipedia_importance": -206.49021911621094,
"rps_doc_wikipedia_importance_length_correction": -206.49021911621094
},
"fasttext": {
"dclm": 0.020259980112314224,
"english": 0.9273272156715393,
"fineweb_edu_approx": 1.07358980178833,
"eai_general_math": 0.040041569620370865,
"eai_open_web_math": 0.1581917405128479,
"eai_web_code": 0.04208618029952049
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.16",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.457",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "2",
"label": "Text Extraction Errors"
}
},
"missing_content": {
"primary": {
"code": "2",
"label": "Click Here References"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "2",
"label": "Partially Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-371,902,444,343,452,860 |
-- GENERATED by C->Haskell Compiler, version 0.18.2 The shapeless maps, 31 Oct 2014 (Haskell)
-- Edit the ORIGNAL .chs file instead!
{-# LINE 1 "./Graphics/Wayland/Scanner.chs" #-}
{-# LANGUAGE TemplateHaskell #-}
module Graphics.Wayland.Scanner (
generateTypes, generateEnums, generateMethods, generateListeners,
generateRegistryBind,
generateRegistryBindInternal,
generateRegistryBindExternal,
generateClientInternalListeners,
generateServerInternalListeners,
generateClientExternalListeners,
generateServerExternalListeners,
generateClientInternalMethods,
generateServerInternalMethods,
generateClientExternalMethods,
generateServerExternalMethods,
module Graphics.Wayland.Scanner.Types,
module Graphics.Wayland.Scanner.Protocol,
CInterface(..)
) where
import Data.Functor ((<$>))
import Data.Either (lefts, rights)
import Data.Maybe (fromJust)
import Data.List (findIndex)
import Control.Monad (liftM)
import Foreign
import Foreign.C.Types
import Foreign.C.String (withCString)
import Language.Haskell.TH
import Language.Haskell.TH.Syntax (VarStrictType)
import Graphics.Wayland
import Graphics.Wayland.Scanner.Marshaller
import Graphics.Wayland.Scanner.Names
import Graphics.Wayland.Scanner.Protocol
import Graphics.Wayland.Scanner.Types
import Graphics.Wayland.Internal.Util hiding (Client)
import Graphics.Wayland.Internal.Util as Util (Client)
-- Dear future maintainer,
-- I'm sorry.
generateTypes :: ProtocolSpec -> Q [Dec]
generateTypes ps = liftM concat $ sequence $ map generateInterface (protocolInterfaces ps) where
generateInterface :: Interface -> Q [Dec]
generateInterface iface = do
let iname = interfaceName iface
pname = protocolName ps
qname = interfaceTypeName pname iname
constructorType <- [t|$(conT ''Ptr) $(conT qname)|]
typeDec <- newtypeD (return []) qname [] (normalC qname [return (NotStrict, constructorType)]) [mkName "Show", mkName "Eq"]
-- We will later need a pointer to the wl_interface structs, for passing to wl_proxy_marshal_constructor and wl_resource_create.
-- Now, a pretty solution would construct its own wl_interface struct here.
-- But that's way too much work for me. We just bind to the one generated by the C scanner.
cInterfaceDec <- forImpD cCall unsafe ("&"++iname ++ "_interface") (interfaceCInterfaceName pname iname ) [t| (CInterface)|] -- pointer is fixed
return $ typeDec : cInterfaceDec : []
generateRegistryBind :: ProtocolSpec -> Q [Either Dec Dec]
generateRegistryBind ps = do
let messageCreatesIface child msg = any (\ argument ->
case argument of
(_, NewIdArg _ x, _) -> x == interfaceName child
_ -> False)
(messageArguments msg)
interfaceCreatesIface child parent = any (messageCreatesIface child) (interfaceRequests parent)
protocolCreatesIface child = any (interfaceCreatesIface child) (protocolInterfaces ps)
globalInterfaces = filter (not.protocolCreatesIface) $ filter (\iface -> interfaceName iface /= "wl_display") (protocolInterfaces ps)
-- static inline void * wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
-- id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_registry, WL_REGISTRY_BIND, interface, name, interface->name, version, NULL);
-- struct wl_proxy * wl_proxy_marshal_constructor(struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, ...)
liftM concat $ sequence $ map registryBindInterface globalInterfaces
where
registryBindInterface :: Interface -> Q [Either Dec Dec]
registryBindInterface iface = do
let iname = interfaceName iface
pname = protocolName ps
internalCName = mkName $ "wl_registry_" ++ iname ++ "_c_bind"
exposeName = registryBindName pname iname
fore <- forImpD cCall unsafe "wl_proxy_marshal_constructor" internalCName [t|$(conT $ mkName "Registry") -> (CUInt) -> CInterface -> CUInt -> Ptr CChar -> CUInt -> Ptr () -> IO $(conT $ interfaceTypeName pname iname) |]
exposureDec <- [d|$(varP exposeName) = \ reg name strname version -> withCString strname $ \cstr -> $(varE internalCName) reg 0 $(varE $ interfaceCInterfaceName pname iname) (fromIntegral (name::Word)) cstr (fromIntegral (version::Word)) nullPtr |]
return $ Left fore : map Right exposureDec
generateEnums :: ProtocolSpec -> [Dec]
generateEnums ps = concat $ map eachGenerateEnums (protocolInterfaces ps) where
eachGenerateEnums :: Interface -> [Dec]
eachGenerateEnums iface = concat $ map generateEnum $ interfaceEnums iface where
generateEnum :: WLEnum -> [Dec]
generateEnum wlenum =
let qname = enumTypeName (protocolName ps) (interfaceName iface) (enumName wlenum)
in
NewtypeD [] qname [] (NormalC qname [(NotStrict, (ConT ''Int))]) [mkName "Show", mkName "Eq"]
:
map (\(entry, val) -> (ValD (VarP $ enumEntryHaskName (protocolName ps) (interfaceName iface) (enumName wlenum) entry) (NormalB $ (ConE qname) `AppE` (LitE $ IntegerL $ toInteger val)) [])) (enumEntries wlenum)
-- | generate FFI for a certain side of the API
--
-- Either Dec Dec explained: Left dec for internal declarations, Right dec for external declarations (ie. those that should be exposed to the user)
generateMethods :: ProtocolSpec -> ServerClient -> Q [Either Dec Dec]
generateMethods ps sc = liftM concat $ sequence $ map generateInterface $ filter (\iface -> if sc == Server then interfaceName iface /= "wl_display" else True) $ protocolInterfaces ps where
generateInterface :: Interface -> Q [Either Dec Dec]
generateInterface iface = do
-- bind object destroyers
let destroyName = mkName $ interfaceName iface ++ "_destructor"
foreignDestructor <- forImpD cCall unsafe "wl_proxy_destroy" destroyName [t|$(conT $ interfaceTypeName (protocolName ps) (interfaceName iface)) -> IO ()|]
-- Okay, we have to figure out some stuff. There is a tree of possibilities:
-- - Server
-- => this is actually an easy case. every message is just some call to wl_resource_post_event
-- - Client
-- - - if a message has more than one new_id argument, skip (or undefined for safety?)
-- - - if a message has a single untyped new_id argument (ie now interface attribute in the XML), then there is some complicated C implementation we won't be copying, skip
-- - - if a message has a single typed new_id argument, then this is the return value of wl_proxy_marshal_constructor
-- => pass a bunch of constants in the initial arguments. pass NULL in its argument position
-- - - if a message has no new_id arguments, we are calling wl_proxy_marshal
-- => for each argument EXCEPT new_id's(where we would pass NULL as discussed), pass that argument
-- Note that wl_resource_post_event, wl_proxy_marshal and wl_proxy_marshal_constructor all have the message index in the SECOND position: the object corresponding to the message is the first! So the important thing to remember is that our pretty Haskell function representations have some arguments inserted in between.
--
-- Further, in the Client case, we have to make a destructor. Some messages can have type="destructor" in the XML protocol files.
-- - there is no message typed destructor with name "destroy"
-- - - if the interface is wl_display, don't do anything
-- - - if the interface is NOT wl_display
-- => generate a new function "destroy", a synonnym for wl_proxy_destroy
-- - otherwise, for each message typed destructor (possibly including "destroy")
-- => call wl_proxy_marshal as normal, and *also* wl_proxy_destroy on this proxy (sole argument)
-- - the case of having a "destroy", but no destructor, is illegal: iow, if you have a "destroy", then you must also have a destructor request.
-- the C scanner allows you to have a non-destructor "destroy", but I doubt that's the intention, so I'll make that undefined.
-- "dirty" name of internal raw binding to C function
let needsDefaultDestructor = ((sc == Client) && (not $ any messageIsDestructor $ interfaceRequests iface) && (interfaceName iface /= "wl_display"))
defaultDestructor <- [d|$(varP $ requestHaskName (protocolName ps) (interfaceName iface) "destroy") = \ proxy -> $(varE destroyName) proxy|]
let
generateMessage :: Int -> Message -> Q [Either Dec Dec]
generateMessage idx msg = -- list idx used for wl_proxy_marshal arguments
let pname = protocolName ps
iname = interfaceName iface
mname = messageName msg
hname = case sc of
Server -> eventHaskName pname iname mname
Client -> requestHaskName pname iname mname
internalCName = case sc of
Server -> mkName $ "wl_rpe_" ++ interfaceName iface ++ "_" ++ messageName msg
Client -> mkName $ "wl_pm_" ++ interfaceName iface ++ "_" ++ messageName msg
in case sc of
Server -> do
-- void wl_resource_post_event(struct wl_resource *resource, uint32_t opcode, ...);
cdec <- forImpD cCall unsafe "wl_resource_post_event" internalCName [t|$(conT $ interfaceTypeName (protocolName ps) (interfaceName iface)) -> (CUInt) -> $(genMessageCType Nothing (messageArguments msg)) |]
resourceName <- newName "resourceInternalName___"
let messageIndexApplied = applyAtPosition (varE internalCName) (litE $ IntegerL $ fromIntegral idx) 1
resourceApplied = [e|$messageIndexApplied $(varE resourceName)|]
(pats,fun) = argTypeMarshaller (messageArguments msg) resourceApplied
declist <- [d|$(varP hname) = $(LamE (VarP resourceName : pats) <$> fun)|]
return (Left cdec:map Right declist)
Client -> do
let numNewIds = sum $ map (boolToInt . isNewId) $ messageArguments msg
argsWithoutNewId = filter (\arg -> not $ isNewId arg) (messageArguments msg)
returnArgument = head $ filter (\arg -> isNewId arg) (messageArguments msg)
returnName = let (_, NewIdArg _ theName, _) = returnArgument
in theName
returnType = [t|IO $(argTypeToCType returnArgument)|]
cdec <- case numNewIds of
-- void wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
0 -> forImpD cCall unsafe "wl_proxy_marshal" internalCName [t|$(conT $ interfaceTypeName (protocolName ps) (interfaceName iface)) -> (CUInt) -> $(genMessageCType Nothing (messageArguments msg)) |]
-- struct wl_proxy * wl_proxy_marshal_constructor(struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, ...)
1 -> forImpD cCall unsafe "wl_proxy_marshal_constructor" internalCName [t|$(conT $ interfaceTypeName (protocolName ps) (interfaceName iface)) -> (CUInt) -> CInterface -> $(genMessageCType (Just returnType) (messageArguments msg)) |]
proxyName <- newName "proxyInternalName___"
let messageIndexApplied = applyAtPosition (varE internalCName) (litE $ IntegerL $ fromIntegral idx) 1
constructorApplied = case numNewIds of
0 -> messageIndexApplied
1 -> applyAtPosition messageIndexApplied (varE $ interfaceCInterfaceName pname (returnName)) 1
proxyApplied = [e|$constructorApplied $(varE proxyName)|]
makeArgumentNullPtr =
let argIdx = fromJust $ findIndex isNewId (messageArguments msg)
arg' = (messageArguments msg) !! argIdx
msgName = let (_,NewIdArg itsname _,_) = arg'
in itsname
in [e|$(conE msgName) nullPtr|]
newIdNullInserted = case numNewIds of
0 -> proxyApplied
1 -> applyAtPosition proxyApplied makeArgumentNullPtr (fromJust $ findIndex isNewId (messageArguments msg))
finalCall = newIdNullInserted
(pats, fun) = argTypeMarshaller (argsWithoutNewId) finalCall
declist <- [d|$(varP hname) = $(LamE (VarP proxyName : pats) <$> [e|do
-- Let's start by either calling wl_proxy_marshal or wl_proxy_marshal_constructor
retval <- $fun
-- possibly do some destruction here?
$(case messageIsDestructor msg of
False -> [e|return retval|] -- do nothing (will hopefully get optimized away)
True -> [e|$(varE destroyName) $(varE proxyName) |]
)
return retval
|])|]
return (Left cdec : map Right declist)
-- bind individual messages
theMessages <- liftM concat $ sequence $ zipWith generateMessage [0..] $
case sc of
Server -> interfaceEvents iface
Client -> interfaceRequests iface
return $ Left foreignDestructor : theMessages ++ if needsDefaultDestructor then map Right defaultDestructor else []
applyAtPosition :: ExpQ -> ExpQ -> Int -> ExpQ
applyAtPosition fun arg pos = do
vars <- sequence $ map (\ _ -> newName "somesecretnameyoushouldntmesswith___") [0..(pos-1)]
lamE (map varP vars) $
appsE $ fun : (map varE vars) ++ [arg]
preComposeAt :: ExpQ -> ExpQ -> Int -> Int -> ExpQ
preComposeAt fun arg pos numArgs
| pos > numArgs = error "programming error"
preComposeAt fun arg pos numArgs = do
vars <- sequence $ map (\ _ -> newName "yetanothernewvariablepleasedonttouchme___") [0..numArgs]
lamE (map varP vars) $
[e|do
preCompVal <- $arg $(varE $ vars !! pos)
$(appsE $ fun : (map varE $ take pos vars) ++ varE 'preCompVal : (map varE $ drop (pos+1) vars))
|]
generateListeners :: ProtocolSpec -> ServerClient -> Q [Either Dec Dec]
generateListeners sp sc = do
let pname = protocolName sp
interfaces <- liftM concat $ sequence $ map (\iface -> generateListener sp iface sc) $
filter (\iface -> 0 < (length $ case sc of
Server -> interfaceRequests iface
Client -> interfaceEvents iface)) $ protocolInterfaces sp
resourceCreators <-
case sc of
Client -> return [] -- resources are created Server-side, and Client's proxies are created by the wayland library always
Server -> liftM concat $ sequence $
map (\ iface -> do
let iname = interfaceName iface
internalCName = mkName $ pname ++ "_" ++ iname ++ "_c_resource_create"
foreignDec <- forImpD cCall unsafe "wl_resource_create" internalCName [t|Util.Client -> CInterface -> CInt -> (CUInt) -> IO $(conT $ interfaceTypeName pname iname) |]
neatDec <- [d|$(varP $ interfaceResourceCreator pname iname) = \ client id ->
$(varE internalCName) client $(varE $ interfaceCInterfaceName pname iname) $(litE $ IntegerL $ fromIntegral $ interfaceVersion iface) id|]
return $ Left foreignDec : map Left neatDec
) (protocolInterfaces sp)
return $ interfaces ++ resourceCreators
-- | generate FFI for the API that enables you to receive messages
--
-- Either Dec Dec explained: Left dec for internal declarations, Right dec for external declarations (ie. those that should be exposed to the user)
generateListener :: ProtocolSpec -> Interface -> ServerClient -> Q [Either Dec Dec]
generateListener sp iface sc =
-- Tree of possibilities:
-- - Server
-- => call it an Implementation or Interface. first argument is the client, second is the resource
-- - Client
-- => call it a Listener. first argument is the proxy
--
-- for each argument (we're not gonna deal with untyped objects or new_ids):
-- - typed new_id
-- - Client
-- => that type as arg
-- - Server
-- => uint32_t (the actual id. so that's new. dunno how to handle this. it's to be passed to wl_resource_create. maybe i should just create the resource for the server and pass that.)
-- - anything else
-- => the type you'd expect
let -- declare a Listener or Interface type for this interface
typeName :: Name
typeName = messageListenerTypeName sc (protocolName sp) (interfaceName iface)
pname = protocolName sp
iname :: String
iname = interfaceName iface
messages :: [Message]
messages = case sc of
Server -> interfaceRequests iface
Client -> interfaceEvents iface
mkMessageName :: Message -> Name
mkMessageName msg = case sc of
Server -> requestHaskName pname iname (messageName msg)
Client -> eventHaskName pname iname (messageName msg)
mkListenerType :: Message -> TypeQ
mkListenerType msg = case sc of
Server -> [t|Util.Client -> $(conT $ interfaceTypeName pname iname) -> $(genMessageHaskType Nothing $ messageArguments msg)|] -- see large comment above
Client -> [t|$(conT $ interfaceTypeName pname iname) -> $(genMessageHaskType Nothing $ messageArguments msg)|]
mkListenerConstr :: Message -> VarStrictTypeQ
mkListenerConstr msg = do
let name = mkMessageName msg
ltype <- mkListenerType msg
return (name, NotStrict, ltype)
listenerType :: DecQ
listenerType = do
recArgs <- sequence $ map mkListenerConstr messages
return $ DataD [] typeName [] [RecC typeName recArgs] []
-- in the weird uint32_t new_id case, first pass the id through wl_resource_create to just get a resource
preCompResourceCreate clientName msg fun =
case sc of
Client -> fun
Server -> foldr (\(arg, idx) curFunc ->
case arg of
(_, NewIdArg _ itsName, _) -> preComposeAt curFunc [e|$(varE $ interfaceResourceCreator pname itsName) $(varE clientName) |] idx (length $ messageArguments msg)
_ -> curFunc
) fun (zip (messageArguments msg) [1..])
-- instance dec: this struct better be Storable
instanceDec :: DecsQ
instanceDec = do
[d|instance Storable $(conT typeName) where
sizeOf _ = $(litE $ IntegerL $ funcSize * (fromIntegral $ length messages))
alignment _ = $(return $ LitE $ IntegerL funcAlign)
peek _ = undefined -- we shouldn't need to be able to read listeners (since we can't change them anyway)
poke ptr record = $(doE $ ( zipWith (\ idx msg ->
noBindS [e|do
let haskFun = $(return $ VarE $ mkMessageName msg) record
unmarshaller fun = \x -> $(let (pats, funexp) = argTypeUnmarshaller (messageArguments msg) ([e|fun x|])
in LamE pats <$> funexp)
funptr <- $(case sc of -- the Server-side listeners take an extra Client argument
Server -> [e|$(varE $ wrapperName msg) $ \ client -> ($(preCompResourceCreate 'client msg [e|unmarshaller $ haskFun client|])) |]
-- the Client-side listener takes a void* user_data argument, which we throw out cause it's not a sane api.
Client -> [e|$(varE $ wrapperName msg) $ \ _ -> unmarshaller haskFun|])
pokeByteOff ptr $(litE $ IntegerL (idx * funcSize)) funptr
|] )
[0..] messages
) ++ [noBindS [e|return () |]] )
|]
-- FunPtr wrapper
mkListenerCType msg = case sc of
Server -> [t|Util.Client -> $(conT $ interfaceTypeName pname iname) -> $(genMessageWeirdCType Nothing $ messageArguments msg)|] -- see large comment above
Client -> [t|Ptr () -> $(conT $ interfaceTypeName pname iname) -> $(genMessageCType Nothing $ messageArguments msg)|]
wrapperName msg = messageListenerWrapperName sc iname (messageName msg)
wrapperDec msg = forImpD cCall unsafe "wrapper" (wrapperName msg) [t|$(mkListenerCType msg) -> IO (FunPtr ($(mkListenerCType msg))) |]
-- bind add_listener
haskName = requestHaskName pname iname "set_listener" -- dunno why I can't use this variable in the splice below.
foreignName = requestInternalCName iname "c_add_listener"
foreignDec :: Q Dec
foreignDec = case sc of
-- void wl_resource_set_implementation(struct wl_resource *resource,
-- const void *implementation,
-- void *data,
-- wl_resource_destroy_func_t destroy);
-- typedef void (*wl_resource_destroy_func_t)(struct wl_resource *resource);
Server -> forImpD cCall unsafe "wl_resource_set_implementation" foreignName [t|$(conT $ interfaceTypeName pname iname) -> (Ptr $(conT $ typeName)) -> (Ptr ()) -> FunPtr ($(conT $ interfaceTypeName pname iname) -> IO ()) -> IO ()|]
-- int wl_proxy_add_listener(struct wl_proxy *proxy,
-- void (**implementation)(void), void *data);
Client -> forImpD cCall unsafe "wl_proxy_add_listener" foreignName [t|$(conT $ interfaceTypeName pname iname) -> (Ptr $(conT $ typeName)) -> (Ptr ()) -> IO CInt|]
apiDec :: Q [Dec]
apiDec = [d|$(varP $ requestHaskName (protocolName sp) iname "set_listener") = \ iface listener ->
do
-- malloc RAM for Listener type
memory <- malloc
-- store Listener type
poke memory listener
-- call foreign add_listener on stored Listener type
$(case sc of
Server -> [e|$(varE foreignName) iface memory nullPtr nullFunPtr|]
Client -> [e|errToResult <$> $(varE foreignName) iface memory nullPtr|])
|]
in do
-- Remember: Left for internal, Right for external.
some <- sequence $ (liftM Right) listenerType : map (liftM Left . wrapperDec) messages
other <- instanceDec
more <- foreignDec
last <- apiDec
return $ some ++ (map Right other) ++ [Right more] ++ (map Right last)
generateRegistryBindInternal sp = liftM lefts $ generateRegistryBind sp
generateRegistryBindExternal sp = liftM rights $ generateRegistryBind sp
generateClientInternalListeners sp = liftM lefts $ generateListeners sp Client
generateServerInternalListeners sp = liftM lefts $ generateListeners sp Server
generateClientExternalListeners sp = liftM rights $ generateListeners sp Client
generateServerExternalListeners sp = liftM rights $ generateListeners sp Server
generateClientInternalMethods :: ProtocolSpec -> Q [Dec]
generateClientInternalMethods ps = liftM lefts $ generateMethods ps Client
generateServerInternalMethods :: ProtocolSpec -> Q [Dec]
generateServerInternalMethods ps = liftM lefts $ generateMethods ps Server
generateClientExternalMethods :: ProtocolSpec -> Q [Dec]
generateClientExternalMethods ps = liftM rights $ generateMethods ps Client
generateServerExternalMethods :: ProtocolSpec -> Q [Dec]
generateServerExternalMethods ps = liftM rights $ generateMethods ps Server
genMessageCType :: Maybe TypeQ -> [Argument] -> TypeQ
genMessageCType = genMessageType argTypeToCType
genMessageWeirdCType :: Maybe TypeQ -> [Argument] -> TypeQ
genMessageWeirdCType = genMessageType argTypeToWeirdInterfaceCType
genMessageHaskType :: Maybe TypeQ -> [Argument] -> TypeQ
genMessageHaskType = genMessageType argTypeToHaskType
genMessageType :: (Argument -> TypeQ) -> Maybe TypeQ -> [Argument] -> TypeQ
genMessageType fun Nothing args =
foldr (\addtype curtype -> [t|$(fun addtype) -> $curtype|]) [t|IO ()|] args
genMessageType fun (Just someType) args =
foldr (\addtype curtype -> [t|$(fun addtype) -> $curtype|]) someType args
-- | 3-tuple version of snd
snd3 :: (a,b,c) -> b
snd3 (_,b,_) = b
-- | Summable check if a given message argument is of type new_id
isNewId :: Argument -> Bool
isNewId arg = case arg of
(_, NewIdArg _ _, _) -> True
_ -> False
boolToInt :: Bool -> Int
boolToInt True = 1
boolToInt False = 0
|
{
"url": "http://hackage.haskell.org/package/hayland-0.1.0.0/docs/src/Graphics-Wayland-Scanner.html",
"source_domain": "hackage.haskell.org",
"snapshot_id": "crawl=CC-MAIN-2019-26",
"warc_metadata": {
"Content-Length": "132787",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:VK47WODMBXH47W2UQR5QNORVVAQPVA7X",
"WARC-Concurrent-To": "<urn:uuid:cd726b5a-90d4-4365-8de1-54c665db28a2>",
"WARC-Date": "2019-06-16T23:38:34Z",
"WARC-IP-Address": "151.101.248.68",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:VIQWQNP5AHT4UWVRXZR6XCJUP6AG2KD4",
"WARC-Record-ID": "<urn:uuid:02cfa544-790e-42b4-87aa-2893539ed781>",
"WARC-Target-URI": "http://hackage.haskell.org/package/hayland-0.1.0.0/docs/src/Graphics-Wayland-Scanner.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:e2c60cc7-a4a2-4bf2-8a00-286d45ea4a17>"
},
"warc_info": "isPartOf: CC-MAIN-2019-26\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for June 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-147-89-155.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
94,
133,
134,
135,
183,
216,
217,
251,
319,
343,
344,
376,
408,
409,
444,
479,
480,
515,
550,
551,
584,
617,
618,
651,
684,
685,
726,
770,
771,
788,
789,
799,
800,
828,
863,
892,
921,
950,
965,
988,
1026,
1053,
1103,
1104,
1128,
1171,
1209,
1250,
1288,
1342,
1397,
1398,
1399,
1426,
1440,
1441,
1442,
1443,
1444,
1485,
1582,
1626,
1657,
1693,
1725,
1771,
1827,
1955,
1956,
2089,
2169,
2265,
2414,
2456,
2457,
2516,
2545,
2602,
2627,
2686,
2747,
2778,
2880,
2973,
3113,
3114,
3261,
3401,
3537,
3608,
3618,
3681,
3720,
3760,
3796,
3870,
3924,
3925,
4153,
4410,
4461,
4462,
4501,
4581,
4623,
4706,
4742,
4768,
4857,
4866,
4968,
4978,
5197,
5198,
5246,
5249,
5399,
5469,
5659,
5714,
5745,
5775,
5843,
6002,
6003,
6004,
6085,
6101,
6202,
6218,
6309,
6485,
6607,
6708,
6789,
6894,
7218,
7225,
7359,
7425,
7486,
7532,
7613,
7698,
7801,
7949,
8082,
8140,
8141,
8293,
8438,
8439,
8447,
8508,
8587,
8622,
8661,
8696,
8697,
8727,
8790,
8855,
8893,
9000,
9106,
9107,
9128,
9153,
9251,
9471,
9535,
9651,
9734,
9822,
9911,
9962,
9987,
10072,
10167,
10261,
10340,
10382,
10454,
10494,
10589,
10810,
10968,
11225,
11226,
11227,
11285,
11401,
11458,
11524,
11660,
11736,
11776,
11863,
11929,
12001,
12048,
12102,
12158,
12216,
12364,
12412,
12491,
12576,
12687,
12731,
12732,
12799,
12862,
12973,
13058,
13093,
13094,
13137,
13172,
13173,
13226,
13227,
13228,
13229,
13261,
13338,
13357,
13409,
13463,
13464,
13584,
13585,
13586,
13633,
13666,
13760,
13785,
13828,
13829,
13880,
13913,
13960,
13998,
14097,
14122,
14132,
14179,
14282,
14289,
14290,
14362,
14391,
14421,
14422,
14511,
14558,
14630,
14726,
14748,
14763,
14890,
14932,
14959,
15001,
15086,
15263,
15351,
15516,
15570,
15606,
15648,
15649,
15650,
15717,
15720,
15870,
15954,
15985,
16013,
16027,
16130,
16144,
16202,
16207,
16286,
16306,
16322,
16351,
16367,
16558,
16579,
16611,
16676,
16699,
16783,
16813,
16835,
16869,
16897,
16925,
16978,
17029,
17068,
17105,
17184,
17261,
17302,
17340,
17510,
17637,
17689,
17721,
17758,
17794,
17834,
17861,
17885,
17945,
18010,
18011,
18123,
18172,
18191,
18215,
18265,
18289,
18464,
18516,
18569,
18570,
18624,
18651,
18674,
18726,
18814,
18878,
18989,
19044,
19074,
19150,
19276,
19350,
19351,
19451,
19613,
19753,
19857,
19858,
19935,
19956,
19985,
20032,
20047,
20048,
20049,
20073,
20112,
20284,
20418,
20496,
20637,
20638,
20665,
20785,
20849,
20875,
20905,
20995,
21050,
21089,
21153,
21251,
21504,
21578,
21649,
21834,
21858,
21963,
21985,
22037,
22074,
22117,
22158,
22231,
22264,
22355,
22452,
22453,
22476,
22477,
22485,
22541,
22632,
22657,
22680,
22699,
22774,
22775,
22776,
22848,
22921,
22922,
23001,
23080,
23081,
23161,
23241,
23242,
23299,
23374,
23375,
23432,
23507,
23508,
23565,
23641,
23642,
23699,
23775,
23776,
23830,
23878,
23879,
23938,
24005,
24006,
24063,
24117,
24118,
24194,
24228,
24306,
24348,
24424,
24425,
24426,
24427,
24455,
24476,
24493,
24494,
24560,
24588,
24614,
24662,
24709,
24710,
24735,
24754
],
"line_end_idx": [
94,
133,
134,
135,
183,
216,
217,
251,
319,
343,
344,
376,
408,
409,
444,
479,
480,
515,
550,
551,
584,
617,
618,
651,
684,
685,
726,
770,
771,
788,
789,
799,
800,
828,
863,
892,
921,
950,
965,
988,
1026,
1053,
1103,
1104,
1128,
1171,
1209,
1250,
1288,
1342,
1397,
1398,
1399,
1426,
1440,
1441,
1442,
1443,
1444,
1485,
1582,
1626,
1657,
1693,
1725,
1771,
1827,
1955,
1956,
2089,
2169,
2265,
2414,
2456,
2457,
2516,
2545,
2602,
2627,
2686,
2747,
2778,
2880,
2973,
3113,
3114,
3261,
3401,
3537,
3608,
3618,
3681,
3720,
3760,
3796,
3870,
3924,
3925,
4153,
4410,
4461,
4462,
4501,
4581,
4623,
4706,
4742,
4768,
4857,
4866,
4968,
4978,
5197,
5198,
5246,
5249,
5399,
5469,
5659,
5714,
5745,
5775,
5843,
6002,
6003,
6004,
6085,
6101,
6202,
6218,
6309,
6485,
6607,
6708,
6789,
6894,
7218,
7225,
7359,
7425,
7486,
7532,
7613,
7698,
7801,
7949,
8082,
8140,
8141,
8293,
8438,
8439,
8447,
8508,
8587,
8622,
8661,
8696,
8697,
8727,
8790,
8855,
8893,
9000,
9106,
9107,
9128,
9153,
9251,
9471,
9535,
9651,
9734,
9822,
9911,
9962,
9987,
10072,
10167,
10261,
10340,
10382,
10454,
10494,
10589,
10810,
10968,
11225,
11226,
11227,
11285,
11401,
11458,
11524,
11660,
11736,
11776,
11863,
11929,
12001,
12048,
12102,
12158,
12216,
12364,
12412,
12491,
12576,
12687,
12731,
12732,
12799,
12862,
12973,
13058,
13093,
13094,
13137,
13172,
13173,
13226,
13227,
13228,
13229,
13261,
13338,
13357,
13409,
13463,
13464,
13584,
13585,
13586,
13633,
13666,
13760,
13785,
13828,
13829,
13880,
13913,
13960,
13998,
14097,
14122,
14132,
14179,
14282,
14289,
14290,
14362,
14391,
14421,
14422,
14511,
14558,
14630,
14726,
14748,
14763,
14890,
14932,
14959,
15001,
15086,
15263,
15351,
15516,
15570,
15606,
15648,
15649,
15650,
15717,
15720,
15870,
15954,
15985,
16013,
16027,
16130,
16144,
16202,
16207,
16286,
16306,
16322,
16351,
16367,
16558,
16579,
16611,
16676,
16699,
16783,
16813,
16835,
16869,
16897,
16925,
16978,
17029,
17068,
17105,
17184,
17261,
17302,
17340,
17510,
17637,
17689,
17721,
17758,
17794,
17834,
17861,
17885,
17945,
18010,
18011,
18123,
18172,
18191,
18215,
18265,
18289,
18464,
18516,
18569,
18570,
18624,
18651,
18674,
18726,
18814,
18878,
18989,
19044,
19074,
19150,
19276,
19350,
19351,
19451,
19613,
19753,
19857,
19858,
19935,
19956,
19985,
20032,
20047,
20048,
20049,
20073,
20112,
20284,
20418,
20496,
20637,
20638,
20665,
20785,
20849,
20875,
20905,
20995,
21050,
21089,
21153,
21251,
21504,
21578,
21649,
21834,
21858,
21963,
21985,
22037,
22074,
22117,
22158,
22231,
22264,
22355,
22452,
22453,
22476,
22477,
22485,
22541,
22632,
22657,
22680,
22699,
22774,
22775,
22776,
22848,
22921,
22922,
23001,
23080,
23081,
23161,
23241,
23242,
23299,
23374,
23375,
23432,
23507,
23508,
23565,
23641,
23642,
23699,
23775,
23776,
23830,
23878,
23879,
23938,
24005,
24006,
24063,
24117,
24118,
24194,
24228,
24306,
24348,
24424,
24425,
24426,
24427,
24455,
24476,
24493,
24494,
24560,
24588,
24614,
24662,
24709,
24710,
24735,
24754,
24773
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 24773,
"ccnet_original_nlines": 449,
"rps_doc_curly_bracket": 0.0001614700013305992,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.1282370537519455,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.013695220462977886,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.40214142203330994,
"rps_doc_frac_unique_words": 0.26538628339767456,
"rps_doc_mean_word_length": 6.938018321990967,
"rps_doc_num_sentences": 94,
"rps_doc_symbol_to_word_ratio": 0.001992030069231987,
"rps_doc_unigram_entropy": 5.81699275970459,
"rps_doc_word_count": 2291,
"rps_doc_frac_chars_dupe_10grams": 0.0592639185488224,
"rps_doc_frac_chars_dupe_5grams": 0.18200692534446716,
"rps_doc_frac_chars_dupe_6grams": 0.13463352620601654,
"rps_doc_frac_chars_dupe_7grams": 0.10311418771743774,
"rps_doc_frac_chars_dupe_8grams": 0.09235609322786331,
"rps_doc_frac_chars_dupe_9grams": 0.08128342032432556,
"rps_doc_frac_chars_top_2gram": 0.01321170013397932,
"rps_doc_frac_chars_top_3gram": 0.0070462399162352085,
"rps_doc_frac_chars_top_4gram": 0.008807799778878689,
"rps_doc_books_importance": -1573.5113525390625,
"rps_doc_books_importance_length_correction": -1573.5113525390625,
"rps_doc_openwebtext_importance": -801.0096435546875,
"rps_doc_openwebtext_importance_length_correction": -801.0096435546875,
"rps_doc_wikipedia_importance": -376.9752502441406,
"rps_doc_wikipedia_importance_length_correction": -376.9752502441406
},
"fasttext": {
"dclm": 0.06516324728727341,
"english": 0.4693634808063507,
"fineweb_edu_approx": 2.6624724864959717,
"eai_general_math": 0.7814342379570007,
"eai_open_web_math": 0.23518091440200806,
"eai_web_code": 0.9353295564651489
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.0151",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "3",
"label": "Academic Writing"
}
},
"reasoning_depth": {
"primary": {
"code": "4",
"label": "Advanced Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,761,233,102,332,314,000 |
Permalink
Browse files
Bump to 1.5.0
• Loading branch information...
1 parent e8f4bcf commit 5b11c5e23ce96b6dd8725c02fc6dc1e8fb0a57b6 @evanphx evanphx committed Jul 19, 2012
Showing with 27 additions and 3 deletions.
1. +24 −0 History.txt
2. +1 −1 lib/puma/const.rb
3. +2 −2 puma.gemspec
View
@@ -1,3 +1,27 @@
+=== 1.5.0 / 2012-07-19
+
+* 7 contributers to this release:
+ * Christian Mayer
+ * Darío Javier Cravero
+ * Dirkjan Bussink
+ * Gianluca Padovani
+ * Santiago Pastorino
+ * Thibault Jouan
+ * tomykaira
+
+* 6 bug fixes:
+ * Define RSTRING_NOT_MODIFIED for Rubinius
+ * Convert status to integer. Fixes #123
+ * Delete pidfile when stopping the server
+ * Allow compilation with -Werror=format-security option
+ * Fix wrong HTTP version for a HTTP/1.0 request
+ * Use String#bytesize instead of String#length
+
+* 3 minor features:
+ * Added support for setting RACK_ENV via the CLI, config file, and rack app
+ * Allow Server#run to run sync. Fixes #111
+ * Puma can now run on windows
+
=== 1.4.0 / 2012-06-04
* 1 bug fix:
View
@@ -25,7 +25,7 @@ module Puma
# too taxing on performance.
module Const
- PUMA_VERSION = VERSION = "1.4.0".freeze
+ PUMA_VERSION = VERSION = "1.5.0".freeze
# The default number of seconds for another request within a persistent
# session.
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = "puma"
- s.version = "1.3.1"
+ s.version = "1.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Evan Phoenix"]
- s.date = "2012-05-16"
+ s.date = "2012-07-19"
s.description = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.\n\nUnder the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!\n\nWith Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.\n\nOn MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like [Rubinius](http://rubini.us) or [JRuby](http://jruby.org)."
s.email = ["[email protected]"]
s.executables = ["puma", "pumactl"]
0 comments on commit 5b11c5e
Please sign in to comment.
|
{
"url": "https://github.com/SamSaffron/puma/commit/5b11c5e23ce96b6dd8725c02fc6dc1e8fb0a57b6",
"source_domain": "github.com",
"snapshot_id": "crawl=CC-MAIN-2017-22",
"warc_metadata": {
"Content-Length": "69049",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:6TIOYRK7C6WB6HWLO4CXPANTVYQNKGJM",
"WARC-Concurrent-To": "<urn:uuid:1eb3f61c-b8db-4744-a8b7-5be9edc6baea>",
"WARC-Date": "2017-05-25T09:13:32Z",
"WARC-IP-Address": "192.30.253.113",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:YQCANJVVD3M6VDNZEABDY4YPDFSCNYHI",
"WARC-Record-ID": "<urn:uuid:84c2971b-de96-4552-ae7c-91c8a1cc46ed>",
"WARC-Target-URI": "https://github.com/SamSaffron/puma/commit/5b11c5e23ce96b6dd8725c02fc6dc1e8fb0a57b6",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:1665919e-00df-44c9-b7e3-b4671c398c2c>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-185-224-210.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2017-22\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for May 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
10,
23,
24,
38,
39,
73,
178,
221,
245,
274,
298,
303,
320,
344,
346,
381,
401,
426,
446,
468,
491,
510,
524,
526,
542,
587,
629,
673,
731,
781,
830,
832,
853,
931,
976,
1008,
1010,
1033,
1046,
1051,
1081,
1110,
1123,
1165,
1207,
1279,
1290,
1295,
1313,
1343,
1359,
1381,
1403,
1507,
1536,
1560,
1584,
3132,
3158,
3194,
3195,
3224,
3225
],
"line_end_idx": [
10,
23,
24,
38,
39,
73,
178,
221,
245,
274,
298,
303,
320,
344,
346,
381,
401,
426,
446,
468,
491,
510,
524,
526,
542,
587,
629,
673,
731,
781,
830,
832,
853,
931,
976,
1008,
1010,
1033,
1046,
1051,
1081,
1110,
1123,
1165,
1207,
1279,
1290,
1295,
1313,
1343,
1359,
1381,
1403,
1507,
1536,
1560,
1584,
3132,
3158,
3194,
3195,
3224,
3225,
3251
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3251,
"ccnet_original_nlines": 63,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.21766965091228485,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.025608189404010773,
"rps_doc_frac_lines_end_with_ellipsis": 0.015625,
"rps_doc_frac_no_alph_words": 0.4174135625362396,
"rps_doc_frac_unique_words": 0.6450892686843872,
"rps_doc_mean_word_length": 5.388392925262451,
"rps_doc_num_sentences": 64,
"rps_doc_symbol_to_word_ratio": 0.011523690074682236,
"rps_doc_unigram_entropy": 5.397933483123779,
"rps_doc_word_count": 448,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.014913010410964489,
"rps_doc_frac_chars_top_3gram": 0.012427509762346745,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -332.117431640625,
"rps_doc_books_importance_length_correction": -332.117431640625,
"rps_doc_openwebtext_importance": -206.93405151367188,
"rps_doc_openwebtext_importance_length_correction": -206.93405151367188,
"rps_doc_wikipedia_importance": -143.44964599609375,
"rps_doc_wikipedia_importance_length_correction": -143.44964599609375
},
"fasttext": {
"dclm": 0.8378275036811829,
"english": 0.7722612619400024,
"fineweb_edu_approx": 1.2380902767181396,
"eai_general_math": 0.03926444053649902,
"eai_open_web_math": 0.21824371814727783,
"eai_web_code": 0.06249833106994629
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.455",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.02",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "1",
"label": "Leftover HTML"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "6",
"label": "Content Listing"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,061,945,824,957,463,000 |
Answers
Solutions by everydaycalculation.com
Answers.everydaycalculation.com » Compare fractions
Compare 36/63 and 90/10
1st number: 36/63, 2nd number: 9 0/10
36/63 is smaller than 90/10
Steps for comparing fractions
1. Find the least common denominator or LCM of the two denominators:
LCM of 63 and 10 is 630
2. For the 1st fraction, since 63 × 10 = 630,
36/63 = 36 × 10/63 × 10 = 360/630
3. Likewise, for the 2nd fraction, since 10 × 63 = 630,
90/10 = 90 × 63/10 × 63 = 5670/630
4. Since the denominators are now the same, the fraction with the bigger numerator is the greater fraction
5. 360/630 < 5670/630 or 36/63 < 90/10
MathStep (Works offline)
Download our mobile app and learn to work with fractions in your own time:
Android and iPhone/ iPad
Related:
© everydaycalculation.com
|
{
"url": "https://answers.everydaycalculation.com/compare-fractions/36-63-and-90-10",
"source_domain": "answers.everydaycalculation.com",
"snapshot_id": "crawl=CC-MAIN-2020-10",
"warc_metadata": {
"Content-Length": "7260",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:GIQ6FVXM2UZX4UADHILTJPUSNDM33SNG",
"WARC-Concurrent-To": "<urn:uuid:08340034-ad36-4b60-8e53-34002e5741c1>",
"WARC-Date": "2020-02-24T11:31:36Z",
"WARC-IP-Address": "96.126.107.130",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:RKEG5MAJ3FTWKMQOXGT6VBMNCQV4VALQ",
"WARC-Record-ID": "<urn:uuid:6608b5b2-dec6-4918-8e45-27e445443f88>",
"WARC-Target-URI": "https://answers.everydaycalculation.com/compare-fractions/36-63-and-90-10",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:af45dac1-7ae1-46da-9b90-08aa940757d5>"
},
"warc_info": "isPartOf: CC-MAIN-2020-10\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for February 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-109.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
8,
9,
46,
47,
99,
100,
124,
125,
163,
164,
192,
193,
223,
224,
295,
323,
371,
409,
467,
506,
615,
656,
657,
682,
683,
758,
783,
784,
793,
794
],
"line_end_idx": [
8,
9,
46,
47,
99,
100,
124,
125,
163,
164,
192,
193,
223,
224,
295,
323,
371,
409,
467,
506,
615,
656,
657,
682,
683,
758,
783,
784,
793,
794,
819
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 819,
"ccnet_original_nlines": 30,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2070707082748413,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.010101010091602802,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5404040217399597,
"rps_doc_frac_unique_words": 0.5846154093742371,
"rps_doc_mean_word_length": 4.623076915740967,
"rps_doc_num_sentences": 10,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.102816104888916,
"rps_doc_word_count": 130,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.016638940200209618,
"rps_doc_frac_chars_top_3gram": 0,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -53.75166702270508,
"rps_doc_books_importance_length_correction": -53.75166702270508,
"rps_doc_openwebtext_importance": -57.26646423339844,
"rps_doc_openwebtext_importance_length_correction": -57.20359802246094,
"rps_doc_wikipedia_importance": -53.925445556640625,
"rps_doc_wikipedia_importance_length_correction": -53.925445556640625
},
"fasttext": {
"dclm": 0.9788011312484741,
"english": 0.8859249949455261,
"fineweb_edu_approx": 2.383526086807251,
"eai_general_math": 0.17147666215896606,
"eai_open_web_math": 0.2585902810096741,
"eai_web_code": 0.000053169998864177614
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "513.24",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry"
}
},
"secondary": {
"code": "510",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "1",
"label": "Factual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-5,209,484,830,738,792,000 |
Explore BrainMass
Explore BrainMass
Algebra Word Problems : 'Together and Alone' Problems
This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!
Problem 1:Suppose one painter can paint the entire house in twelve hours, and the second painter takes eight hours . How long would it take the two painters together to paint the house?
Problem 2: Two trains leave the same train station at the same time , but in opposite direction. The faster train travels at an average rate of 75 miles per hour and the slower train travels at an average rate of 68 miles per hour . In how many hours will they be 715 miles apart?
© BrainMass Inc. brainmass.com June 3, 2020, 8:15 pm ad1c9bdddf
https://brainmass.com/math/basic-algebra/algebra-word-problems-together-alone-problems-130154
Solution Preview
Please see the attached file for the complete solution.
Thanks for using BrainMass.
Please explain the problems step-by- step and if it requires an equation please set it up with an explanation thank you
Problem 1: Suppose one painter can paint the entire house in twelve hours, and the second painter takes eight hours . How long would it take the two painters together to paint the house?
First painter can paint the entire house in 12 hours.
Therefore in 1 hour 1/12 Work will be done ...
Solution Summary
Together and alone word problems are solved. The solution is detailed and well presented.
$2.19
ADVERTISEMENT
|
{
"url": "https://brainmass.com/math/basic-algebra/algebra-word-problems-together-alone-problems-130154",
"source_domain": "brainmass.com",
"snapshot_id": "crawl=CC-MAIN-2020-24",
"warc_metadata": {
"Content-Length": "38766",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:TE2P4E5B4DQ2M5OJMIEUJKOH5MQYBWMN",
"WARC-Concurrent-To": "<urn:uuid:0cb92214-6c82-450c-943d-7b89791afd4f>",
"WARC-Date": "2020-06-06T18:23:08Z",
"WARC-IP-Address": "65.39.198.123",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:IJV3HP7HTGXMEFFNAJQGZWKLBBLPMWAD",
"WARC-Record-ID": "<urn:uuid:d72de55f-6ee9-4f61-b2b1-59a11265d128>",
"WARC-Target-URI": "https://brainmass.com/math/basic-algebra/algebra-word-problems-together-alone-problems-130154",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:1d3f50a9-9753-4397-8c21-515ef3de2334>"
},
"warc_info": "isPartOf: CC-MAIN-2020-24\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May/June 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-88.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
18,
19,
37,
38,
96,
97,
210,
211,
401,
402,
687,
688,
756,
854,
855,
876,
877,
937,
969,
970,
1094,
1095,
1286,
1287,
1345,
1396,
1397,
1418,
1419,
1513,
1514,
1524,
1525
],
"line_end_idx": [
18,
19,
37,
38,
96,
97,
210,
211,
401,
402,
687,
688,
756,
854,
855,
876,
877,
937,
969,
970,
1094,
1095,
1286,
1287,
1345,
1396,
1397,
1418,
1419,
1513,
1514,
1524,
1525,
1542
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1542,
"ccnet_original_nlines": 33,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.33892616629600525,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.006711409892886877,
"rps_doc_frac_lines_end_with_ellipsis": 0.029411759227514267,
"rps_doc_frac_no_alph_words": 0.2248322069644928,
"rps_doc_frac_unique_words": 0.5196506381034851,
"rps_doc_mean_word_length": 5.113537311553955,
"rps_doc_num_sentences": 20,
"rps_doc_symbol_to_word_ratio": 0.003355700056999922,
"rps_doc_unigram_entropy": 4.47204065322876,
"rps_doc_word_count": 229,
"rps_doc_frac_chars_dupe_10grams": 0.22886422276496887,
"rps_doc_frac_chars_dupe_5grams": 0.30486762523651123,
"rps_doc_frac_chars_dupe_6grams": 0.30486762523651123,
"rps_doc_frac_chars_dupe_7grams": 0.30486762523651123,
"rps_doc_frac_chars_dupe_8grams": 0.22886422276496887,
"rps_doc_frac_chars_dupe_9grams": 0.22886422276496887,
"rps_doc_frac_chars_top_2gram": 0.03415884077548981,
"rps_doc_frac_chars_top_3gram": 0.038428690284490585,
"rps_doc_frac_chars_top_4gram": 0.04611442983150482,
"rps_doc_books_importance": -79.76691436767578,
"rps_doc_books_importance_length_correction": -68.0720443725586,
"rps_doc_openwebtext_importance": -80.22014617919922,
"rps_doc_openwebtext_importance_length_correction": -80.22014617919922,
"rps_doc_wikipedia_importance": -66.60721588134766,
"rps_doc_wikipedia_importance_length_correction": -53.200340270996094
},
"fasttext": {
"dclm": 0.6009541749954224,
"english": 0.9233109951019287,
"fineweb_edu_approx": 2.2769052982330322,
"eai_general_math": 0.8536641001701355,
"eai_open_web_math": 0.43847209215164185,
"eai_web_code": 0.0014315199805423617
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "512",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Algebra"
}
},
"secondary": {
"code": "510",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "1",
"label": "Truncated Snippets"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,390,076,852,010,828,000 |
How To eSign Maryland Sports Presentation
How To use eSign Maryland Sports Presentation online. Get ready-made or create custom templates. Fill out, edit and send them safely. Add signatures and gather them from others. Easily track your documents status.
How it works
Browse for a template
Customize and eSign it
Send it for signing
Rate your experience
4.4
54 votes
eSign Maryland Sports in Presentation and Other Formats
A recommended solution for creating eSignatures and resolving document problems is signNow. This web-based service features a variety of tools that easily integrate with other cloud storage services. It fully answers the question of How To use eSign Sports Presentation Maryland tool, thanks to the simple and self-explanatory interface.
The platform is good both for individual and business users as it covers processes that demand a degree of multitasking within a team:
1. Adding multiple sample editors and signers allows for enhanced control over individual roles when collaborating on a template.
2. Template sharing and editing between team members enables fast and effective collaboration between colleagues.
3. Carefully track every change made to a sample with audit trails.
4. Additional security measures such as encrypted data transfers and two-factor authentication.
And since it’s located in the cloud, this solution is available on any device with an internet connection.
Ready for a new signing experience?
Asterisk denotes mandatory fields (*)
No credit card required
By clicking "Get Started" you agree to receive marketing communications from us in accordance with our Privacy Policy
Thousands of companies love signNow
Fall leader 2020. G2 Crowd award badge.
signNow. It’s as easy as 1-2-3
No credit card required
Frequently asked questions
Learn everything you need to know to use signNow eSignature like a pro.
How do i add an electronic signature to a word document?
When a client enters information (such as a password) into the online form on , the information is encrypted so the client cannot see it. An authorized representative for the client, called a "Doe Representative," must enter the information into the "Signature" field to complete the signature.
How do i sign electronic signature?
How do i sign an electronic signature? A. The signature of the person who signs is called the "Electronic Signature". (See General Instruction 1, "Signing Documents" at § 11-1-1301 for information on Signing Documents.)Q. Does Connecticut have a "Citizen's Signature Declaration" or "Signatures and Affidavits of Address" form? A. There is a Citizen's Signature Declaration or Signatures and Affidavits of Address form but it is not required for filing purposes. There are also two forms required for the filing of an official title application and vehicle title application:Citizen's Signature Declaration orCertificate of TitleQ. Is a Certificate of Title required when the registration of an owner-operated vehicle expires? A. No. A Certificate of Title and Registration may be issued to a vehicle when the registration of the vehicle expires. However, this document must not be used to circumvent the expiration of the registration because the Certificate of Title does not indicate the vehicle's registration year.Q. Does Connecticut offer a "Certificate of Title for an Out-of-State-Vehicle" form? A. No.Q. What is the difference between an original Certificate of Title and a Certificate of Registration? A. A Certificate of Title is valid for the entire life of a vehicle and must be maintained in the owner's name. A Certificate of Registration is valid only during a registration period, and does not allow the owner to change the vehicle. However, if a change o...
How to write electronic signature dat3?
A. In the current version, if you have a file in your account, you can save the file and add it to the file and use it in other programs or programs that can take text files as input. You can add a file to an existing file to save it to a new file, but you must rename the previous file. You can delete a file (in the program's file manager, or by using the program's "Delete File" command). You can save it to a file for transfer onto another computer and save it to the same file that you had before, but that new copy cannot have a different name. If you need to save a different file with the same name as an existing one and you have saved the file for a user who has already logged in at some point in the past, you can use this technique to save another copy of the file at the same name to the same file. Can you send and receive dat3 file with a program that does not have a file editor? A. Unfortunately, no. The program you are using must recognize a file (it's a data file for the file) and you must use a program that recognizes a file (not a plain text file!). The following are programs that recognize and can save files:• Windows• Mac OS• Linux• Solaris• Other Unix-like systems
|
{
"url": "https://www.signnow.com/business-cases/how-to-industry-e-sign-sports-maryland-presentation-safe",
"source_domain": "www.signnow.com",
"snapshot_id": "crawl=CC-MAIN-2022-21",
"warc_metadata": {
"Content-Length": "213232",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:YTRZCUQXUFSRLKLEE5SUCZ4HV2JOQDZR",
"WARC-Concurrent-To": "<urn:uuid:31e25d17-2aa6-4728-8c21-5db59db7c4d6>",
"WARC-Date": "2022-05-25T04:13:10Z",
"WARC-IP-Address": "35.171.103.41",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:AH4YBJWJKV4KYDQ4TFYSYWGN2SQDJAQA",
"WARC-Record-ID": "<urn:uuid:61f386f3-a18d-4fa4-9fbd-176045e73e3c>",
"WARC-Target-URI": "https://www.signnow.com/business-cases/how-to-industry-e-sign-sports-maryland-presentation-safe",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:d5f9ded4-1dcf-407b-8b19-de10556f4971>"
},
"warc_info": "isPartOf: CC-MAIN-2022-21\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-116\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
42,
43,
257,
258,
271,
272,
294,
317,
337,
338,
359,
360,
364,
373,
374,
430,
431,
769,
770,
905,
906,
1038,
1154,
1224,
1322,
1323,
1430,
1431,
1467,
1468,
1506,
1530,
1648,
1684,
1724,
1725,
1757,
1758,
1782,
1783,
1810,
1811,
1883,
1884,
1941,
1942,
2237,
2238,
2274,
2275,
3751,
3752,
3792,
3793
],
"line_end_idx": [
42,
43,
257,
258,
271,
272,
294,
317,
337,
338,
359,
360,
364,
373,
374,
430,
431,
769,
770,
905,
906,
1038,
1154,
1224,
1322,
1323,
1430,
1431,
1467,
1468,
1506,
1530,
1648,
1684,
1724,
1725,
1757,
1758,
1782,
1783,
1810,
1811,
1883,
1884,
1941,
1942,
2237,
2238,
2274,
2275,
3751,
3752,
3792,
3793,
4987
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4987,
"ccnet_original_nlines": 54,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3977619409561157,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.016276700422167778,
"rps_doc_frac_lines_end_with_ellipsis": 0.01818181946873665,
"rps_doc_frac_no_alph_words": 0.15157681703567505,
"rps_doc_frac_unique_words": 0.40267640352249146,
"rps_doc_mean_word_length": 4.861313819885254,
"rps_doc_num_sentences": 63,
"rps_doc_symbol_to_word_ratio": 0.0010172900510951877,
"rps_doc_unigram_entropy": 5.135481834411621,
"rps_doc_word_count": 822,
"rps_doc_frac_chars_dupe_10grams": 0.033533528447151184,
"rps_doc_frac_chars_dupe_5grams": 0.04304303973913193,
"rps_doc_frac_chars_dupe_6grams": 0.033533528447151184,
"rps_doc_frac_chars_dupe_7grams": 0.033533528447151184,
"rps_doc_frac_chars_dupe_8grams": 0.033533528447151184,
"rps_doc_frac_chars_dupe_9grams": 0.033533528447151184,
"rps_doc_frac_chars_top_2gram": 0.026026029139757156,
"rps_doc_frac_chars_top_3gram": 0.02102101966738701,
"rps_doc_frac_chars_top_4gram": 0.019019020721316338,
"rps_doc_books_importance": -389.1280212402344,
"rps_doc_books_importance_length_correction": -389.1280212402344,
"rps_doc_openwebtext_importance": -266.6771545410156,
"rps_doc_openwebtext_importance_length_correction": -266.6771545410156,
"rps_doc_wikipedia_importance": -140.21832275390625,
"rps_doc_wikipedia_importance_length_correction": -140.21832275390625
},
"fasttext": {
"dclm": 0.1348368525505066,
"english": 0.9237767457962036,
"fineweb_edu_approx": 1.6693822145462036,
"eai_general_math": 0.20963555574417114,
"eai_open_web_math": 0.19163870811462402,
"eai_web_code": 0.021482709795236588
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.82",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "658.40285",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "6",
"label": "Promotional/Advertisement"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "17",
"label": "Product Page"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-1,854,186,648,584,866,000 |
Short: RShell-Protector, a BBS/Network tool for remote-shells Author: Matthias Bethke Uploader: Matthias Bethke mni fh-giessen de Type: comm/misc Architecture: m68k-amigaos RShell-Protector is an intuition patch that prevents a remote-shell from hanging if you attempt to start a GUI-driven program that is neither self-detaching nor Ctrl-C-abortable. A must-have for every sysop! History: V37.5 : optimized again, released to AmiNet V37.4 : made the code 100% system conforming, overall optimization not on AmiNet V37.3 : removed some bogus code, optimized a bit, less stack usage, source "documentashun" V37.2 : variable-name now configurable via commandline V37.1 : first release
|
{
"url": "https://mirror.xmission.com/aminet/comm/misc/RSP37_5.readme",
"source_domain": "mirror.xmission.com",
"snapshot_id": "CC-MAIN-2024-38",
"warc_metadata": {
"Content-Length": "988",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:YD6IMIHFQL5YPKP52F5LWXGNWMQ5UIUM",
"WARC-Concurrent-To": "<urn:uuid:b341e38d-4dfb-40fb-bd76-f5b062ec1152>",
"WARC-Date": "2024-09-20T04:28:42Z",
"WARC-IP-Address": "198.60.22.13",
"WARC-Identified-Payload-Type": "text/plain",
"WARC-Payload-Digest": "sha1:PDPC2GLFPMR4WPPDYVYM5UHE5M3L45JG",
"WARC-Record-ID": "<urn:uuid:d75c1043-9f55-47c6-9316-2ffbabb107ca>",
"WARC-Target-URI": "https://mirror.xmission.com/aminet/comm/misc/RSP37_5.readme",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8852a152-368b-4394-9475-cbf437bf925f>"
},
"warc_info": "isPartOf: CC-MAIN-2024-38\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-228\r\nsoftware: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0
],
"line_end_idx": [
682
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 682,
"ccnet_original_nlines": 0,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.21854305267333984,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05960265174508095,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3112582862377167,
"rps_doc_frac_unique_words": 0.8461538553237915,
"rps_doc_mean_word_length": 6,
"rps_doc_num_sentences": 8,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.2700886726379395,
"rps_doc_word_count": 91,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.05128204822540283,
"rps_doc_frac_chars_top_3gram": 0,
"rps_doc_frac_chars_top_4gram": 0,
"rps_doc_books_importance": -62.98600769042969,
"rps_doc_books_importance_length_correction": -67.82229614257812,
"rps_doc_openwebtext_importance": -34.11979293823242,
"rps_doc_openwebtext_importance_length_correction": -38.95608139038086,
"rps_doc_wikipedia_importance": -15.473044395446777,
"rps_doc_wikipedia_importance_length_correction": -20.30933380126953
},
"fasttext": {
"dclm": 0.034737229347229004,
"english": 0.781817615032196,
"fineweb_edu_approx": 1.0894113779067993,
"eai_general_math": 0.0630112886428833,
"eai_open_web_math": 0.14408737421035767,
"eai_web_code": 0.06745023280382156
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.82",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.678",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "17",
"label": "Product Page"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-1,155,514,453,624,649,000 |
201 reputation
11
bio website
location
age
visits member for 2 years, 9 months
seen Nov 22 '11 at 16:16
stats profile views 11
Mar
21
awarded Yearling
Oct
6
answered How much do other CDNs charge?
Aug
2
comment When and when not to use a CDN
You could use also use a protocol-less URL with the host name, like "//xyzf.cloudfront.net/images". This allows you to take advantage of ISP and corporate proxy caches for caching non-SSL versions of the images. This can have a tremendous benefit for both your visitor experience and server/bandwidth load. Our site's visitors are almost all from US-based financial institutions, and we detect about 85% visit from behind some form of caching proxy. YMMV, so test your own site and traffic of course.
Jul
21
comment What's the best FREE CDN service available?
CoralCDN is a research project hacked together by academics and hosted on PlanetLab. It is extraordinarily slow, and often doesn't respond at all. Don't use it for anything you care about. It's not monitored by anyone and barely works.The same is true of the other free "research" CDN, CobWeb (cob-web.org). It's main page doesn't even come up most of the time.
Jul
11
comment CDN png image not accessible from my machine
please accept my answer here if you found it useful
Jul
8
awarded Teacher
Jul
8
answered CDN png image not accessible from my machine
Mar
21
comment WHY my domain points back to previous IP after 1 day
8.8.8.8 is an anycast address: it is actually a service comprised of a whole bunch of servers sprinkled throughout the world. You can and will get different results from subsequent queries to Google DNS, depending on the cache status of the particular server you hit. It is not surprising that you would see differing resposnses during a DNS change.
Oct
31
answered Looking for a CDN
|
{
"url": "http://webmasters.stackexchange.com/users/6225/rmalayter?tab=activity",
"source_domain": "webmasters.stackexchange.com",
"snapshot_id": "crawl=CC-MAIN-2013-48",
"warc_metadata": {
"Content-Length": "35313",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:OWZP52DT3P4MEZPVAX6YSWVJKZGRD4I2",
"WARC-Concurrent-To": "<urn:uuid:19423612-9400-45d3-8ee3-c0a0e467a201>",
"WARC-Date": "2013-12-19T16:52:56Z",
"WARC-IP-Address": "198.252.206.16",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:QCDDI4I226RP5FQBAK5YVK7OV6MBCN4C",
"WARC-Record-ID": "<urn:uuid:3039c5cd-d1f9-49df-8d63-4ee0a32198cc>",
"WARC-Target-URI": "http://webmasters.stackexchange.com/users/6225/rmalayter?tab=activity",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:eca6aa56-6cf6-489f-a80a-b79b8b8b717a>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-33-133-15.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2013-48\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for Winter 2013\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
15,
18,
30,
39,
43,
79,
104,
127,
128,
132,
135,
153,
157,
159,
199,
203,
205,
244,
745,
749,
752,
804,
1166,
1170,
1173,
1226,
1278,
1282,
1284,
1301,
1305,
1307,
1361,
1365,
1368,
1429,
1779,
1783,
1786
],
"line_end_idx": [
15,
18,
30,
39,
43,
79,
104,
127,
128,
132,
135,
153,
157,
159,
199,
203,
205,
244,
745,
749,
752,
804,
1166,
1170,
1173,
1226,
1278,
1282,
1284,
1301,
1305,
1307,
1361,
1365,
1368,
1429,
1779,
1783,
1786,
1812
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1812,
"ccnet_original_nlines": 39,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3860103487968445,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.041450779885053635,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.19170984625816345,
"rps_doc_frac_unique_words": 0.6476190686225891,
"rps_doc_mean_word_length": 4.574603080749512,
"rps_doc_num_sentences": 23,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.0623345375061035,
"rps_doc_word_count": 315,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.05135323107242584,
"rps_doc_frac_chars_dupe_6grams": 0.05135323107242584,
"rps_doc_frac_chars_dupe_7grams": 0.05135323107242584,
"rps_doc_frac_chars_dupe_8grams": 0.05135323107242584,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.013879249803721905,
"rps_doc_frac_chars_top_3gram": 0.015267180278897285,
"rps_doc_frac_chars_top_4gram": 0.01943095028400421,
"rps_doc_books_importance": -184.461181640625,
"rps_doc_books_importance_length_correction": -181.09071350097656,
"rps_doc_openwebtext_importance": -93.66952514648438,
"rps_doc_openwebtext_importance_length_correction": -93.66952514648438,
"rps_doc_wikipedia_importance": -72.45894622802734,
"rps_doc_wikipedia_importance_length_correction": -72.3958740234375
},
"fasttext": {
"dclm": 0.022032560780644417,
"english": 0.9344983100891113,
"fineweb_edu_approx": 1.330981969833374,
"eai_general_math": 0.00689489021897316,
"eai_open_web_math": 0.05941110849380493,
"eai_web_code": 0.002682920079678297
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.72",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,153,040,046,519,636,000 |
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
Sign up
Here's how it works:
1. Anybody can ask a question
2. Anybody can answer
3. The best answers are voted up and rise to the top
I'd like to start learning Lisp as it sometimes leads to interesting answers on this site with concepts borrowed from this language, so I'm curious. As I already spend most of my programming time in Mathematica, is there a way to execute Lisp programs from the Mathematica frontend?
Same question for related languages, like Haskell or OCaml.
share|improve this question
2
I suppose you've seen this: stackoverflow.com/a/5451304/695132 Are you looking for a way to run some other language from the front end or to call it from the kernel? – Szabolcs Apr 13 '12 at 7:19
@Szabolcs: I guess what he wants is something like MathLink, but for Lisp. – celtschk Apr 13 '12 at 7:45
@Szabolcs yes I was looking for something like in the answer of WReach. The link of rubenko seems to do this. – faysou Apr 13 '12 at 8:37
One possible appraoch is to use a Lisp that runs on the JVM (for instance, ABCL), and then get at Mathematica through J/Link. – Pillsy Apr 13 '12 at 13:49
@Pillsy I think your comment could be an answer even if it's not tested yet. – faysou Apr 13 '12 at 13:56
Have a look at SchemeLink.
share|improve this answer
Thanks, I will try this when I can. – faysou Apr 13 '12 at 8:33
Clojure is often described as a "modern-day LISP" (hosted on the JVM) that offers strong support for multi-threaded code.
If the Clojure dialect of LISP is an option for you then you might want to investigate using the JLink-based interface to Clojure provided courtesy of this package: Clojuratica
Regarding Haskell and OCaml, your best bet may be trying to access F# (which is closely related to Haskell and OCaml) through .NETLink.
share|improve this answer
Nice link, thanks – faysou May 20 '12 at 21:13
I didn't downvote but it seems clojuratica support has somewhat ended. – William Sep 11 '15 at 22:14
I haven't actually tried this, but you might want to investigate using one of the Lisps for the JVM, such as Armed Bear Common Lisp, and interface to Mathematica through J/Link.
share|improve this answer
Your Answer
discard
By posting your answer, you agree to the privacy policy and terms of service.
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "http://mathematica.stackexchange.com/questions/4203/is-there-a-mathematica-lisp-link",
"source_domain": "mathematica.stackexchange.com",
"snapshot_id": "crawl=CC-MAIN-2016-18",
"warc_metadata": {
"Content-Length": "93928",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:C7MVKP7634TSWS4II4FOEBAXPXCS4OEJ",
"WARC-Concurrent-To": "<urn:uuid:656856af-5882-4421-ad7c-4ee81a2eee9d>",
"WARC-Date": "2016-05-04T21:21:20Z",
"WARC-IP-Address": "104.16.115.182",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:52TY6U2TTCF5ZU5WROKPZD4FWUGANMUM",
"WARC-Record-ID": "<urn:uuid:525289f1-bd52-4705-9622-d8032b36c118>",
"WARC-Target-URI": "http://mathematica.stackexchange.com/questions/4203/is-there-a-mathematica-lisp-link",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:f4fafe87-5235-4bef-b02c-664502befdf3>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-239-7-51.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2016-18\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for April 2016\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
125,
126,
134,
155,
187,
211,
266,
267,
550,
551,
611,
612,
640,
644,
840,
845,
950,
955,
1093,
1098,
1253,
1258,
1364,
1365,
1392,
1393,
1419,
1424,
1488,
1489,
1611,
1612,
1789,
1790,
1926,
1927,
1953,
1958,
2005,
2010,
2111,
2112,
2290,
2291,
2317,
2318,
2330,
2331,
2333,
2341,
2342,
2420,
2421
],
"line_end_idx": [
125,
126,
134,
155,
187,
211,
266,
267,
550,
551,
611,
612,
640,
644,
840,
845,
950,
955,
1093,
1098,
1253,
1258,
1364,
1365,
1392,
1393,
1419,
1424,
1488,
1489,
1611,
1612,
1789,
1790,
1926,
1927,
1953,
1958,
2005,
2010,
2111,
2112,
2290,
2291,
2317,
2318,
2330,
2331,
2333,
2341,
2342,
2420,
2421,
2511
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2511,
"ccnet_original_nlines": 53,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.39028775691986084,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03597122058272362,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.25,
"rps_doc_frac_unique_words": 0.49539169669151306,
"rps_doc_mean_word_length": 4.43317985534668,
"rps_doc_num_sentences": 25,
"rps_doc_symbol_to_word_ratio": 0.0017985600279644132,
"rps_doc_unigram_entropy": 4.984824180603027,
"rps_doc_word_count": 434,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.05613306164741516,
"rps_doc_frac_chars_dupe_6grams": 0.05613306164741516,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.0145530104637146,
"rps_doc_frac_chars_top_3gram": 0.021829519420862198,
"rps_doc_frac_chars_top_4gram": 0.02806653082370758,
"rps_doc_books_importance": -231.7595672607422,
"rps_doc_books_importance_length_correction": -231.7595672607422,
"rps_doc_openwebtext_importance": -127.28106689453125,
"rps_doc_openwebtext_importance_length_correction": -127.28106689453125,
"rps_doc_wikipedia_importance": -101.9160385131836,
"rps_doc_wikipedia_importance_length_correction": -101.9160385131836
},
"fasttext": {
"dclm": 0.08127343654632568,
"english": 0.9337702393531799,
"fineweb_edu_approx": 1.1584644317626953,
"eai_general_math": 0.0037655800115317106,
"eai_open_web_math": 0.3351268172264099,
"eai_web_code": -0.0000023800000690243905
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.132",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,798,675,757,824,060,000 |
name
Easy Math Problem
descirption
One day, Touma Kazusa encountered a easy math problem. Given n and k, she need to calculate the following sum modulo $1e9+7$.
$$∑_{i=1}^n∑^n_{j=1}gcd(i,j)^klcm(i,j)[gcd(i,j)∈prime]%(1e9+7) $$
However, as a poor student, Kazusa obviously did not, so Touma Kazusa went to ask Kitahara Haruki. But Kitahara Haruki is too busy, in order to prove that he is a skilled man, so he threw this problem to you. Can you answer this easy math problem quickly?
input
There are multiple test cases.$(T=5)$ The first line of the input contains an integer$T$, indicating the number of test cases. For each test case:
There are only two positive integers n and k which are separated by spaces.
$1≤n≤1e10$
$1≤k≤100$
output
An integer representing your answer.
sample input
1
10 2
sample output
2829
toturial
$$
\begin{aligned}
&\sum_{i=1}^n\sum_{j=1}^n ijgcd(i,j)^{k-1} gcd is prime
\=&\sum_{d\in prime} \sum_{i=1}^n\sum_{j=1}^nijd^{k-1}[gcd(i,j)=d]
\=&\sum_{d\in prime} \sum_{i=1}^{\lfloor\frac{n}{d}\rfloor}\sum_{j=1}^{\lfloor\frac{n}{d}\rfloor}ijd^{k+1}[gcd(i,j)=1]
\=&\sum_{d\in prime}d^{k+1} \sum_{i=1}^{\lfloor\frac{n}{d}\rfloor}\sum_{j=1}^{\lfloor\frac{n}{d}\rfloor}ij[gcd(i,j)=1]
\=&\sum_{d\in prime}d^{k+1} \sum_{j=1}^{\lfloor\frac{n}{d}\rfloor}j^2\phi(j)
\end{aligned}
$$
我们可以对n分块了,前面可以min25筛
$\begin{aligned}f(j)=j^2\phi(j)\end{aligned}$
$\begin{aligned}g(j)=j^2\end{aligned}$
$\begin{aligned}f\ast g(j)=\sum_{i|j}i^2\phi(i)(\frac{j}{i})^2=j^2\sum_{i|j}\phi(i)=j^2(\phi\ast 1)(j)=j^3\end{aligned}$
于是后面可以杜教筛
code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// 模意义
const ll mod=1e9+7;
ll qpow(ll a,ll b){
assert(a<mod);
ll res=1;
while(b){
if(b&1) res=res*a%mod;
a=a*a%mod;
b>>=1;
}return res;
}
const ll inv2=qpow(2,mod-2),inv3=qpow(3,mod-2);
inline ll reduce(ll x){return x<0?x+mod:x;}
inline ll A(ll a,ll b){assert(a<mod&&b<mod); return reduce(a+b-mod);}
inline ll M(ll a,ll b){assert(a<2*mod&&b<2*mod); return a*b%mod;}
inline ll M(ll a,ll b,ll c){return M(M(a,b),c);}
//线性筛
// 3e7 int = 120mb
const ll maxn=2.5e7;
bitset<maxn>vis;
int siiphi[maxn];
ll p[1565927+100];
void f_ini(){
siiphi[1]=1;
for (ll i=2;i<maxn;i++){
if(!vis[i]) p[++p[0]]=i,siiphi[i]=i-1;
for (ll j=1;i*p[j]<maxn;j++){
vis[i*p[j]]=true;
if(i%p[j])siiphi[i*p[j]]=siiphi[i]*(p[j]-1);//由积性函数性质推
else{siiphi[i*p[j]]=siiphi[i]*p[j];break;}
}
}
for(ll i=1;i<maxn;i++) siiphi[i]=A(siiphi[i-1],M(i,i,siiphi[i]));
}
// 分块
const ll sqr=3e5;
ll id1[sqr],id2[sqr],w[sqr],idn,idm;// w[x] 第几大的分块值是多少
inline ll& id(ll x){return x<sqr?id1[x]:id2[idn/x];}//返回x是第几大的整除分块值
void ini(ll n){
idn=n;idm=0;
for(ll l=1,r;l<=n;l=r+1){
r=n/(n/l);
id(n/l)=++idm;
w[idm]=n/l;
}
}
namespace min25shai{
ll g[sqr],sp[sqr];
ll getsum(ll x,ll n){// O(n) n次多项式有n+1项 y[0]...y[n] -> y[x]
static ll prepre[1000],suf[1000],r[1000]={1,1},y[1000],*pre=prepre+1;
if(y[999]!=++n) {//这里非常重要
y[999]=n;
for(ll i=1;i<=n;i++) y[i]=A(y[i-1],qpow(i,n-1));
for(ll i=2;i<=n;i++) r[i]=M(mod-mod/i,r[mod%i]);
for(ll i=2;i<=n;i++) r[i]=M(r[i],r[i-1]);
}
pre[-1]=suf[n+1]=1;
for(ll i=0;i<=n;++i) pre[i]=M(pre[i-1],x%mod-i+mod);//这个地方爆掉了
for(ll i=n;i>=0;i--) suf[i]=M(suf[i+1],i-x%mod+mod);//这个地方爆掉了
ll b=0;
for(ll i=0;i<=n;++i) {
ll up=M(pre[i-1],suf[i+1]);
ll down=M(r[i],r[n-i]);
b=A(b,M(y[i],up,down));
}
return b;
}
void min25(ll*g,ll n,ll k,ll(*f)(ll,ll),ll(*s)(ll,ll)){
for(ll i=1;i<=idm;++i) g[i]=A(s(w[i],k),mod-1);
for(ll j=1;p[j]*p[j]<=n;j++){
ll t=f(p[j],k);
sp[j]=A(sp[j-1],t);
for(ll i=1;w[i]>=p[j]*p[j];++i) g[i]=A(g[i],M(sp[j-1]-g[id(w[i]/p[j])]+mod,t));
// w[i]从大到小 当i等于m的时候 w[i]>=p[j]*p[j]恒不成立
}
}
}
namespace dujiaoshai{
// g(1)S(n)=(1≤i≤n)h(i)+(2≤d≤n)g(d)S(n/d)
// f(n)=n*n*phi(n)
// g(n)=n*n
// h(n)=n*n*n
ll s[sqr];// 前缀和
inline ll s1(ll n){return M(n,n+1,inv2);}
inline ll s2(ll n){return M(s1(n),2*n+1,inv3);}
inline ll s3(ll n){return M(s1(n),s1(n));}
void ini(){for(ll i=1;i<=idm;i++)s[i]=0;}
ll dujiao(ll n){
if(n<maxn) return siiphi[n];
if(s[id(n)]!=0) return s[id(n)];
s[id(n)]=s3(n%mod);
for(ll l=2,r;l<=n;l=r+1){
r=n/(n/l);
s[id(n)]-=(s2(r%mod)-s2((l-1)%mod))*dujiao(n/l)%mod;
}
return s[id(n)]=(s[id(n)]%mod+mod)%mod;
}
}
ll solve(ll n,ll k){
ini(n);
dujiaoshai::ini();
#define F(M) [](ll n,ll k){return ll(M);}
min25shai::min25(min25shai::g,n,k+1,F(qpow(n%mod,k)),F(min25shai::getsum(n,k)));
#undef F
ll res=0;
for(ll l=1,r;l<=n;l=r+1){
r=n/(n/l);
ll t1=dujiaoshai::dujiao(n/l);
ll t2=min25shai::g[id(r)];
if(l!=1) t2+=mod-min25shai::g[id(l-1)];
res+=M(t1,t2);
}
return res%mod;
}
inline ll read(){ll x;cin>>x;return x;}
int main() {
f_ini();
for(ll t=read();t>=1;t--){
ll n=read(),k=read();
cout<<solve(n,k)<<endl;
}
}
请我喝[茶]~( ̄▽ ̄)~*
fightinggg 微信支付
微信支付
fightinggg 支付宝
支付宝
fightinggg 贝宝
贝宝
|
{
"url": "https://fightinggg.github.io/shoka/Q056L8.html",
"source_domain": "fightinggg.github.io",
"snapshot_id": "CC-MAIN-2023-06",
"warc_metadata": {
"Content-Length": "49746",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:DC2DAEHEBNHHWHDB52ZBJCXG3EAV6WSD",
"WARC-Concurrent-To": "<urn:uuid:196c215f-600e-4c45-ade8-8d1f87a8d5a9>",
"WARC-Date": "2023-02-03T12:50:47Z",
"WARC-IP-Address": "185.199.110.153",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:XCNCBIR67LIXRY2EHRANXGCPRZMGCDIE",
"WARC-Record-ID": "<urn:uuid:d71f7471-26b5-4bda-b3c8-58c871d70b1b>",
"WARC-Target-URI": "https://fightinggg.github.io/shoka/Q056L8.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8abd5757-5d67-46f4-b56a-dac07e3ecdcd>"
},
"warc_info": "isPartOf: CC-MAIN-2023-06\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for January/February 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-225\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
5,
6,
24,
25,
37,
38,
164,
230,
486,
487,
493,
494,
641,
717,
728,
738,
739,
746,
747,
784,
785,
798,
799,
801,
806,
807,
821,
822,
827,
828,
837,
838,
841,
857,
913,
980,
1099,
1218,
1295,
1309,
1312,
1333,
1379,
1418,
1539,
1549,
1550,
1555,
1556,
1558,
1560,
1562,
1564,
1566,
1568,
1570,
1572,
1574,
1577,
1580,
1583,
1586,
1589,
1592,
1595,
1598,
1601,
1604,
1607,
1610,
1613,
1616,
1619,
1622,
1625,
1628,
1631,
1634,
1637,
1640,
1643,
1646,
1649,
1652,
1655,
1658,
1661,
1664,
1667,
1670,
1673,
1676,
1679,
1682,
1685,
1688,
1691,
1694,
1697,
1700,
1703,
1706,
1709,
1712,
1715,
1718,
1721,
1724,
1727,
1730,
1733,
1736,
1739,
1742,
1745,
1748,
1751,
1754,
1757,
1760,
1763,
1766,
1769,
1772,
1775,
1778,
1781,
1784,
1787,
1790,
1793,
1796,
1799,
1802,
1805,
1808,
1811,
1814,
1817,
1820,
1823,
1826,
1829,
1832,
1835,
1838,
1841,
1844,
1848,
1852,
1856,
1860,
1864,
1868,
1872,
1876,
1880,
1884,
1888,
1892,
1896,
1900,
1904,
1908,
1912,
1916,
1920,
1924,
1928,
1932,
1936,
1940,
1944,
1948,
1952,
1956,
1960,
1964,
1968,
1972,
1976,
2000,
2021,
2043,
2044,
2051,
2071,
2091,
2106,
2116,
2126,
2149,
2160,
2167,
2180,
2182,
2230,
2274,
2344,
2410,
2459,
2460,
2466,
2485,
2506,
2523,
2541,
2560,
2574,
2587,
2612,
2651,
2681,
2699,
2754,
2797,
2799,
2801,
2867,
2869,
2870,
2876,
2894,
2949,
3017,
3033,
3046,
3072,
3083,
3098,
3110,
3112,
3114,
3115,
3136,
3155,
3215,
3285,
3311,
3321,
3370,
3419,
3461,
3463,
3483,
3545,
3607,
3615,
3638,
3666,
3690,
3714,
3716,
3726,
3728,
3784,
3832,
3862,
3878,
3898,
3978,
4019,
4021,
4023,
4025,
4026,
4048,
4090,
4109,
4121,
4135,
4152,
4194,
4242,
4285,
4327,
4344,
4373,
4406,
4426,
4452,
4463,
4516,
4518,
4558,
4560,
4562,
4563,
4584,
4592,
4611,
4653,
4734,
4743,
4753,
4779,
4790,
4821,
4848,
4888,
4903,
4905,
4921,
4923,
4924,
4964,
4977,
4986,
5013,
5035,
5059,
5061,
5063,
5064,
5079,
5080,
5096,
5097,
5102,
5103,
5118,
5119,
5123,
5124,
5138,
5139
],
"line_end_idx": [
5,
6,
24,
25,
37,
38,
164,
230,
486,
487,
493,
494,
641,
717,
728,
738,
739,
746,
747,
784,
785,
798,
799,
801,
806,
807,
821,
822,
827,
828,
837,
838,
841,
857,
913,
980,
1099,
1218,
1295,
1309,
1312,
1333,
1379,
1418,
1539,
1549,
1550,
1555,
1556,
1558,
1560,
1562,
1564,
1566,
1568,
1570,
1572,
1574,
1577,
1580,
1583,
1586,
1589,
1592,
1595,
1598,
1601,
1604,
1607,
1610,
1613,
1616,
1619,
1622,
1625,
1628,
1631,
1634,
1637,
1640,
1643,
1646,
1649,
1652,
1655,
1658,
1661,
1664,
1667,
1670,
1673,
1676,
1679,
1682,
1685,
1688,
1691,
1694,
1697,
1700,
1703,
1706,
1709,
1712,
1715,
1718,
1721,
1724,
1727,
1730,
1733,
1736,
1739,
1742,
1745,
1748,
1751,
1754,
1757,
1760,
1763,
1766,
1769,
1772,
1775,
1778,
1781,
1784,
1787,
1790,
1793,
1796,
1799,
1802,
1805,
1808,
1811,
1814,
1817,
1820,
1823,
1826,
1829,
1832,
1835,
1838,
1841,
1844,
1848,
1852,
1856,
1860,
1864,
1868,
1872,
1876,
1880,
1884,
1888,
1892,
1896,
1900,
1904,
1908,
1912,
1916,
1920,
1924,
1928,
1932,
1936,
1940,
1944,
1948,
1952,
1956,
1960,
1964,
1968,
1972,
1976,
2000,
2021,
2043,
2044,
2051,
2071,
2091,
2106,
2116,
2126,
2149,
2160,
2167,
2180,
2182,
2230,
2274,
2344,
2410,
2459,
2460,
2466,
2485,
2506,
2523,
2541,
2560,
2574,
2587,
2612,
2651,
2681,
2699,
2754,
2797,
2799,
2801,
2867,
2869,
2870,
2876,
2894,
2949,
3017,
3033,
3046,
3072,
3083,
3098,
3110,
3112,
3114,
3115,
3136,
3155,
3215,
3285,
3311,
3321,
3370,
3419,
3461,
3463,
3483,
3545,
3607,
3615,
3638,
3666,
3690,
3714,
3716,
3726,
3728,
3784,
3832,
3862,
3878,
3898,
3978,
4019,
4021,
4023,
4025,
4026,
4048,
4090,
4109,
4121,
4135,
4152,
4194,
4242,
4285,
4327,
4344,
4373,
4406,
4426,
4452,
4463,
4516,
4518,
4558,
4560,
4562,
4563,
4584,
4592,
4611,
4653,
4734,
4743,
4753,
4779,
4790,
4821,
4848,
4888,
4903,
4905,
4921,
4923,
4924,
4964,
4977,
4986,
5013,
5035,
5059,
5061,
5063,
5064,
5079,
5080,
5096,
5097,
5102,
5103,
5118,
5119,
5123,
5124,
5138,
5139,
5141
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5141,
"ccnet_original_nlines": 326,
"rps_doc_curly_bracket": 0.031122349202632904,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2304210066795349,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.015844270586967468,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5441375970840454,
"rps_doc_frac_unique_words": 0.7279279232025146,
"rps_doc_mean_word_length": 5.699099063873291,
"rps_doc_num_sentences": 19,
"rps_doc_symbol_to_word_ratio": 0.0018107700161635876,
"rps_doc_unigram_entropy": 5.700244426727295,
"rps_doc_word_count": 555,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.022763200104236603,
"rps_doc_frac_chars_top_3gram": 0.014227000065147877,
"rps_doc_frac_chars_top_4gram": 0.008852359838783741,
"rps_doc_books_importance": -1056.1273193359375,
"rps_doc_books_importance_length_correction": -1056.1273193359375,
"rps_doc_openwebtext_importance": -638.6588134765625,
"rps_doc_openwebtext_importance_length_correction": -638.6588134765625,
"rps_doc_wikipedia_importance": -517.7437133789062,
"rps_doc_wikipedia_importance_length_correction": -517.7437133789062
},
"fasttext": {
"dclm": 0.9320222735404968,
"english": 0.20160244405269623,
"fineweb_edu_approx": 2.203166961669922,
"eai_general_math": 0.9332689046859741,
"eai_open_web_math": 0.8253716826438904,
"eai_web_code": 0.5684889554977417
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "512.7",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Algebra"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "4",
"label": "Advanced Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-3,330,271,082,196,693,000 |
Markers & Data
Loading and displaying geospatial data from GeoJSON, GPX, and other files.
Reading data files
The following example displays countries of the world as simple polygons. Reads from a GeoJSON file, and uses default marker creation, i.e. features are represented by simple markers in the default style.
UnfoldingMap map;
void setup() {
size(800, 600, GLConstants.GLGRAPHICS);
map = new UnfoldingMap(this);
MapUtils.createDefaultEventDispatcher(this, map);
List<Feature> countries = GeoJSONReader.loadData(this, "countries.geo.json");
List<Marker> countryMarkers = MapUtils.createSimpleMarkers(countries);
map.addMarkers(countryMarkers);
}
void draw() {
map.draw();
}
As easily you can load data from sources in other formats, for instance an online GeoRSS containing the latest earthquakes.
String rssUrl = "http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M5.xml";
List<Feature> features = GeoRSSReader.loadData(this, rssUrl);
List<Marker> markers = MapUtils.createSimpleMarkers(features);
The provided data readers support basic functionality, and do not fully implement the respective specifications. The GeoJSON parser supports most features, while the GeoRSS reader supports only Simple and W3C Geo, but not GML, and the GPX reader only enables reading track points. So, either use some other library to parse various data formats with full specification support, or tell us what file you are trying to read in our issue tracker.
Using Shapefiles
Various kinds of geo-data are freely available, and often provided as Shapefile. These contain geometries such as points, lines, and polygons, and additional data attributes.
Unfolding does not provide parsing Shapefiles out-of-the-box. You can either use some library to parse those and convert them to Unfolding markers. See for instance how to read Shapefiles in Java by utilizing the GeoTools library.
Alternatively, you can convert a Shapefile to another format. One easy tool is the OGR Simple Feature Library (part of GDAL). After installing it on your machine, you can simply convert geo-data from one format to another, e.g.:
ogr2ogr -f geoJSON countries.json countries.shp
If you don’t want to install that library, you can use the ogr2ogr web client.
For an example, let’s use a Shapefile containing borders of all countries. Download the simplified version from thematicmapping.org. Then, go to ogr2ogr web client, upload that zip file, and convert it to GeoJSON. Save the result as “countries-simple.geo.json” in the data folder of your Unfolding sketch. Now, you simply have to load and use the data to create markers.
List<Feature> countries = GeoJSONReader.loadData(this, "countries-simple.geo.json");
Features and Markers
A Feature (API) contains the geographic data such as a single location for a point, or multiple locations for lines or polygons, and optionally some data properties. A Marker (API) is the visual representations of a feature on a map.
In the examples above, we create default markers automatically from the loaded geo data.
List<Feature> features = GeoDataReader.loadData(this, dataFile);
List<Marker> markers = MapUtils.createSimpleMarkers(features);
This way, Unfolding creates simple markers in the default style. If you want to change the display style, or have extended functionality you need to create the markers on your own. There are two ways of doing that:
Specify which markers to create automatically
You can create other markers than the default ones from features. Specify an appropriate marker class, and create the markers from some already populated features.
MarkerFactory markerFactory = new MarkerFactory();
markerFactory.setPolygonClass(MyPolygonMarker.class);
List<Marker> markers = markerFactory.createMarkers(features);
map.addMarkers(markers);
See the Markers tutorial on how to create own marker classes.
(More details coming soon.)
Create markers from features manually
If you want to use an existing marker class, but set some visual properties based on data attributes, you can do that by creating the markers on your own.
Marker & Data: MBTA Lines
In this example the transit lines in Boston are loaded from a GeoJSON file as features (line 4). Then, we check for the data attribute containing the name of the MBTA line (line 11). Lastly, we use that name to color code the line markers (lines 12-29), and add them to the map (line 34).
List<Marker> transitMarkers = new ArrayList<Marker>();
// Load features from GeoJSON
List<Feature> transitLines = GeoJSONReader.loadData(this, "MBTARapidTransitLines.json");
// Create markers from features, and use LINE property to color the markers.
for (Feature feature : transitLines) {
ShapeFeature lineFeature = (ShapeFeature) feature;
SimpleLinesMarker m = new SimpleLinesMarker(lineFeature.getLocations());
String lineColor = lineFeature.getStringProperty("LINE");
int color = 0;
// Original MBTA colors
if (lineColor.equals("BLUE")) {
color = color(44, 91, 167);
}
if (lineColor.equals("RED")) {
color = color(233, 57, 35);
}
if (lineColor.equals("GREEN")) {
color = color(59, 130, 79);
}
if (lineColor.equals("SILVER")) {
color = color(154, 156, 157);
}
if (lineColor.equals("ORANGE")) {
color = color(238, 137, 40);
}
m.setColor(color);
m.setStrokeWeight(5);
transitMarkers.add(m);
}
map.addMarkers(transitMarkers);
See the MBTA Lines example for the full code.
Generalization & Level of detail
(As you can see, the simplified (i.e. generalized) border data results in overlaps and gaps between the vector countries and the underlying tiles. Use a high detailed data file to prevent this. For performance boosts, look at our examples AutoGeneralization or ZoomDependentPolygonData.)
|
{
"url": "http://unfoldingmaps.org/tutorials/markers-data-geojson.html",
"source_domain": "unfoldingmaps.org",
"snapshot_id": "crawl=CC-MAIN-2013-48",
"warc_metadata": {
"Content-Length": "21979",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:IHQ4GPB6X5SC6JCKZIVEW3SENA3YUSUS",
"WARC-Concurrent-To": "<urn:uuid:7e793c49-2258-41fd-b88b-28e941baf02d>",
"WARC-Date": "2013-12-07T21:52:12Z",
"WARC-IP-Address": "204.232.175.78",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:PPQJKWZV52ADMHNOS7ZB7O2SZIMMYBDT",
"WARC-Record-ID": "<urn:uuid:23ebe547-0b9b-4319-95c5-2916874beacf>",
"WARC-Target-URI": "http://unfoldingmaps.org/tutorials/markers-data-geojson.html",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:06439425-c0fc-45c3-af6b-721f1b4e49d1>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-33-133-15.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2013-48\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for Winter 2013\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
15,
16,
91,
92,
111,
112,
317,
318,
336,
337,
352,
393,
394,
425,
476,
477,
556,
628,
661,
663,
664,
678,
691,
693,
694,
818,
819,
901,
963,
1026,
1027,
1471,
1472,
1489,
1490,
1665,
1666,
1897,
1898,
2127,
2128,
2176,
2177,
2256,
2257,
2628,
2629,
2714,
2715,
2736,
2737,
2971,
2972,
3061,
3062,
3127,
3190,
3191,
3406,
3407,
3453,
3454,
3618,
3619,
3670,
3724,
3786,
3811,
3812,
3874,
3875,
3903,
3904,
3942,
3943,
4098,
4099,
4125,
4126,
4415,
4416,
4472,
4473,
4504,
4594,
4596,
4674,
4714,
4767,
4768,
4843,
4903,
4920,
4946,
4980,
5011,
5015,
5048,
5079,
5083,
5118,
5149,
5153,
5189,
5222,
5226,
5262,
5294,
5298,
5319,
5343,
5368,
5371,
5372,
5405,
5406,
5452,
5453,
5486,
5487
],
"line_end_idx": [
15,
16,
91,
92,
111,
112,
317,
318,
336,
337,
352,
393,
394,
425,
476,
477,
556,
628,
661,
663,
664,
678,
691,
693,
694,
818,
819,
901,
963,
1026,
1027,
1471,
1472,
1489,
1490,
1665,
1666,
1897,
1898,
2127,
2128,
2176,
2177,
2256,
2257,
2628,
2629,
2714,
2715,
2736,
2737,
2971,
2972,
3061,
3062,
3127,
3190,
3191,
3406,
3407,
3453,
3454,
3618,
3619,
3670,
3724,
3786,
3811,
3812,
3874,
3875,
3903,
3904,
3942,
3943,
4098,
4099,
4125,
4126,
4415,
4416,
4472,
4473,
4504,
4594,
4596,
4674,
4714,
4767,
4768,
4843,
4903,
4920,
4946,
4980,
5011,
5015,
5048,
5079,
5083,
5118,
5149,
5153,
5189,
5222,
5226,
5262,
5294,
5298,
5319,
5343,
5368,
5371,
5372,
5405,
5406,
5452,
5453,
5486,
5487,
5774
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5774,
"ccnet_original_nlines": 120,
"rps_doc_curly_bracket": 0.0027710399590432644,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2663230299949646,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01975945010781288,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2981099784374237,
"rps_doc_frac_unique_words": 0.4399460256099701,
"rps_doc_mean_word_length": 6.062078475952148,
"rps_doc_num_sentences": 84,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.260422229766846,
"rps_doc_word_count": 741,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.02181655913591385,
"rps_doc_frac_chars_dupe_6grams": 0.013357079587876797,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.010685659945011139,
"rps_doc_frac_chars_top_3gram": 0.0053428299725055695,
"rps_doc_frac_chars_top_4gram": 0.007123779971152544,
"rps_doc_books_importance": -473.2038269042969,
"rps_doc_books_importance_length_correction": -473.2038269042969,
"rps_doc_openwebtext_importance": -306.55950927734375,
"rps_doc_openwebtext_importance_length_correction": -306.55950927734375,
"rps_doc_wikipedia_importance": -123.26850891113281,
"rps_doc_wikipedia_importance_length_correction": -123.26850891113281
},
"fasttext": {
"dclm": 0.30057698488235474,
"english": 0.7006502747535706,
"fineweb_edu_approx": 2.979086399078369,
"eai_general_math": 0.8167385458946228,
"eai_open_web_math": 0.15051567554473877,
"eai_web_code": 0.8785154819488525
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "910",
"labels": {
"level_1": "History and Geography",
"level_2": "Geography and Voyages and travels",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "6",
"label": "Indeterminate"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,680,304,476,804,646,000 |
To set up how statistical data is recorded, you configure statistics intervals.
Statistic intervals determine the frequency at which statistic queries occur, the length of time statistical data is stored in the database, and the type of statistical data collected.
Enabling a statistics interval increases the number of statistics stored in the vCenter Server database. Disabling a statistics interval disables all subsequent intervals and decreases the number of statistics stored in the vCenter Server database.
The impact of the statistics collection on your vCenter Server database is based on the current vCenter Server and inventory size.
|
{
"url": "https://pubs.vmware.com/vsphere-50/topic/com.vmware.vsphere.vcenterhost.doc_50/GUID-ECEE0FB9-9091-4520-B137-62D200862AB8.html",
"source_domain": "pubs.vmware.com",
"snapshot_id": "crawl=CC-MAIN-2018-13",
"warc_metadata": {
"Content-Length": "10121",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:TR6Q6OCYWGHOQSVEDENLVQG6N3R5XVP6",
"WARC-Concurrent-To": "<urn:uuid:9ea68849-60d5-45cd-bef0-dffdb0cf6943>",
"WARC-Date": "2018-03-21T20:30:48Z",
"WARC-IP-Address": "104.91.64.161",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:WMR6GYPJ3M3JUTJ47XGRPLO6RQ4PHI6Z",
"WARC-Record-ID": "<urn:uuid:25765f35-ae11-4c13-a42a-8c5fd4128485>",
"WARC-Target-URI": "https://pubs.vmware.com/vsphere-50/topic/com.vmware.vsphere.vcenterhost.doc_50/GUID-ECEE0FB9-9091-4520-B137-62D200862AB8.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:d8e178e2-cf52-4711-ba81-4fffa4de720c>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-233-130-109.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-13\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for March 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
2,
3,
83,
84,
269,
270,
519,
520
],
"line_end_idx": [
2,
3,
83,
84,
269,
270,
519,
520,
650
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 650,
"ccnet_original_nlines": 8,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3365384638309479,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.07692307978868484,
"rps_doc_frac_unique_words": 0.5104166865348816,
"rps_doc_mean_word_length": 5.635416507720947,
"rps_doc_num_sentences": 5,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 3.607968330383301,
"rps_doc_word_count": 96,
"rps_doc_frac_chars_dupe_10grams": 0.19593346118927002,
"rps_doc_frac_chars_dupe_5grams": 0.19593346118927002,
"rps_doc_frac_chars_dupe_6grams": 0.19593346118927002,
"rps_doc_frac_chars_dupe_7grams": 0.19593346118927002,
"rps_doc_frac_chars_dupe_8grams": 0.19593346118927002,
"rps_doc_frac_chars_dupe_9grams": 0.19593346118927002,
"rps_doc_frac_chars_top_2gram": 0.09611830115318298,
"rps_doc_frac_chars_top_3gram": 0.06099814921617508,
"rps_doc_frac_chars_top_4gram": 0.07763400673866272,
"rps_doc_books_importance": -26.70406150817871,
"rps_doc_books_importance_length_correction": -36.261077880859375,
"rps_doc_openwebtext_importance": -21.641738891601562,
"rps_doc_openwebtext_importance_length_correction": -31.19875717163086,
"rps_doc_wikipedia_importance": -5.158636569976807,
"rps_doc_wikipedia_importance_length_correction": -14.715654373168945
},
"fasttext": {
"dclm": 0.8038069605827332,
"english": 0.8495926856994629,
"fineweb_edu_approx": 3.2683792114257812,
"eai_general_math": 0.9932578802108765,
"eai_open_web_math": 0.5659173727035522,
"eai_web_code": 0.16880518198013306
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.16",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-869,322,524,440,194,400 |
Erweiterung zum speichern von Mails per Drag and Drop?
• HI!
Git es eine Erweiterung zum Speichern einer Mail per Drag and Drop (soll gleicher Effekt sein, wie wenn man ueber das Menu geht)?
Gruss
• Guten Morgen Markus2005,
kannst du etwas genauer beschreiben, was du meinst?
Du kannst doch eine Mail einfach auf den gewünschten Ordner ziehen, oder?
• ich meine nicht innerhalb von TB sondern z.B. auf das Laufwerk C. Im Menu kann man dies erreichen mit Datei -> speichern als -> Datei -> Zielordner suchen; Dateinamen eingeben, Dateityp auswaehlen -> bestaetigen (und es wird eine Text-Datei erstellt. Dieser lange Weg ueber das menu sollte eben auch per Drag and Drop klappen!
|
{
"url": "https://www.thunderbird-mail.de/forum/thread/36406-erweiterung-zum-speichern-von-mails-per-drag-and-drop/",
"source_domain": "www.thunderbird-mail.de",
"snapshot_id": "crawl=CC-MAIN-2018-47",
"warc_metadata": {
"Content-Length": "88178",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:LJSZG5GV3PQERLRSU7BGFEYHW3TYEBDT",
"WARC-Concurrent-To": "<urn:uuid:5bec2df8-4a9b-4bd1-936e-49e37733bd52>",
"WARC-Date": "2018-11-16T20:23:29Z",
"WARC-IP-Address": "92.51.182.249",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:5L5OOP4U764T3UREBMZ57BOEPEW5XGGL",
"WARC-Record-ID": "<urn:uuid:2cfdf0b1-45ad-4521-aa55-7dee2fc04257>",
"WARC-Target-URI": "https://www.thunderbird-mail.de/forum/thread/36406-erweiterung-zum-speichern-von-mails-per-drag-and-drop/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:576b2af5-17d8-4b71-85e0-b5f09121d851>"
},
"warc_info": "isPartOf: CC-MAIN-2018-47\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November 2018\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-228-195-45.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 0.11-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
55,
56,
64,
65,
66,
200,
201,
202,
212,
213,
242,
243,
244,
300,
378,
379
],
"line_end_idx": [
55,
56,
64,
65,
66,
200,
201,
202,
212,
213,
242,
243,
244,
300,
378,
379,
709
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 709,
"ccnet_original_nlines": 16,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.05925925821065903,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.029629629105329514,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.192592591047287,
"rps_doc_frac_unique_words": 0.7272727489471436,
"rps_doc_mean_word_length": 4.890909194946289,
"rps_doc_num_sentences": 10,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.274832248687744,
"rps_doc_word_count": 110,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.03903346136212349,
"rps_doc_frac_chars_top_3gram": 0.05576207861304283,
"rps_doc_frac_chars_top_4gram": 0.07806690782308578,
"rps_doc_books_importance": -46.142086029052734,
"rps_doc_books_importance_length_correction": -46.683067321777344,
"rps_doc_openwebtext_importance": -23.74349594116211,
"rps_doc_openwebtext_importance_length_correction": -24.28447723388672,
"rps_doc_wikipedia_importance": -18.342960357666016,
"rps_doc_wikipedia_importance_length_correction": -18.883941650390625
},
"fasttext": {
"dclm": 0.4944145679473877,
"english": 0.001726430025883019,
"fineweb_edu_approx": 0.9537243247032166,
"eai_general_math": 0.004423200152814388,
"eai_open_web_math": 0.17926329374313354,
"eai_web_code": 0.5079172849655151
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "1",
"label": "No Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "1",
"label": "General Audience"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,578,479,657,747,270,000 |
Thursday, April 29, 2010
Evil interfaces
The Electronic Frontier Foundation calls out Facebook for its deliberate attempts to compromise its users' privacy. Good for EFF for taking the fight to Facebook.
I've complained before about mis-designed interfaces that are used to extract money from consumers. This sort of stuff gives interface designers a bad name.
Tuesday, April 20, 2010
Usability, Scott Adams style
Here's another good strip about usability from Scott Adams. Some of his previous strips have described usability testing as well. It's interesting that he keeps working this topic.
Monday, April 19, 2010
They didn't give us good requirements
"They didn't give us good requirements" is an explanation that I sometimes hear from IT people to explain why a certain system turned out to be unusable. "They" are the business people who were asking for the system in question. In fact, "giving requirements" is a fact of life in a lot of companies. Business people furnish requirements and IT people develop the applications.
The thing is, IT people complain often about people consulted too late or not at all on the purpose and function of new applications. Well, if you sit around and wait for someone to "give you requirements," you've assigned yourself a pretty junior position on a development team. If IT people would actively engage in helping to define the application purpose and scope in a positive way, business people would be more inclined to treat them as partners. And everyone would win.
Sunday, April 11, 2010
Innovate Carolina 2010: review
I attended the Innovate Carolina conference yesterday at the Kenan Flagler business school at UNC Chapel Hill. (Full disclosure: I was on the conference committee.) The sessions were excellent. The best part of a small conference like that is the chance to talk to the speakers and attendees. I collected cards from people I'll be talking business with in the next few weeks.
By the way, if anyone wants to work on next year's event, please contact me.
Wednesday, April 7, 2010
"Generate me some alternatives"
Executives' requests for "design alternatives" has lead a lot of designers to engage in an elaborate ritual for the purpose of managing the executives. It works like this.
Execs make decisions. That's what they do. So rather than asking that a product be developed, they ask for "alternatives" so that they can make a decision. Because, as any exec will tell you, making decisions is the hard stuff, and that's what they get paid to do. Generating alternatives is the easy stuff, they believe. So it's up to the designers to generate a lot of alternatives and allow the execs to choose one.
Designers don't see things exactly that way. Designing a really good product is hard work. And once a great alternative is designed it's relatively easy to pick a good one out of competing alternatives. In fact, experienced designers regularly generate alternatives early in the design process as a way of expanding their own space of possible solutions. They'll then try to work the best features of each alternative into a final design.
Do you think the execs get to see these early concepts? Well, only if the designer is inexperienced or wants to see disaster strike. No, experienced designers will drive toward a good design from among several alternatives, then generate some relatively bad "alternatives" for a dog-and-pony show with the execs. Unless lightning strikes the d&p show, the good design is chosen from among the alternatives. Designers get their solution chosen, and the execs get to make a decision. Everyone goes home happy.
|
{
"url": "http://triangleinnovation.blogspot.com/2010/04/",
"source_domain": "triangleinnovation.blogspot.com",
"snapshot_id": "crawl=CC-MAIN-2018-09",
"warc_metadata": {
"Content-Length": "58284",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:LLJQCTCLHZWMBWX3WM3XWKCZFPFO4KLY",
"WARC-Concurrent-To": "<urn:uuid:69d215bf-29d3-4a59-832e-c2fe7fa5670e>",
"WARC-Date": "2018-02-22T18:50:56Z",
"WARC-IP-Address": "172.217.7.225",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:6Y2S5ENUKB5R7ASZQCNLXRRP4EH2YTW2",
"WARC-Record-ID": "<urn:uuid:7f4e1baa-4ad3-469b-af4f-6a929d007ebf>",
"WARC-Target-URI": "http://triangleinnovation.blogspot.com/2010/04/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:4e13c8e5-9337-4ded-9603-b6b6828fef1c>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-136-53-50.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-09\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for February 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
25,
26,
42,
43,
206,
207,
364,
365,
389,
390,
419,
420,
601,
602,
625,
626,
664,
665,
1043,
1044,
1523,
1524,
1547,
1548,
1579,
1580,
1956,
1957,
2034,
2035,
2060,
2061,
2093,
2094,
2266,
2267,
2686,
2687,
3126,
3127,
3635
],
"line_end_idx": [
25,
26,
42,
43,
206,
207,
364,
365,
389,
390,
419,
420,
601,
602,
625,
626,
664,
665,
1043,
1044,
1523,
1524,
1547,
1548,
1579,
1580,
1956,
1957,
2034,
2035,
2060,
2061,
2093,
2094,
2266,
2267,
2686,
2687,
3126,
3127,
3635,
3636
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3636,
"ccnet_original_nlines": 41,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4066390097141266,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.016597509384155273,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.16320885717868805,
"rps_doc_frac_unique_words": 0.48996657133102417,
"rps_doc_mean_word_length": 4.8628764152526855,
"rps_doc_num_sentences": 40,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.211344242095947,
"rps_doc_word_count": 598,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.02132049947977066,
"rps_doc_frac_chars_dupe_6grams": 0.02132049947977066,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.011004130356013775,
"rps_doc_frac_chars_top_3gram": 0.0061898198910057545,
"rps_doc_frac_chars_top_4gram": 0.01031637005507946,
"rps_doc_books_importance": -280.08258056640625,
"rps_doc_books_importance_length_correction": -280.08258056640625,
"rps_doc_openwebtext_importance": -173.8793487548828,
"rps_doc_openwebtext_importance_length_correction": -173.8793487548828,
"rps_doc_wikipedia_importance": -105.70101165771484,
"rps_doc_wikipedia_importance_length_correction": -105.70101165771484
},
"fasttext": {
"dclm": 0.09403693675994873,
"english": 0.9706190824508667,
"fineweb_edu_approx": 1.6258598566055298,
"eai_general_math": 0.18213576078414917,
"eai_open_web_math": 0.22333848476409912,
"eai_web_code": 0.02109616994857788
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "5",
"label": "Evaluate"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "9",
"label": "Personal/Misc"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,062,142,435,720,546,000 |
session_destroy
(PHP 4, PHP 5, PHP 7)
session_destroyDétruit une session
Description
bool session_destroy ( void )
session_destroy() détruit toutes les données associées à la session courante. Cette fonction ne détruit pas les variables globales associées à la session, de même, elle ne détruit pas le cookie de session. Pour accéder à nouveau aux variables de session, la fonction session_start() doit être appelée de nouveau.
Pour détruire complètement une session, lorqu'on déconnecte un utilisateur par exemple, l'identifiant de la session doit également être effacé. Si un cookie est utilisé pour propager l'identifiant de session (comportement par défaut), alors le cookie de session doit être effacé. La fonction setcookie() peut être utilisée pour cela.
Valeurs de retour
Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.
Exemples
Exemple #1 Destruction d'une session avec $_SESSION
<?php
// Initialisation de la session.
// Si vous utilisez un autre nom
// session_name("autrenom")
session_start();
// Détruit toutes les variables de session
$_SESSION = array();
// Si vous voulez détruire complètement la session, effacez également
// le cookie de session.
// Note : cela détruira la session et pas seulement les données de session !
if (ini_get("session.use_cookies")) {
$params session_get_cookie_params();
setcookie(session_name(), ''time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finalement, on détruit la session.
session_destroy();
?>
Notes
Note:
Utilisez uniquement la fonction session_unset() pour l'ancien code obsolète qui n'utilise pas les variables $_SESSION.
Voir aussi
add a note add a note
User Contributed Notes 5 notes
up
33
Praveen V
4 years ago
If you want to change the session id on each log in, make sure to use session_regenerate_id(true) during the log in process.
<?php
session_start
();
session_regenerate_id(true);
?>
[Edited by moderator (googleguy at php dot net)]
up
13
Jack Luo
2 years ago
It took me a while to figure out how to destroy a particular session in php. Note I'm not sure if solution provided below is perfect but it seems work for me. Please feel free to post any easier way to destroy a particular session. Because it's quite useful for functionality of force an user offline.
1. If you're using db or memcached to manage session, you can always delete that session entry directly from db or memcached.
2. Using generic php session methods to delete a particular session(by session id).
<?php
$session_id_to_destroy
= 'nill2if998vhplq9f3pj08vjb1';
// 1. commit session if it's started.
if (session_id()) {
session_commit();
}
// 2. store current session id
session_start();
$current_session_id = session_id();
session_commit();
// 3. hijack then destroy session specified.
session_id($session_id_to_destroy);
session_start();
session_destroy();
session_commit();
// 4. restore current session id. If don't restore it, your current session will refer to the session you just destroyed!
session_id($current_session_id);
session_start();
session_commit();
?>
up
0
Gaurav
22 days ago
For session_destroy() only destroy current session mean that if you specify name or change the save path of session etc ,it will not destroy it mean for example
create.php
<?php
session_name
('testing') ;
session_start() ;
$_SESSION['id'] = '35' ;
?>
delete.php
<?php
session_start
() ;
session_destroy() ;
?>
session_destroy only delete the new session which is created by session_start(). correct way is
<?php
session_name
('testing') ;
session_start() ;
session_destroy() ;
?>
this is also valid for if you change session.save path throught ini_set() , you have to mention in delete.php.
remember session_destroy() function destroy only current session not all .i hope this is worth to mention.
up
-2
Colin
9 years ago
Note that when you are using a custom session handler, session_destroy will cause a fatal error if you have set the session destroy function used by session_set_save_handler to private.
Example:
Fatal error: Call to private method Session::sessDestroy()
where sessDestroy was the function I specified in the 5th parameter of session_set_save_handler.
Even though it isn't all that desirable, the simple solution is to set sessDestroy to public.
up
-31
administrator at anorhack dot com
9 years ago
Destroying a session from a background job
I have a thief-protection system that compares country codes from login IPs via whois. This has to run in the background as it is way too processor-hungry to be run in the browser.
What I needed was a way to destroy the web session from the background job. For some reason, a background session_destroy APPEARS to work, but doesnt't actually destroy the web session.
There is a work around, I set the username to NULL and the web code picks up on that, bouncing the user (thief) to a "gotcha" page where his IP is logged.
Yes I know its nasty and dirty, but surprisingly it works.
$sid = the session_id() of the suspicious web session, passed in $argv to the background job
The trick is to "stuff" the $_GET array with the sid, then the session_start in the background job picks this value up (as if it were a genuine trans-sid type thing...?PHPSESSID=blah) and "connects to" the web session. All $_SESSION variable can be viewed (and CHANGED , which is how this kludge works) but for some reason (that no doubt someone will illuminate) they can't be unset...setting the particular variable to NULL works well though:
$_GET[session_name()]=$sid;
session_start();
// prove we are getting the web session data
foreach($_SESSION as $k => $v) echo($k."=".$v);
// now kill the thief
$_SESSION['username']=NULL;
//web session variable now NULL - honestly!
To Top
|
{
"url": "http://docs.php.net/manual/fr/function.session-destroy.php",
"source_domain": "docs.php.net",
"snapshot_id": "crawl=CC-MAIN-2016-40",
"warc_metadata": {
"Content-Length": "39941",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:IXMDNWGEONNV2OKITJMT2EBI2TBLU2OU",
"WARC-Concurrent-To": "<urn:uuid:6746ed96-93fe-40ec-b37d-182b705f032e>",
"WARC-Date": "2016-09-27T15:42:51Z",
"WARC-IP-Address": "92.48.119.85",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:HTDQHZYFYA4OKNORGG363UKF72F65K5T",
"WARC-Record-ID": "<urn:uuid:f46c73da-30b8-4afe-bb78-540ef9763a31>",
"WARC-Target-URI": "http://docs.php.net/manual/fr/function.session-destroy.php",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:9d8ea493-fc54-4793-9735-af78b1631545>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-143-35-109.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2016-40\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for September 2016\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
16,
17,
39,
40,
75,
76,
88,
89,
119,
120,
433,
434,
768,
769,
787,
788,
867,
868,
877,
878,
930,
931,
937,
970,
1003,
1031,
1048,
1049,
1092,
1113,
1114,
1184,
1209,
1286,
1324,
1329,
1366,
1371,
1415,
1424,
1460,
1469,
1508,
1515,
1517,
1518,
1556,
1575,
1578,
1579,
1585,
1586,
1592,
1593,
1712,
1713,
1724,
1725,
1747,
1748,
1779,
1780,
1783,
1786,
1796,
1808,
1933,
1934,
1940,
1954,
1958,
1987,
1990,
1991,
2040,
2043,
2046,
2055,
2067,
2369,
2370,
2496,
2497,
2581,
2582,
2588,
2611,
2643,
2681,
2701,
2705,
2723,
2725,
2726,
2757,
2774,
2810,
2828,
2829,
2874,
2910,
2927,
2946,
2964,
2965,
3087,
3120,
3137,
3155,
3156,
3159,
3162,
3164,
3171,
3183,
3345,
3346,
3357,
3358,
3364,
3377,
3391,
3409,
3410,
3435,
3438,
3439,
3450,
3456,
3470,
3475,
3476,
3496,
3499,
3500,
3596,
3602,
3615,
3629,
3647,
3648,
3668,
3671,
3672,
3784,
3892,
3895,
3898,
3904,
3916,
4102,
4103,
4112,
4171,
4172,
4269,
4270,
4364,
4367,
4371,
4405,
4417,
4461,
4462,
4643,
4644,
4830,
4831,
4986,
4987,
5046,
5047,
5140,
5141,
5585,
5586,
5587,
5615,
5632,
5677,
5725,
5747,
5775,
5819
],
"line_end_idx": [
16,
17,
39,
40,
75,
76,
88,
89,
119,
120,
433,
434,
768,
769,
787,
788,
867,
868,
877,
878,
930,
931,
937,
970,
1003,
1031,
1048,
1049,
1092,
1113,
1114,
1184,
1209,
1286,
1324,
1329,
1366,
1371,
1415,
1424,
1460,
1469,
1508,
1515,
1517,
1518,
1556,
1575,
1578,
1579,
1585,
1586,
1592,
1593,
1712,
1713,
1724,
1725,
1747,
1748,
1779,
1780,
1783,
1786,
1796,
1808,
1933,
1934,
1940,
1954,
1958,
1987,
1990,
1991,
2040,
2043,
2046,
2055,
2067,
2369,
2370,
2496,
2497,
2581,
2582,
2588,
2611,
2643,
2681,
2701,
2705,
2723,
2725,
2726,
2757,
2774,
2810,
2828,
2829,
2874,
2910,
2927,
2946,
2964,
2965,
3087,
3120,
3137,
3155,
3156,
3159,
3162,
3164,
3171,
3183,
3345,
3346,
3357,
3358,
3364,
3377,
3391,
3409,
3410,
3435,
3438,
3439,
3450,
3456,
3470,
3475,
3476,
3496,
3499,
3500,
3596,
3602,
3615,
3629,
3647,
3648,
3668,
3671,
3672,
3784,
3892,
3895,
3898,
3904,
3916,
4102,
4103,
4112,
4171,
4172,
4269,
4270,
4364,
4367,
4371,
4405,
4417,
4461,
4462,
4643,
4644,
4830,
4831,
4986,
4987,
5046,
5047,
5140,
5141,
5585,
5586,
5587,
5615,
5632,
5677,
5725,
5747,
5775,
5819,
5825
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5825,
"ccnet_original_nlines": 184,
"rps_doc_curly_bracket": 0.000686699990183115,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.25544899702072144,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.02528334967792034,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.25893634557724,
"rps_doc_frac_unique_words": 0.4506024122238159,
"rps_doc_mean_word_length": 5.318072319030762,
"rps_doc_num_sentences": 63,
"rps_doc_symbol_to_word_ratio": 0.002615520032122731,
"rps_doc_unigram_entropy": 5.395445823669434,
"rps_doc_word_count": 830,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.012233800254762173,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.014272769913077354,
"rps_doc_frac_chars_top_3gram": 0.011780699715018272,
"rps_doc_frac_chars_top_4gram": 0.01155414991080761,
"rps_doc_books_importance": -606.2339477539062,
"rps_doc_books_importance_length_correction": -606.2339477539062,
"rps_doc_openwebtext_importance": -323.8675842285156,
"rps_doc_openwebtext_importance_length_correction": -323.8675842285156,
"rps_doc_wikipedia_importance": -256.21368408203125,
"rps_doc_wikipedia_importance_length_correction": -256.21368408203125
},
"fasttext": {
"dclm": 0.21947050094604492,
"english": 0.3608761131763458,
"fineweb_edu_approx": 1.2994122505187988,
"eai_general_math": 0.24732506275177002,
"eai_open_web_math": 0.2921449542045593,
"eai_web_code": 0.5048595070838928
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,986,498,606,938,674,000 |
tag:code.tutsplus.com,2005:/categories/android Envato Tuts+ Code - Android 2017-07-24T08:52:05Z tag:code.tutsplus.com,2005:PostPresenter/cms-29138 Mobile Development Languages <p>If you want to code a mobile app, you need to know a programming language. But it can be hard to choose the best language (or languages) for a project. There are a lot of options out there, and in this post I'll help you narrow them down so that you can pick the best.</p><p>It all depends on what you're building. For certain apps, mobile developers may not need all the available features of a particular language. In other situations, a single app may require more than one language. In this tutorial, I'll go through various mobile development languages and highlight some of the details that can help you make a decision. </p><p>Let's start with some languages which you may already be familiar with.<br></p><h2>Android Languages<br> </h2><h3>Java<br> </h3><p>According to the <a href="https://www.tiobe.com/tiobe-index" rel="external" target="_blank">TIOBE</a> Index, Java is the most popular programming language as of June 2017. If you want to develop Android apps, you'll most likely to stick to Java. It has a large and established developer community, and that means you can easily get technical support and help. </p><p>So, when you're developing for mobile with Java, you are free to come up with any type of app you can think of. The only limits will be your imagination and the level of your Java knowledge.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/android-from-scratch-an-overview-of-android-application-development--cms-25972"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/25972/preview_image/picGeneric.jpg"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Android From Scratch: An Overview of Android Application Development</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/learn-java-for-android"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/694/preview_image/java-android-1.png"><div class="roundup-block__primary-category topic-code">Java</div> <div class="roundup-block__content-title">Learn Java for Android</div> <div class="roundup-block__author">Sue Smith</div></a></li> </ul><h3>Kotlin</h3><p>Kotlin was designed and developed by JetBrains, the Czech company known for their popular IDE, IntelliJ IDEA. Google's Android team has recently announced that they are officially adding support for the Kotlin programming language. </p><p>Kotlin was developed to address some of the issues in Java. According to the language's fans, Kotlin syntax is simpler, cleaner, and leads to less code bloat. This helps you focus more on solving the actual problem, rather than struggling with verbose syntax. Also, you can use Kotlin and Java together in the same project, and that makes it really powerful.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/java-vs-kotlin-should-you-be-using-kotlin-for-android-development--cms-27846"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27846/preview_image/java-or-kotlin-for-android-dev.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Java vs. Kotlin: Should You Be Using Kotlin for Android Development?</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li></ul><h2>iOS Languages</h2><h3>Swift<br> </h3><p>If you want to develop for iOS, Swift might be the language for you. Introduced in 2014 and declared open source in 2015, Swift is swiftly catching up with mobile developers. It's very popular, especially among new iOS development startups. </p><p>Apple has added some great features to the language, such as simplified syntax, the ability to easily pinpoint programmer errors, etc. Apple's huge efforts to promote Swift clearly indicate that it wants this new language to become the mainstream programming language for its app ecosystem.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-ios-apps-with-swift-3"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/969/preview_image/swift-2.png"><div class="roundup-block__primary-category topic-code">Swift</div> <div class="roundup-block__content-title">Create iOS Apps With Swift 3</div> <div class="roundup-block__author">Markus Mühlberger</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/swift-from-scratch-introduction--cms-22598"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/41/posts/22598/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Swift</div> <div class="roundup-block__content-title">Swift From Scratch: Introduction</div> <div class="roundup-block__author">Bart Jacobs</div></a></li> </ul><h3>Objective-C<br> </h3><p>Objective-C was the original development language for iOS. While the recently introduced Swift language is the future of iOS development, many advanced projects still rely on Objective-C. So the transition from Objective-C to Swift is expected to be somewhat slow, and you may need both of them for some projects, at least for the time being.</p><h2>Cross-Platform Languages</h2><h3>JavaScript<br> </h3><p>JavaScript has a long history going back to the early days of the World Wide Web. A very popular front-end and server-side language, it lets web developers do everything from enhancing the user experience of their websites to building complete web apps. </p><p>Today, there are several JavaScript frameworks that specifically target mobile development platforms, such as Ionic 2 and React Native. It's very easy to develop cross-platform mobile apps using these frameworks and libraries. This means you only have to write a single version of your app, and it will run on iOS or Android.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/javascript-fundamentals"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/544/preview_image/Js-fun.png"><div class="roundup-block__primary-category topic-code">JavaScript</div> <div class="roundup-block__content-title">JavaScript Fundamentals</div> <div class="roundup-block__author">Dan Wellman</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/introduction-to-ionic-2--cms-28193"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/28193/preview_image/ionic.png"><div class="roundup-block__primary-category topic-code">Ionic 2</div> <div class="roundup-block__content-title">Introduction to Ionic 2</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/get-started-with-react-native"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/16/courses/708/preview_image/react-1.png"><div class="roundup-block__primary-category topic-code">React Native</div> <div class="roundup-block__content-title">Get Started With React Native</div> <div class="roundup-block__author">Markus Mühlberger</div></a></li> </ul><h3>TypeScript</h3><p>TypeScript is a superset of JavaScript and offers better safety by adding optional static typing. It also provides better support for developing large-scale applications. Developed and maintained by Microsoft, TypeScript allows developers to write cross-platform mobile apps using frameworks such as NativeScript.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/getting-started-with-typescript--net-28890"><img class="roundup-block__preview-image" src="https://cdn.tutsplus.com/net/authors/jeffreyway/getting-started-with-typescript.png"><div class="roundup-block__primary-category topic-code">Web Development</div> <div class="roundup-block__content-title">Getting Started with TypeScript</div> <div class="roundup-block__author">Sayanee Basu</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/code-a-mobile-app-with-nativescript"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/1050/preview_image/ns-1.png"><div class="roundup-block__primary-category topic-code">NativeScript</div> <div class="roundup-block__content-title">Code a Mobile App With NativeScript</div> <div class="roundup-block__author">Keyvan Kasaei</div></a></li> </ul><h2>Other Languages</h2><h3> <strong></strong>C#<br> </h3><p>C# is the language of Windows Mobile. It's very similar to C++ and Java. Microsoft has adopted some of the features of Java to simplify its architecture, while maintaining the C++ like design. It also has a large and active community of developers who are always friendly and helpful.</p><h3>C<br> </h3><p>C is the second most popular language on the TIOBE index, and just like Java, its community is full of seasoned developers who could offer you valuable advice on how to write bug-free code. </p><p>Created by Dennis Ritchie, while working for Bell Labs, C is a widely adopted and powerful language that allows you to directly manipulate low-level operations of a computer. If you want to use Android NDK (Native Development Kit), you'll need to get familiar with the C language.</p><h3>C++<br> </h3><p>If you are familiar with C, then you'll really enjoy reading and writing C++ code. C++ is an extension of C, with more high-level features and support for object-oriented programming. C++ is also a favorite language of Android NDK developers. You can use C++ to develop Windows Mobile apps too. C++ goes head to head with Java in the field of software development, and it's really worth mastering.<br></p><h3>Python<br> </h3><p>Python is another popular language that's easy to learn and easy to read. The creators of the language have made extra efforts to keep the syntax as simple and clear as possible. This really helps novice developers maintain high levels of productivity, from day one. If you are comfortable with writing Python code, then you can use frameworks such as Kivy to develop cross-platform mobile apps.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/introduction-to-python"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/647/preview_image/intro-python-1.png"><div class="roundup-block__primary-category topic-code">Python</div> <div class="roundup-block__content-title">Learn to Code With Python</div> <div class="roundup-block__author">Derek Jensen</div></a></li></ul><h3>Ruby<br> </h3><p>Ruby is an object-oriented scripting language, influenced by Ada, C++, Perl, Python, and Lisp. RubyMotion is a great framework for developing native and cross-platform mobile apps in Ruby. It's fairly easy to learn Ruby, thanks to its elegant syntax that focuses on simplicity and productivity.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/learn-to-code-with-ruby"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/558/preview_image/ruby_writing.png"><div class="roundup-block__primary-category topic-code">Programming Fundamentals</div> <div class="roundup-block__content-title">Learn to Code With Ruby</div> <div class="roundup-block__author">José Mota</div></a></li></ul><h2>How to Classify the Languages?<br> </h2><p>Mobile apps can be grouped into three categories, namely native, hybrid, and native cross-platform. Native apps can fully utilize all the OS facilities and features, and they are the fastest when it comes to performance. However, you need to maintain different codebases for different mobile platforms, as each platform uses different programming languages.<br></p><p>For example, Android platform makes use of Java plus C/C++ to develop native apps. Apple's iOS platform relies on Objective-C and Swift as its native languages. C# is used by Windows Mobile platform to code its native apps. All of these native app programming languages are compiled, rather than interpreted.</p><p>Hybrid mobile apps are actually websites that are designed to work with mobile devices too. A user can access them via a mobile browser as if they are visiting a website on a desktop computer. The combination of HTML5, CSS and JavaScript is the obvious choice, if you want to develop web apps.<br></p><p>Recently, a new batch of mobile cross-platform frameworks has emerged. These frameworks combine the best features of native apps and hybrid apps—they're fast and light and can access the full power of the native device, but they also are coded with JavaScript and other web languages, so a lot of code can be reused between platforms.</p><p>React Native and NativeScript are popular native cross-platform frameworks. If you want to learn more about these, check out our comprehensive beginner course or some of our many tutorials.</p><h2>Comparison of Features<br> </h2><p>Before getting deeper into the detailed language features, you must select a platform. You can refer to the article <a href="https://code.tutsplus.com/articles/mobile-development-platforms--cms-28944" target="_self">Mobile Development Platforms</a> to get an idea of various platforms and how to pick the one that suits you best. Assuming that you've already selected a mobile development platform, let's see how these languages compare in terms of their features.<br></p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/mobile-development-platforms--cms-28944"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/28944/preview_image/mobile%20devices.jpg"><div class="roundup-block__primary-category topic-code">Mobile Development</div> <div class="roundup-block__content-title">Mobile Development Platforms</div> <div class="roundup-block__author">Bala Durage Sandamal Siripathi</div></a></li></ul><h3>Native Android<br> </h3><p>If you want to develop for native Android, Java and Kotlin are your obvious choices. So let's have a look at them.</p><h4>Null Safety</h4><p>Kotlin has better control over Null references so that the famous <code class="inline">NullPointerException</code> bugs (common in Java) are much easier to eliminate. This reduces development time and improves programmer productivity.</p><h4>Concurrency</h4><p>Although Java supports concurrent operations, the relevant code may suffer heavily from readability and maintainability issues. Kotlin addresses these issues by using Coroutines. The resulting code is easily readable and easily understandable too.</p><h4>Type System</h4><p>Java's type system isn't consistent, and this can sometimes lead to confusion. In particular, the primitive types such as integer, boolean, and so on need to be handled as special cases. By contrast, Kotlin has a relatively simple and more versatile type system that minimizes programmer errors and mistakes.</p><h4>Supported Programming Styles</h4><p>Although Java can theoretically support various programming styles, some developers believe that it overly promotes OOP (Object-Oriented Programming). Kotlin doesn't seem to enforce any particular style of programming, so developers have more freedom to choose an approach that fits best. However, Kotlin developers need to have a thorough knowledge of software architecture and development principles.</p><h4>Which One to Choose?</h4><p>In a nutshell, it seems that Kotlin is better than Java, but it may take some time for a complete transformation. One challenge is that programmers are used to the thinking patterns enforced by Java. Another is that Kotlin is a new language, and certain features are still experimental.</p><p>Anyway, Google has clearly announced that they will offer complete support for Kotlin. In fact, Android Studio, the official Android IDE, now comes with full support for Kotlin. New features and capabilities are constantly added to Kotlin. Over the next few years, we are going to experience a transition period from Java to Kotlin, at least in native Android development.</p><h3>Native iOS</h3><p>Objective-C and Swift are the two options you have for iOS development. So let's have a look at each one's features.</p><h4>Code Syntax</h4><p>Swift has simpler and clearer syntax to help programmers achieve their goals with the minimum number of LOC (Lines Of Code). This also helps reduce programmer errors and eases bug fixing.</p><h4>Memory Management</h4><p>Swift clearly beats Objective-C, when it comes to memory management. Swift enforces more robust and reliable control mechanisms, allowing programmers to avoid undesirable memory leaks.</p><h4>Performance</h4><p>Execution of Swift code is much faster than that of Objective-C. This clearly leads to faster app performance and better user experience.</p><h4>Supported Programming Styles</h4><p>Unlike Objective-C, Swift has built-in support for functional programming too. So developers don't have to limit themselves to any pre-defined programming styles. That helps developers understand the problem clearly and come up with a better solution.</p><h4>Which One to Choose?</h4><p>Just as Kotlin is slowly replacing Java in native Android development, Swift seems sure to thrive in native iOS development, forcing Objective-C to retire. Apple has already started extensive support for Swift, and that's going to get even better in the future. Like Android developers, iOS developers are also experiencing a transition period at the moment. </p><p>While there are several code migration tools available, it may not be possible to fully convert Objective-C projects to Swift without issues. Sometimes, specific workarounds may be required, and that might need a fair knowledge of Objective-C. So the best strategy is to give priority to Swift and learn a bit of Objective-C only when it's absolutely necessary. Also, you need to keep an eye on the latest Swift developments and trends.</p><h3>Cross-Platform Apps<br> </h3><p>JavaScript (coupled with other HTML5 technologies) is the most used cross-platform mobile development language. There are also other languages, such as Python and Ruby, but JavaScript has the broadest range of support and adoption. </p><p>Unless you are already a big Ruby or Python fan and you want to try out the cutting-edge of mobile development with those languages, you should stick with JavaScript or its type-augmented sibling, TypeScript.</p><h2>Conclusion<br> </h2><p>Choosing a mobile development language can be tricky if you don't understand the features of each one, along with the current industry trends. With this knowledge, though, it's easy to see that choosing a language heavily depends on the particular mobile development platform too.</p><p>I'm sure now you have a clearer picture of mobile app development languages and are able to match the relevance of their features to the latest development trends. So just get started coding your next app with confidence!</p><p>If you want some help getting started with a new language, check out some of the tutorials and video courses linked throughout this post, or some of our other posts on mobile development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/mobile-development-platforms--cms-28944"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/28944/preview_image/mobile%20devices.jpg"><div class="roundup-block__primary-category topic-code">Mobile Development</div> <div class="roundup-block__content-title">Mobile Development Platforms</div> <div class="roundup-block__author">Bala Durage Sandamal Siripathi</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/get-started-with-layouts-in-react-native--cms-27418"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/27418/preview_image/rn.jpg"><div class="roundup-block__primary-category topic-code">React Native</div> <div class="roundup-block__content-title">Get Started With React Native Layouts</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/create-your-first-nativescript-app--cms-26957"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/26957/preview_image/ns.jpg"><div class="roundup-block__primary-category topic-code">NativeScript</div> <div class="roundup-block__content-title">Create Your First NativeScript App</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/start-developing-android-apps-with-kotlin-part-1--cms-27827"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27827/preview_image/start-developing-android-apps-with-kotlin.jpg"><div class="roundup-block__primary-category topic-code">Android Studio</div> <div class="roundup-block__content-title">Coding Functional Android Apps in Kotlin: Getting Started</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/swift-from-scratch-an-introduction-to-functions--cms-22879"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/41/posts/22879/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Swift</div> <div class="roundup-block__content-title">Swift From Scratch: An Introduction to Functions</div> <div class="roundup-block__author">Bart Jacobs</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/whats-the-difference-between-java-and-javascript--cms-26194"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/34/posts/26194/preview_image/javascript.png"><div class="roundup-block__primary-category topic-code">Java</div> <div class="roundup-block__content-title">What's the Difference Between Java and JavaScript?</div> <div class="roundup-block__author">Tom McFarlin</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/code-your-first-ionic-2-app-photo-sharing-app--cms-28469"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/28469/preview_image/ionic.png"><div class="roundup-block__primary-category topic-code">Ionic 2</div> <div class="roundup-block__content-title">Code Your First Ionic 2 App: Getting Set Up</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> </ul><p></p> 2017-07-24T08:52:05.341Z 2017-07-24T08:52:05.341Z Bala Durage Sandamal Siripathi tag:code.tutsplus.com,2005:PostPresenter/cms-29153 Android Design Patterns: The Singleton Pattern <h2>What Is the Singleton Pattern?</h2><p>The Singleton Pattern is a <a href="https://en.wikipedia.org/wiki/Software_design_pattern" rel="external" target="_blank">software design pattern</a> that guarantees a class has one instance only and a global point of access to it is provided by that class. Anytime multiple classes or clients request for that class, they get the same instance of the class. This Singleton class may be responsible for instantiating itself, or you can delegate the object creation to a factory class. <br></p><p>Let's use the example of a cellphone and its owner. A phone is typically owned by a single person, while a person can own many phones. Anytime one of these phones rings, the same owner picks it up. </p><h2>Benefits of the Singleton Pattern</h2><p>In a typical Android app, there are many objects for which we only need one global instance, whether you are using it directly or simply passing it to another class. Examples include caches, <code class="inline">OkHttpClient</code>, <code class="inline">HttpLoggingInterceptor</code>, <code class="inline">Retrofit</code>, <code class="inline">Gson</code>, <code class="inline">SharedPreferences</code>, the repository class, etc. If we were to instantiate more than one of these types of objects, we'd run into problems like incorrect app behaviour, resource overuse, and other confusing results. </p><h2>Implementation</h2><p>It's quite easy to implement this pattern. The following code snippet shows how a Singleton is created.</p><pre class="brush: java noskimlinks noskimwords">public class Singleton { private static Singleton INSTANCE = null; // other instance variables can be here private Singleton() {}; public static Singleton getInstance() { if (INSTANCE == null) { INSTANCE = new Singleton(); } return(INSTANCE); } // other instance methods can follow }</pre><p>In the code above, we have a static variable <code class="inline">INSTANCE</code> to hold an instance of the class. We also made the constructor private because we want to enforce noninstantiability—the class can only instantiate itself. The method <code class="inline">getInstance()</code> guarantees that the class is instantiated, if it has not been, and that it's returned to the caller. </p><h3>Example: Creating a Single Instance of Retrofit</h3><p>Retrofit is a popular library to connect a REST web service by translating the API into Java interfaces. To learn more about it, check out my tutorial here on Envato Tuts+. </p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/sending-data-with-retrofit-2-http-client-for-android--cms-27845"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/27845/preview_image/image_post.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Sending Data With Retrofit 2 HTTP Client for Android</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li></ul><p>In an Android app, you'll need a single global instance of a Retrofit object so that other parts of an app such as a <code class="inline">UserProfileActivity</code> or <code class="inline">SettingsActivity</code> can use it to execute a network request without the need to create an instance every single time we need it. Creating multiple instances would pollute our app with unused retrofit objects, thereby occupying unnecessary memory on an already memory-constrained mobile device. </p><pre class="brush: java noskimlinks noskimwords">import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class RetrofitClient { private static Retrofit retrofit = null; public static Retrofit getClient(String baseUrl) { if (retrofit==null) { retrofit = new Retrofit.Builder() .baseUrl(baseUrl) .addConverterFactory(GsonConverterFactory.create()) .build(); } return retrofit; } }</pre><p>So anytime client A calls <code class="inline">RetrofitClient.getClient()</code>, it creates the instance if it has not been created already, and then when client B calls this method, it checks if the Retrofit instance already exists. If so, it returns the instance to client B instead of creating a new one. </p><h2>Dealing With Multithreading</h2><p>In the Android system, you can spin off multiple threads to perform different tasks. These threads can end up executing the same code block simultaneously. In the case of the <code class="inline">Singleton</code> class above, this could lead to the creation of multiple object instances, which violates the contract of a Singleton. So our Singleton code snippet method <code class="inline">getInstance()</code> is not thread safe. We'll now look at ways to make it thread safe.</p><h3>Synchronize the <code class="inline">getInstance()</code> Method </h3><p>One of the ways to make the singleton code thread safe is by making the method <code class="inline">getInstance()</code> a<a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html" rel="external" target="_blank"> </a><a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html" rel="external" target="_blank">synchronized</a> one. Doing this only allows one thread to run the method at a time, forcing every other thread to be in a wait or blocked state. </p><pre class="brush: java noskimlinks noskimwords">public class Singleton { private static Singleton INSTANCE = null; // other instance variables can be here private Singleton() {}; public static synchronized Singleton getInstance() { if (INSTANCE == null) { INSTANCE = new Singleton(); } return(INSTANCE); } // other instance methods can follow }</pre><p>This approach makes our code thread safe, but it is an expensive operation. In other words, this can slow down performance. So you have to investigate and see if the performance cost is worthwhile in your application.</p><h3>Eagerly Create an Instance</h3><p>Another approach to deal with multiple threads accessing the singleton is to create the Singleton instance immediately when the class is loaded or initialized (by the Android <a href="https://developer.android.com/reference/java/lang/ClassLoader.html" rel="external" target="_blank">ClassLoader</a> in the Dalvik VM). This makes the code thread safe. Then the object instance will already be available before any thread accesses the <code class="inline">INSTANCE</code> variable. </p><pre class="brush: java noskimlinks noskimwords">public class Singleton { private static Singleton INSTANCE = new Singleton(); // other instance variables can be here private Singleton() {}; public static Singleton getInstance() { return(INSTANCE); } // other instance methods can follow }</pre><p>A drawback to this approach is that you can end up creating an object that might never be used, thereby occupying unnecessary memory. So this approach should typically only be used if you are sure that the singleton will be accessed. </p><h2>Bonus: Using Dagger 2<br> </h2><p>A dependency injection library such as Dagger can help you wire up your object dependencies and create singletons by using the <code class="inline">@Singleton</code> annotation. This will ensure that the object is only initialized once throughout the application lifecycle.</p><pre class="brush: java noskimlinks noskimwords">@Module public class NetworkModule { @Provides @Singleton public Gson gson() { GsonBuilder gsonBuilder = new GsonBuilder(); return gsonBuilder.create(); } @Provides @Singleton public HttpLoggingInterceptor loggingInterceptor() { HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor( message -> Timber.i(message)); interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); return interceptor; } @Provides @Singleton public Cache cache(File cacheFile) { return new Cache(cacheFile, 10 * 1000 * 1000); //10MB Cache } @Provides @Singleton public File cacheFile(@ApplicationContext Context context) { return new File(context.getCacheDir(), "okhttp_cache"); } @Provides @Singleton public OkHttpClient okHttpClient(HttpLoggingInterceptor loggingInterceptor, Cache cache) { return new OkHttpClient.Builder() .addInterceptor(loggingInterceptor) .cache(cache) .build(); } @Provides @Singleton public Retrofit retrofit(OkHttpClient okHttpClient, Gson gson) { return new Retrofit.Builder() .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create(gson)) .client(okHttpClient) .baseUrl("you/base/url") .build(); } }</pre><p>In the code above, we create a single instance of <code class="inline">Gson</code>, <code class="inline">Cache</code>, <code class="inline">File</code>, <code class="inline">OkHttpClient</code> and finally <code class="inline">Retrofit</code> types to be provided from the dependency graph generated by Dagger. </p><p>To learn more about Dagger 2, check out our tutorial here on Envato Tuts+. </p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/dependency-injection-with-dagger-2-on-android--cms-23345"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/41/posts/23345/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Dependency Injection With Dagger 2 on Android</div> <div class="roundup-block__author">Kerry Perez Huanca</div></a></li></ul><h2><b>Conclusion</b></h2><p>In this short tutorial, you learned about the Singleton pattern in Android: what it is, the benefits of using it, how to implement it by writing your own, and some ways of dealing with multiple threads. I also showed you how to use a third-party library such as Dagger 2. </p><p>In the meantime, check out some of our other courses and tutorials on the Java language and Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/rxjava-for-android-apps-introducing-rxbinding-and-rxlifecycle--cms-28565"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28565/preview_image/RxJava-RxAndroid-Introducing-RxBinding-and-RxLifecycle.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">RxJava 2 for Android Apps: RxBinding and RxLifecycle</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/practical-concurrency-on-android-with-hamer--cms-27137"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1308/posts/27137/preview_image/cover.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Practical Concurrency on Android With HaMeR</div> <div class="roundup-block__author">Tin Megali</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/ensure-high-quality-android-code-with-static-analysis-tools--cms-28787"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/preview_image/dd.jpg"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Ensure High-Quality Android Code With Static Analysis Tools</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/create-an-intelligent-app-with-google-cloud-speech-and-natural-language-apis--cms-28890"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28890/preview_image/preview.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Create an Intelligent App With Google Cloud Speech and Natural Language APIs</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> </ul> 2017-07-19T09:01:09.562Z 2017-07-19T09:01:09.562Z Chike Mgbemena tag:code.tutsplus.com,2005:PostPresenter/cms-29141 Android O: Phone Number Verification With SMS Tokens <p>In this tutorial, you'll learn about the cool new SMS token feature in Android O. You'll learn how to generate an app-specific token that will fire up a pending intent when the device first receives a message containing that token so as to verify the phone number. </p><p>Kindly note that as of this writing, the Android O APIs are still in their third developer preview, though they are final. (We still don't know what O stands for yet!)</p><h2>What Is an SMS Token?</h2><p>An SMS token or one-time password is a security mechanism used to authenticate or verify a user. The user enters their phone number, and a limited lifespan token is generated specifically for that user. The user then receives the token as an SMS to their phone. In the case of Android O as of this writing, this app-specific token does not expire, but instead becomes invalid when another is generated. </p><h2>Why Use Android O's SMS Token?</h2><p>One of the major reasons you might consider using Android O's SMS token mechanism is that it improves the user experience of the app. The user does not need to copy and paste the token from the SMS client to be verified. Instead, the Android device automatically detects the token sent to the user's device and then triggers the app component in the intent associated with your app (we'll get to that shortly). </p><p>Even better, this functionality doesn't require the <a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_SMS" rel="external" target="_blank">READ_SMS</a> permission or any other. This mechanism also improves the security of your app user, because no other app can read the message containing the token on the device. </p><p>In this tutorial, you'll learn how to use this new feature in Android O's SMS API. You'll learn how to generate an SMS token specifically for your app and send it to a device. We'll use the Android Studio emulator to simulate this process. </p><h2>Prerequisites<br> </h2><p>To follow along with this tutorial, make sure you have downloaded the Android 8.0 (O) SDK platform on your computer and have an emulator already set up that targets this version. </p><h2> <span class="sectionnum">1.</span> Generate the App-Specific Token</h2><p>To start off, I'll show you how to generate an app-specific token which is unique to your app on the user's device.</p><h3>Create a New Android Studio Project</h3><p>Fire up Android Studio and create a new project with an empty activity called <code class="inline">MainActivity</code>.</p><h2><figure class="post_image"><img alt="Create a new Android Studio project" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/29141/image/gg.JPG"></figure></h2><h3>Modify the build.gradle File</h3><p>Make the following changes to your app module's <strong>build.</strong><strong>gradle</strong> file. </p><pre class="brush: plain noskimlinks noskimwords">compileSdkVersion 'android-O' minSdkVersion 'o' targetSdkVersion 'o'</pre><h3> <strong>Modify the <code class="inline">MainActivity</code> Class</strong><br> </h3><p>In the code snippet below, we get the <a href="https://developer.android.com/reference/android/telephony/SmsManager.html" rel="external" target="_blank"><code class="inline">SMSManager</code></a> class and then call the method <code class="inline"><a href="https://developer.android.com/reference/android/telephony/SmsManager.html#createAppSpecificSmsToken(android.app.PendingIntent)" rel="external" target="_blank">createAppSpecificSmsToken()</a></code>. This does just what it says—it creates the app-specific SMS token. This method requires a <a href="https://developer.android.com/reference/android/app/PendingIntent.html" rel="external" target="_blank"><code class="inline">PendingIntent</code></a> which contains the Activity to be fired up when an SMS containing this token (a string 11 characters long) is received by the device. </p><pre class="brush: java noskimlinks noskimwords">import android.app.PendingIntent; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.telephony.SmsManager; import android.util.Log; import android.widget.TextView; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView textView = (TextView) findViewById(R.id.tv_token); SmsManager smsManager = SmsManager.getDefault(); String appSmsToken = smsManager.createAppSpecificSmsToken(createSmsTokenPendingIntent()); textView.setText(appSmsToken); Log.i("MainActivity", "sms token " + appSmsToken); } private PendingIntent createSmsTokenPendingIntent() { return PendingIntent.getActivity(this, 1234, new Intent(this, SmsTokenResultVerificationActivity.class), 0); } }</pre><p>Be aware that, as stated earlier, the generated token is unique to your app on the user's device. If you create another SMS token, the second one will be a valid token while the first one will be ignored. </p><h3>Lay Out the Screen</h3><p>Here's a <code class="inline">MainActivity</code> layout file set up to display the SMS token that was generated:</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.chikeandroid.tutsplusandroidosmstoken.MainActivity" android:orientation="vertical" android:gravity="center_horizontal|center_vertical"> <TextView android:text="APP SMS TOKEN GENERATED" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black"/> <TextView android:id="@+id/tv_token" android:layout_marginTop="12dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:textAppearanceLarge" android:textColor="@android:color/holo_red_dark"/> </LinearLayout></pre><p>Running the app at this point will show the SMS token generated. </p><figure class="post_image"><img alt="Running the app at this point" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/29141/image/gty.png"></figure><h2> <span class="sectionnum">2. </span>Receive the SMS Token</h2><p>Next, we'll create the activity to be fired up when our device receives a message containing the SMS token. Nothing specific to SMS tokens happens here. </p><pre class="brush: java noskimlinks noskimwords">import android.app.Activity; import android.os.Bundle; public class SmsTokenResultVerificationActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sms_token_result); } }</pre><h3>Lay Out the Screen</h3><p>Here we create the layout for the activity we created above that contains just one <code class="inline">TextView</code>. </p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal|center_vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Token Result Activity" android:textColor="@android:color/holo_purple" android:textAppearance="?android:textAppearanceLarge" /> </LinearLayout></pre><p>Next, we'll test this functionality using the Android Studio emulator.</p><h2> <span class="sectionnum">3.</span> Test the SMS Token</h2><h3>Set Up the Emulator to Send SMS Messages</h3><p>You can use your emulator to simulate receiving an SMS message, but you'll need to do a little setup. Open your emulator, click the last button on the right-side navigation bar to open the extended control dialog, and then select the phone control button. </p><figure class="post_image"><img alt="Showing how to use the Emulator to simulate sending an SMS message" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/29141/image/emulator.jpg"></figure><p>From this interface, you can simulate your device receiving a phone call or SMS from another phone.</p><h3>Send the Token</h3><p>Make sure you have set up your emulator that targets Android 8.0 (O). Generate a token and enter a text message that contains it. Then click the <strong>Send Message</strong> button. </p><figure class="post_image"><img alt="Sending a message with emulator" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/29141/image/tty.png"></figure><p>Finally, the activity we specified in the pending intent gets fired up immediately! Try sending the message again and see that this time, it will show up in the device SMS client instead, because it is no longer a valid token. </p><figure class="post_image"><img alt="Token result activity " src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/29141/image/gtttt.png"></figure><h2>Using a Server</h2><p>For a production app, the SMS token will typically be sent by a back-end server. So when using a server, the client (your app) should make a request to the server, including the app generated token and the phone number. Your server will then receive this request and send the unmodified token back as a text message to the user's phone. Your app will then receive this token and fire up the component registered in the pending intent. That component can then let the server know that the phone number verification or user authentication succeeded.</p><h2>Conclusion</h2><p>In this tutorial, you learned about the awesome SMS token feature introduced in Android O: what is it, its benefits, and how to use it in an Android app. <br></p><p>To learn more about Android SMS and phone APIs, including how to make calls from your app, check out my related tutorial here on Envato Tuts+.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-make-calls-and-use-sms-in-android-apps--cms-28168"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28168/preview_image/android-designing-a-great-user-experience.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">How to Make Calls and Use SMS in Android Apps</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li></ul><p>And check out some of our other courses and tutorials on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/android-o-how-to-use-notification-channels--cms-28616"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28616/preview_image/android-o.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Android O: How to Use Notification Channels</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-solve-androids-most-common-error-messages--cms-28706"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/preview_image/android-common-error-messages.jpg"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">How to Solve Android’s 13 Most Common Error Messages </div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/create-an-intelligent-app-with-google-cloud-speech-and-natural-language-apis--cms-28890"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28890/preview_image/preview.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Create an Intelligent App With Google Cloud Speech and Natural Language APIs</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> </ul><p></p> 2017-07-14T13:00:00.000Z 2017-07-14T13:00:00.000Z Chike Mgbemena tag:code.tutsplus.com,2005:PostPresenter/cms-28268 Android Things: Creating a Cloud-Connected Doorman <p>Android Things allows you to make amazing IoT devices with simple code. In this post, I'll show you how to put the pieces together to build a more complex project!</p><p>This won't be a complete top-to-bottom tutorial. I'll leave you lots of room to expand and customize your device and app—so you can explore and learn further on your own. My goal is to have fun while working with this new development platform, and show you that there's more to Android Things than just blinking LEDs.<br></p><h2>What Are We Building?</h2><p>Half the fun of an Internet of Things project is coming up with the "thing". For this article, I'll build a cloud-connected doorbell, which will take a picture when someone approaches, upload that image to Firebase, and trigger an action. Our project will require a few components before we can start:</p><ul> <li>Raspberry Pi 3B with Android Things on a SIM card</li> <li>Raspberry Pi camera</li> <li>Motion detector (component: HCSR501)</li> </ul><p>In addition, you can customize your project to fit your own creative style and have some fun with it. For my project, I took a skeleton decoration that had been sitting on my porch since Halloween and used that as a casing for my project—with the eyes drilled out to hold the camera and motion detector. </p><figure class="post_image"><img alt="Skeleton Android Things device" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/28268/image/skull%20(1).jpg"></figure><p>I also added a servomotor to move the jaw, which is held closed with a piece of elastic, and a USB speaker to support text-to-speech capabilities. </p><figure class="post_image"><img alt="Schematics for a simple customized smart doorbell" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/28268/image/doorbell-schematic.png"></figure><p>You can start this project by building your circuit. Be sure to note what pin you use for your motion detector and how you connect any additional peripherals—for example, the connection of the camera module to the camera slot on your Raspberry Pi. With some customization, everyone's end product will be a little different, and you can share your own finished IoT project in the comments section for this article. For information on hooking up a circuit, see my tutorial on <a href="https://code.tutsplus.com/tutorials/android-things-your-first-project--cms-27893" rel="external" target="_blank">creating your first project</a>.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/android-things-your-first-project--cms-27893"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/27893/preview_image/androidthings.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Android Things: Your First Project</div> <div class="roundup-block__author">Paul Trebilcox-Ruiz</div></a></li></ul><h2>Detecting Motion</h2><p>There are two major components that we will use for this project: the camera and the motion detector. We'll start by looking at the motion detector. This will require a new class that handles reading digital signals from our <code class="inline">GPIO</code> pin. When motion is detected, a callback will be triggered that we can listen for on our <code class="inline">MainActivity</code>. For more information on GPIO, see my article on <a href="https://code.tutsplus.com/tutorials/android-things-peripheral-inputoutput--cms-27891" rel="external" target="_blank">Android Things peripherals</a>.</p><pre class="brush: java noskimlinks noskimwords">private GpioCallback mInterruptCallback = new GpioCallback() { @Override public boolean onGpioEdge(Gpio gpio) { try { if( gpio.getValue() != mLastState ) { mLastState = gpio.getValue(); performMotionEvent(mLastState ? State.STATE_HIGH : State.STATE_LOW); } } catch( IOException e ) { } return true; } };</pre><p>If you have been following along with the Android Things series on Envato Tuts+, you may want to try writing the complete motion detector class on your own, as it is a simple digital input component. If you'd rather skip ahead, you can find the entire component written in the project for this tutorial.</p><p>In your <code class="inline">Activity</code> you can instantiate your <code class="inline">HCSR501</code> component and associate a new <code class="inline">HCSR501.OnMotionDetectedEventListener</code> with it.</p><pre class="brush: java noskimlinks noskimwords">private void initMotionDetection() { try { mMotionSensor = new HCSR501(BoardDefaults.getMotionDetectorPin()); mMotionSensor.setOnMotionDetectedEventListener(this); } catch (IOException e) { } } @Override public void onMotionDetectedEvent(HCSR501.State state) { if (state == HCSR501.State.STATE_HIGH) { performCustomActions(); } }</pre><p>Once your motion detector is working, it's time to take a picture with the Raspberry Pi camera.</p><h3>Taking a Picture</h3><p>One of the best ways to learn a new tool or platform quickly is to go through the sample code provided by the creators. In this case, we will use a class created by Google for taking a picture using the Camera2 API. If you want to learn more about the Camera2 API, you can check out our <a href="https://code.tutsplus.com/courses/take-pictures-with-your-android-app" rel="external" target="_blank">complete video course here at Envato Tuts+</a>. </p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/take-pictures-with-your-android-app"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/938/preview_image/androidphoto-3.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Take Pictures With Your Android App</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li></ul><p>You can find all of the source code for the camera class in this project's sample, though the main method that you will be interested in is <code class="inline">takePicture()</code>. This method will take an image and return it to a callback in your application. </p><pre class="brush: java noskimlinks noskimwords">public void takePicture() { if (mCameraDevice == null) { return; } try { mCameraDevice.createCaptureSession( Collections.singletonList(mImageReader.getSurface()), mSessionCallback, null); } catch (CameraAccessException cae) {} } </pre><p>Once this class has been added to your project, you will need to add the <code class="inline">ImageReader.OnImageAvailableListener</code> interface to your <code class="inline">Activity</code>, initialize the camera from <code class="inline">onCreate()</code>, and listen for any returned results. When your results are returned in <code class="inline">onImageAvailable()</code>, you will need to convert them to a <code class="inline">byte</code> array for uploading to Firebase.</p><pre class="brush: java noskimlinks noskimwords">private void initCamera() { mCameraBackgroundThread = new HandlerThread("CameraInputThread"); mCameraBackgroundThread.start(); mCameraBackgroundHandler = new Handler(mCameraBackgroundThread.getLooper()); mCamera = DoorbellCamera.getInstance(); mCamera.initializeCamera(this, mCameraBackgroundHandler, this); } @Override public void onImageAvailable(ImageReader imageReader) { Image image = imageReader.acquireLatestImage(); ByteBuffer imageBuf = image.getPlanes()[0].getBuffer(); final byte[] imageBytes = new byte[imageBuf.remaining()]; imageBuf.get(imageBytes); image.close(); onPictureTaken(imageBytes); }</pre><h3>Uploading a Picture</h3><p>Now that you have your image data, it's time to upload it to Firebase. While I won't go into detail on setting up Firebase for your app, you can follow along with <a href="https://code.tutsplus.com/tutorials/get-started-with-firebase-for-android--cms-27248" rel="external" target="_blank">this tutorial to get up and running</a>. We will be using <a href="https://code.tutsplus.com/tutorials/firebase-for-android-file-storage--cms-27376" rel="external" target="_blank">Firebase Storage</a> to store our images, though once your app is set up for using Firebase, you can do additional tasks such as storing data in the Firebase database for use with a companion app that notifies you when someone is at your door. Let's update the <code class="inline">onPictureTaken()</code> method to upload our image.</p><pre class="brush: java noskimlinks noskimwords">private void onPictureTaken(byte[] imageBytes) { if (imageBytes != null) { FirebaseStorage storage = FirebaseStorage.getInstance(); StorageReference storageReference = storage.getReferenceFromUrl(FIREBASE_URL).child(System.currentTimeMillis() + ".png"); UploadTask uploadTask = storageReference.putBytes(imageBytes); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception exception) { } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { } }); } }</pre><p>Once your images are uploaded, you should be able to see them in Firebase Storage.</p><figure class="post_image"><img alt="Images stored in Firebase Storage" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/28268/image/Screen%20Shot%202017-06-25%20at%2011.00.34%20PM.png"></figure><h3>Customize</h3><p>Now that you have what you need to build the base functionality for your doorbell, it's time to really make this project yours. Earlier I mentioned that I did some customizing by using a skeleton with a moving jaw and text-to-speech capabilities. Servos can be implemented by importing the <a href="https://github.com/androidthings/drivers-samples/tree/master/pwmservo" rel="external" target="_blank">servo library from Google</a> and including the following code in your <code class="inline">MainActivity</code> to set up and run the servo.</p><pre class="brush: java noskimlinks noskimwords">private final int MAX_MOUTH_MOVEMENT = 6; int mouthCounter = MAX_MOUTH_MOVEMENT; private Runnable mMoveServoRunnable = new Runnable() { private static final long DELAY_MS = 1000L; // 5 seconds private double mAngle = Float.NEGATIVE_INFINITY; @Override public void run() { if (mServo == null || mouthCounter <= 0) { return; } try { if (mAngle <= mServo.getMinimumAngle()) { mAngle = mServo.getMaximumAngle(); } else { mAngle = mServo.getMinimumAngle(); } mServo.setAngle(mAngle); mouthCounter--; mServoHandler.postDelayed(this, DELAY_MS); } catch (IOException e) { } } }; private void initServo() { try { mServo = new Servo(BoardDefaults.getServoPwmPin()); mServo.setAngleRange(0f, 180f); mServo.setEnabled(true); } catch (IOException e) { Log.e("Camera App", e.getMessage()); return; // don't init handler. Stuff broke. } } private void moveMouth() { if (mServoHandler != null) { mServoHandler.removeCallbacks(mMoveServoRunnable); } mouthCounter = MAX_MOUTH_MOVEMENT; mServoHandler = new Handler(); mServoHandler.post(mMoveServoRunnable); }</pre><p>When you are done with your app, you will also need to dereference the servo motor.</p><pre class="brush: java noskimlinks noskimwords">if (mServoHandler != null) { mServoHandler.removeCallbacks(mMoveServoRunnable); } if (mServo != null) { try { mServo.close(); } catch (IOException e) { } finally { mServo = null; } }</pre><p>Surprisingly, text to speech is a little more straightforward. You just need to initialize the text-to-speech engine, like so:</p><pre class="brush: java noskimlinks noskimwords">private void initTextToSpeech() { textToSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() { @Override public void onInit(int status) { if (status == TextToSpeech.SUCCESS) { textToSpeech.setLanguage(Locale.UK); textToSpeech.setOnUtteranceProgressListener(utteranceListener); textToSpeech.setPitch(0.3f); } else { textToSpeech = null; } } }); }</pre><p>You can play with the settings to make the voice fit your application. In the sample above, I have set the voice to have a low, somewhat robotic pitch and an English accent. When you are ready to have your device say something, you can call <code class="inline">speak()</code> on the text-to-speech engine.</p><pre class="brush: java noskimlinks noskimwords">textToSpeech.speak("Thanks for stopping by!", TextToSpeech.QUEUE_ADD, null, "skeletontts");</pre><p>On a Raspberry Pi, if you are using a servo motor, you will need to ensure that your speaker is connected over a USB port, as the analog aux connection cannot be used while a PWM signal is also being created by your device. </p><p>I highly recommend looking over <a href="https://github.com/androidthings/contrib-drivers/" rel="external" target="_blank">Google's sample drivers</a> to see what additional hardware you could add to your project, and get creative with your project. Most features that are available for Android are also supported in Android Things, including support for <a href="https://code.tutsplus.com/articles/android-from-scratch-google-play-services--cms-26040" target="_self">Google Play Services</a> and <a href="https://www.tensorflow.org/" rel="external" target="_blank">TensorFlow machine learning</a>. For a little inspiration, here's a video of the completed project:</p><figure><script src="//fast.wistia.com/assets/external/E-v1.js" async="async"></script><div class="wistia_responsive_padding"><div class="wistia_responsive_wrapper"><div class="wistia_embed wistia_async_w5h4jmpcyn videoFoam=true"> </div></div></div></figure><h2>Conclusion</h2><p>In this article I've introduced a few new tools that you can use for building more complex IoT apps. </p><p>This is the end of our series on Android Things, so I hope you've learned a lot about the platform, and use it to build some amazing projects. Creating apps is one thing, but being able to affect the world around you with your apps is even more exciting. Be creative, create wonderful things, and above all else, have fun! </p><p>Remember that Envato Tuts+ is filled with information on Android development, and you can find lots of inspiration here for your next app or IoT project.</p><ul class="roundup-block__contents posts--half-width roundup-block--card"> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/articles/android-things-and-machine-learning--cms-28089"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/28089/preview_image/androidthings.png"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/articles/android-things-and-machine-learning--cms-28089"><h1 class="nolinks">Android Things and Machine Learning</h1></a></header><div class="posts__post-teaser">Android Things allows you to make amazing IoT devices with simple code, but one of the things that can make a device extraordinary is machine learning. In...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/769/profiles/19326/profileImage/paultr3.jpg" alt="Paul Trebilcox-Ruiz"><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/paul-trebilcox-ruiz">Paul Trebilcox-Ruiz</a></address> <time class="posts__post-publication-date" datetime="2017-04-17 17:00:00 UTC" title="17 Apr 2017">17 Apr 2017</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android-things">Android Things</a></div></footer></article></li> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/tutorials/how-to-use-google-cloud-machine-learning-services-for-android--cms-28630"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28630/preview_image/preview.png"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/tutorials/how-to-use-google-cloud-machine-learning-services-for-android--cms-28630"><h1 class="nolinks">How to Use Google Cloud Machine Learning Services for Android</h1></a></header><div class="posts__post-teaser">The Google Cloud Machine Learning platform offers neural networks that have been pre-trained to perform a variety of tasks. It also exposes a REST API to...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/362/profiles/18808/profileImage/picGrid.jpg" alt="Ashraff Hathibelagal"><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/ashraff-hathibelagal">Ashraff Hathibelagal</a></address> <time class="posts__post-publication-date" datetime="2017-04-27 10:29:49 UTC" title="27 Apr 2017">27 Apr 2017</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android-sdk">Android SDK</a></div></footer></article></li> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/tutorials/how-to-make-calls-and-use-sms-in-android-apps--cms-28168"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28168/preview_image/android-designing-a-great-user-experience.jpg"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/tutorials/how-to-make-calls-and-use-sms-in-android-apps--cms-28168"><h1 class="nolinks">How to Make Calls and Use SMS in Android Apps</h1></a></header><div class="posts__post-teaser">In this tutorial, you'll learn about the Android Telephony and SMS API. You'll learn how to make a call from your app and how to monitor phone call events,...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/1499/profiles/20007/profileImage/Untitled-1.jpg" alt="Chike Mgbemena "><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/chike-mgbemena">Chike Mgbemena </a></address> <time class="posts__post-publication-date" datetime="2017-02-15 09:51:07 UTC" title="15 Feb 2017">15 Feb 2017</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android-sdk">Android SDK</a></div></footer></article></li> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/tutorials/android-sensors-in-depth-proximity-and-gyroscope--cms-28084"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28084/preview_image/picROM.jpg"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/tutorials/android-sensors-in-depth-proximity-and-gyroscope--cms-28084"><h1 class="nolinks">Android Sensors in Depth: Proximity and Gyroscope</h1></a></header><div class="posts__post-teaser">Gyroscopes and proximity sensors are available on most Android phones today. By using them creatively, you can add a whole new dimension to your user...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/362/profiles/18808/profileImage/picGrid.jpg" alt="Ashraff Hathibelagal"><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/ashraff-hathibelagal">Ashraff Hathibelagal</a></address> <time class="posts__post-publication-date" datetime="2017-01-27 12:10:24 UTC" title="27 Jan 2017">27 Jan 2017</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android-sdk">Android SDK</a></div></footer></article></li> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/tutorials/getting-started-with-android-vr-through-google-cardboard-panoramic-images--cms-27653"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/27653/preview_image/cardboard-course-blue.png"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/tutorials/getting-started-with-android-vr-through-google-cardboard-panoramic-images--cms-27653"><h1 class="nolinks">Get Started With Android VR and Google Cardboard: Panoramic Images</h1></a></header><div class="posts__post-teaser">This tutorial is the first in a short series about the Android Cardboard and Daydream SDK. There are a surprising number of ways you can integrate the...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/769/profiles/19326/profileImage/paultr3.jpg" alt="Paul Trebilcox-Ruiz"><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/paul-trebilcox-ruiz">Paul Trebilcox-Ruiz</a></address> <time class="posts__post-publication-date" datetime="2016-12-08 15:04:03 UTC" title="08 Dec 2016">08 Dec 2016</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android-sdk">Android SDK</a></div></footer></article></li> <li class="roundup-block__content posts__post"><article><header><a class="posts__post-preview" href="http://code.tutsplus.com/courses/create-a-voice-controlled-android-app"><img class="posts__post-preview-image posts__post-preview-image--regular" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/1038/preview_image/voice400.png"></a><a class="roundup-block__content-link posts__post-title" href="http://code.tutsplus.com/courses/create-a-voice-controlled-android-app"><h1 class="nolinks">Create a Voice-Controlled Android App</h1></a></header><div class="posts__post-teaser">Voice-based user interfaces have a universal appeal. And why wouldn't they? Being able to talk to an application feels so much more natural than pressing...</div> <footer class="posts__post-details"><div class="posts__post-teaser-overlay"></div> <div class="posts__post-publication-meta"> <img sizes="76px" class="posts__post-author_photo" src="https://cms-assets.tutsplus.com/uploads/users/362/profiles/18808/profileImage/picGrid.jpg" alt="Ashraff Hathibelagal"><div class="posts__post-details__info"> <address class="posts__post-author"><a class="posts__post-author-link" href="http://tutsplus.com/authors/ashraff-hathibelagal">Ashraff Hathibelagal</a></address> <time class="posts__post-publication-date" datetime="2017-03-06 03:01:14 UTC" title="06 Mar 2017">06 Mar 2017</time> </div> </div> <div class="posts__post-primary-category topic-code"><a class="posts__post-primary-category-link topic-code" href="http://code.tutsplus.com/categories/android">Android</a></div></footer></article></li> </ul><p></p> 2017-07-04T15:00:00.000Z 2017-07-04T15:00:00.000Z Paul Trebilcox-Ruiz tag:code.tutsplus.com,2005:PostPresenter/cms-28963 Android Design Patterns: The Observer Pattern <h2>What Is the Observer Pattern?<br> </h2><p>The Observer Pattern is a <a href="https://en.wikipedia.org/wiki/Software_design_pattern" rel="external" target="_blank">software design pattern</a> that establishes a one-to-many dependency between objects. Anytime the state of one of the objects (the "subject" or "observable") changes, all of the other objects ("observers") that depend on it are notified.</p><p>Let's use the example of users that have subscribed to receive offers from <a href="https://market.envato.com/" rel="external" target="_blank" title="Link: https://market.envato.com/">Envato Market</a> via email. The users in this case are observers. Anytime there is an offer from Envato Market, they get notified about it via email. Each user can then either buy into the offer or decide that they might not be really interested in it at that moment. A user (an observer) can also subscribe to receive offers from another e-commerce marketplace if they want and might later completely unsubscribe from receiving offers from any of them. </p><p>This pattern is very similar to the Publish-Subscribe pattern. The subject or observable publishes out a notification to the dependent observers without even knowing how many observers have subscribed to it, or who they are—the observable only knows that they should implement an interface (we'll get to that shortly), without worrying about what action the observers might perform.</p><h2>Benefits of the Observer Pattern</h2><ul> <li>The subject knows little about its observers. The only thing it knows is that the observers implement or agree to a certain contract or interface. </li> <li>Subjects can be reused without involving their observers, and the same goes for observers too.</li> <li>No modification is done to the subject to accommodate a new observer. The new observer just needs to implement an interface that the subject is aware of and then register to the subject. </li> <li>An observer can be registered to more than one subject it's registered to.</li> </ul><p>All these benefits give you loose coupling between modules in your code, which enables you to build a flexible design for your application. In the rest of this post, we'll look at how to create our own Observer pattern implementation, and we'll also use the built-in Java Observer/Observable API as well as looking into third-party libraries that can offer such functionality. </p><h2>Building Our Own Observer Pattern</h2><h3>1. Create the Subject Interface</h3><p>We start by defining an interface that subjects (observables) will implement.</p><pre class="brush: java noskimlinks noskimwords">public interface Subject { void registerObserver(RepositoryObserver repositoryObserver); void removeObserver(RepositoryObserver repositoryObserver); void notifyObservers(); }</pre><p>In the code above, we created a <a href="https://docs.oracle.com/javase/tutorial/java/concepts/interface.html" rel="external" target="_blank">Java Interface</a> with three methods. The first method <code class="inline">registerObserver()</code>, as it says, will register an observer of type <code class="inline">RepositoryObserver</code> (we'll create that interface shortly) to the subject. <code class="inline">removeObserver()</code> will be called to remove an observer that wants to stop getting notifications from the subject, and finally, <code class="inline">notifyObserver()</code> will send a broadcast to all observers whenever there is a change. Now, let's create a concrete subject class that will implement the subject interface we have created:</p><pre class="brush: java noskimlinks noskimwords">import android.os.Handler; import java.util.ArrayList; public class UserDataRepository implements Subject { private String mFullName; private int mAge; private static UserDataRepository INSTANCE = null; private ArrayList<RepositoryObserver> mObservers; private UserDataRepository() { mObservers = new ArrayList<>(); getNewDataFromRemote(); } // Simulate network private void getNewDataFromRemote() { final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { setUserData("Chike Mgbemena", 101); } }, 10000); } // Creates a Singleton of the class public static UserDataRepository getInstance() { if(INSTANCE == null) { INSTANCE = new UserDataRepository(); } return INSTANCE; } @Override public void registerObserver(RepositoryObserver repositoryObserver) { if(!mObservers.contains(repositoryObserver)) { mObservers.add(repositoryObserver); } } @Override public void removeObserver(RepositoryObserver repositoryObserver) { if(mObservers.contains(repositoryObserver)) { mObservers.remove(repositoryObserver); } } @Override public void notifyObservers() { for (RepositoryObserver observer: mObservers) { observer.onUserDataChanged(mFullName, mAge); } } public void setUserData(String fullName, int age) { mFullName = fullName; mAge = age; notifyObservers(); } }</pre><p><span class="sectionnum">The class above implements the <code class="inline">Subject</code> interface. We have an <code class="inline">ArrayList</code> that holds the observers and then creates it in the private constructor. An observer registers by being added to the <code class="inline">ArrayList</code> and likewise, unregisters by being removed from the <code class="inline">ArrayList</code>. </span></p><p><span class="sectionnum">Note that we are simulating a network request to retrieve the new data. </span><span class="sectionnum">Once the <code class="inline">setUserData()</code> method is called and given the new value for the full name and age, we call the <code class="inline">notifyObservers()</code> method which, as it says, notifies or sends a broadcast to all registered observers about the new data change. The new values for the full name and age are also passed along. This subject can have multiple observers but, in this tutorial, w</span>e'll create just one observer. But first, let's create the observer interface. </p><h3> <span class="sectionnum">2.</span> Create the Observer Interface</h3><pre class="brush: java noskimlinks noskimwords">public interface RepositoryObserver { void onUserDataChanged(String fullname, int age); }</pre><p>In the code above, we created the observer interface which concrete observers should implement. This allows our code to be more flexible because we are coding to an interface instead of a concrete implementation. A concrete <code class="inline">Subject</code> class does not need to be aware of the many concrete observers it may have; all it knows about them is that they implement the <code class="inline">RepositoryObserver</code> interface. </p><p>Let's now create a concrete class that implements this interface.</p><pre class="brush: java noskimlinks noskimwords">import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class UserProfileActivity extends AppCompatActivity implements RepositoryObserver { private Subject mUserDataRepository; private TextView mTextViewUserFullName; private TextView mTextViewUserAge; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_profile); mTextViewUserAge = (TextView) findViewById(R.id.tv_age); mTextViewUserFullName = (TextView) findViewById(R.id.tv_fullname); mUserDataRepository = UserDataRepository.getInstance(); mUserDataRepository.registerObserver(this); } @Override public void onUserDataChanged(String fullname, int age) { mTextViewUserFullName.setText(fullname); mTextViewUserAge.setText(age); } @Override protected void onDestroy() { super.onDestroy(); mUserDataRepository.removeObserver(this); } }</pre><p>The first thing to notice in the code above is that <code class="inline">UserProfileActivity</code> implements the <code class="inline">RepositoryObserver</code> interface—so it must implement the method <code class="inline">onUserDataChanged()</code>. In the <code class="inline">onCreate()</code> method of the Activity, we got an instance of the <code class="inline">UserDataRepository</code> which we then initialized and finally registered this observer to. </p><p>In the <code class="inline">onDestroy()</code> method, we want to stop getting notifications, so we unregister from receiving notifications. </p><p>In the <code class="inline">onUserDataChanged()</code> method, we want to update the <code class="inline">TextView</code> widgets—<code class="inline">mTextViewUserFullName</code> and <code class="inline">mTextViewUserAge</code>—with the new set of data values. </p><p>Right now we just have one observer class, but it's possible and easy for us to create other classes that want to be observers of the <code class="inline">UserDataRepository</code> class. For example, we could easily have a <code class="inline">SettingsActivity</code> that wants to also be notified about the user data changes by becoming an observer. </p><h2>Push and Pull Models</h2><p>In the example above, we are using the push model of the observer pattern. In this model, the subject notifies the observers about the change by passing along the data that changed. But in the pull model, the subject will still notify the observers, but it does not actually pass the data that changed. The observers then pull the data they need once they receive the notification. </p><h2>Utilising Java's Built-In Observer API</h2><p>So far, we have created our own Observer pattern implementation, but Java has built-in Observer / Observable support in its API. In this section, we are going to use this. This API simplifies some of the implementation, as you'll see. </p><h3> <span class="sectionnum">1.</span> Create the Observable</h3><p>Our <code class="inline">UserDataRepository</code>—which is our subject or observable—will now extend the <code class="inline">java.util.Observable</code> superclass to become an <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Observable.html" rel="external" target="_blank">Observable</a>. This is a class that wants to be observed by one or more observers. </p><pre class="brush: java noskimlinks noskimwords">import android.os.Handler; import java.util.Observable; public class UserDataRepository extends Observable { private String mFullName; private int mAge; private static UserDataRepository INSTANCE = null; private UserDataRepository() { getNewDataFromRemote(); } // Returns a single instance of this class, creating it if necessary. public static UserDataRepository getInstance() { if(INSTANCE == null) { INSTANCE = new UserDataRepository(); } return INSTANCE; } // Simulate network private void getNewDataFromRemote() { final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { setUserData("Mgbemena Chike", 102); } }, 10000); } public void setUserData(String fullName, int age) { mFullName = fullName; mAge = age; setChanged(); notifyObservers(); } public String getFullName() { return mFullName; } public int getAge() { return mAge; } }</pre><p>Now that we have refactored our <code class="inline">UserDataRepository</code> class to use the Java Observable API, let's see what has changed compared to the previous version. The first thing to notice is that we are extending a super class (this means that this class can't extend any other class) and not implementing an interface as we did in the previous section. </p><p>We are no longer holding an <code class="inline">ArrayList</code> of observers; this is handled in the super class. Similarly, we don't have to worry about registration, removal, or notification of observers—<code class="inline">java.util.Observable</code> is handling all of those for us. </p><p>Another difference is that in this class we are employing a pull style. We alert the observers that a change has happened with <code class="inline">notifyObservers()</code>, but the observers will need to pull the data using the field getters we have defined in this class. If you want to use the push style instead, then you can use the method <code class="inline">notifyObservers(Object arg)</code> and pass the changed data to the observers in the object argument. </p><p>The <code class="inline">setChanged()</code> method of the super class sets a flag to true, indicating that the data has changed. Then you can call the <code class="inline">notifyObservers()</code> method. Be aware that if you don't call <code class="inline">setChanged()</code> before calling <code class="inline">notifyObsevers()</code>, the observers won't be notified. You can check the value of this flag by using the method <code class="inline">hasChanged()</code> and clear it back to false with <code class="inline">clearChanged()</code>. Now that we have our observable class created, let's see how to set up an observer also. </p><h3> <span class="sectionnum">2.</span> Create the Observer</h3><p>Our <code class="inline">UserDataRepository</code> observable class needs a corresponding <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Observer.html" rel="external" target="_blank">Observer</a> to be useful, so let's refactor our <code class="inline">UserProfileActivity</code> to implement the <code class="inline">java.util.Observer</code> interface. </p><pre class="brush: java noskimlinks noskimwords">import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; import com.chikeandroid.tutsplusobserverpattern.R; import java.util.Observable; import java.util.Observer; public class UserProfileActivity extends AppCompatActivity implements Observer { private Observable mUserDataRepositoryObservable; private TextView mTextViewUserFullName; private TextView mTextViewUserAge; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_profile); mTextViewUserAge = (TextView) findViewById(R.id.tv_age); mTextViewUserFullName = (TextView) findViewById(R.id.tv_fullname); mUserDataRepositoryObservable = UserDataRepository.getInstance(); mUserDataRepositoryObservable.addObserver(this); } @Override public void update(Observable observable, Object o) { if (observable instanceof UserDataRepository) { UserDataRepository userDataRepository = (UserDataRepository)observable; mTextViewUserAge.setText(String.valueOf(userDataRepository.getAge())); mTextViewUserFullName.setText(userDataRepository.getFullName()); } } @Override protected void onDestroy() { super.onDestroy(); mUserDataRepositoryObservable.deleteObserver(this); } }</pre><p>In the <code class="inline">onCreate()</code> method, we add this class as an observer to the <code class="inline">UserDataRepository</code> observable by using the <code class="inline">addObserver()</code> method in the <code class="inline">java.util.Observable</code> super class. </p><p>In the <code class="inline">update()</code> method which the observer must implement, we check if the <code class="inline">Observable</code> we receive as a parameter is an instance of our <code class="inline">UserDataRepository</code> (note that an observer can subscribe to different observables), and then we cast it to that instance and retrieve the values we want using the field getters. Then we use those values to update the view widgets. </p><p>When the activity is destroyed, we don't need to get any updates from the observable, so we'll just remove the activity from the observer list by calling the method <code class="inline">deleteObserver()</code>. </p><h2>Libraries to Implement an Observer Pattern</h2><p>If you don't want to build your own Observer pattern implementation from scratch or use the Java Observer API, you can use some free and open-source libraries that are available for Android such as Greenrobot's EventBus. To learn more about it, check out my tutorial here on Envato Tuts+.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/effective-android-components-communication-with-greenrobot-eventbus--cms-27654"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/27654/preview_image/EventBus-Publish-Subscribe%20(1).png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Communication Within an Android App With EventBus</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li></ul><p>Or, you might like RxAndroid and RxJava. Learn more about them here:</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/getting-started-with-reactivex-on-android--cms-24387"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/24387/preview_image/picrx.png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Getting Started With ReactiveX on Android</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li></ul><h2>Conclusion<br> </h2><p>In this tutorial, you learned about the Observer pattern in Java: what is it, the benefits of using it, how to implement your own, using the Java Observer API, and also some third-party libraries for implementing this pattern. </p><p>In the meantime, check out some of our other courses and tutorials on the Java language and Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/rxjava-for-android-apps-introducing-rxbinding-and-rxlifecycle--cms-28565"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28565/preview_image/RxJava-RxAndroid-Introducing-RxBinding-and-RxLifecycle.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">RxJava 2 for Android Apps: RxBinding and RxLifecycle</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/practical-concurrency-on-android-with-hamer--cms-27137"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1308/posts/27137/preview_image/cover.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Practical Concurrency on Android With HaMeR</div> <div class="roundup-block__author">Tin Megali</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/ensure-high-quality-android-code-with-static-analysis-tools--cms-28787"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/preview_image/dd.jpg"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Ensure High-Quality Android Code With Static Analysis Tools</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/create-an-intelligent-app-with-google-cloud-speech-and-natural-language-apis--cms-28890"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28890/preview_image/preview.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Create an Intelligent App With Google Cloud Speech and Natural Language APIs</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> </ul><p></p> 2017-06-21T13:19:53.000Z 2017-06-21T13:19:53.000Z Chike Mgbemena tag:code.tutsplus.com,2005:PostPresenter/cms-28944 Mobile Development Platforms <p>When you're first getting started with mobile development, it can be hard to choose a platform. Even worse, each platform has its own set of languages and tools to choose from. So how can you decide?</p><p>This tutorial will help you pick a suitable mobile development platform so that you can jump in and start coding apps.<br></p><h2>Platforms and Their Market Shares<br> </h2><p>A platform—an ecosystem of mobile devices, toolkits, and apps—is usually defined by its operating system (OS). The platform vendors are large companies such as Google, Apple, Microsoft, etc. Each one has developed an OS which they license to device manufacturers. Sometimes, they may be also device manufacturers themselves. The device manufacturers design and build the devices (mostly smartphones and tablets) with the relevant OS pre-installed. These devices are then sold to consumers (the users). </p><p>Some basic apps, developed by the device manufacturer or even the platform vendor, may come pre-installed on the device. However, the vendor and the device manufacturer alone are unable to cater to the ever-growing needs of the users of these devices. So they rely on "third-party" developers—like you!—to fill in the gap of supply and demand. </p><p>To support the developers who want to sell apps for the platform, they publish SDKs, APIs and other tools to make app development easier. Also, an official "app store" may be launched, to which the developers can publish their apps and from which the consumers can browse and download them. Thus, a whole app ecosystem is built around the platform.</p><p>Currently, Android OS by Google has the largest global market share, with a whopping 86.1%. Apple's iOS has 13.7% and holds the second position. The remaining portion of around 0.2% is shared by all the other vendors combined. This includes Windows Mobile by Microsoft, BlackBerry OS, Tizen OS, Sailfish OS, and Ubuntu Touch. </p><p>The global composition may change significantly in certain countries. For example, in the United States, Android's market share is 53.4% and iOS share is 44.5%, a notable difference when compared with the global market share. If you have a specific market in mind, it would be a good idea to research that target demographic to find out which platform they are likely to use!</p><h3>CPU Architecture</h3><p>While all these platforms support ARM CPU architecture, Android extends its support even further, covering x86 and MIPS architectures. Tizen, Sailfish OS, and Ubuntu Touch also support x86 architecture. However, unless you are programming custom ROM chips, the CPU architectures supported by each platform won't affect your choice.</p><h2>How to Choose a Platform<br> </h2><h3>Your Familiarity With Programming Languages<br> </h3><p>You'll have to write lots of code as a mobile app developer. There are certain tools that allow you to avoid typing in a text-based code editor—for example, both Android and iOS have drag-and-drop tools for building graphical user interfaces. These won't let you fully use the platform features and capabilities, though. To build complex apps, you'll have to learn to the programming language for your platform.</p><p>So you might have to put in some effort to learn a new programming language or master one you already know. All the major platforms use popular programming languages with large developer communities. So make sure you leverage your knowledge and skills in those languages.</p><p>If you are familiar with Java, you'll find it easier to develop Android apps with Android SDK (Software Development Kit). However, some advanced app features will require you to use C and C++ skills, with the Android NDK (Native Development Kit). Also, it is now possible to program for Android with alternative languages such as Kotlin.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/learn-java-for-android"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/694/preview_image/java-android-1.png"><div class="roundup-block__primary-category topic-code">Java</div> <div class="roundup-block__content-title">Learn Java for Android</div> <div class="roundup-block__author">Sue Smith</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/java-vs-kotlin-should-you-be-using-kotlin-for-android-development--cms-27846"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27846/preview_image/java-or-kotlin-for-android-dev.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Java vs. Kotlin: Should You Be Using Kotlin for Android Development?</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul><p>iOS requires Objective-C or Swift programming skills. </p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-ios-apps-with-swift-3"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/969/preview_image/swift-2.png"><div class="roundup-block__primary-category topic-code">Swift</div> <div class="roundup-block__content-title">Create iOS Apps With Swift 3</div> <div class="roundup-block__author">Markus Mühlberger</div></a></li></ul><p>If you are a fan of Microsoft's Visual Studio .NET, you'll be happy developing Windows Mobile apps with C#. </p><p>To develop for BlackBerry or Tizen, just learn HTML, CSS, and JavaScript. </p><p>Master QML or Python, and you'd ready to develop Sailfish apps. </p><p>If you love Ubuntu Touch, you should learn QML or HTML and JavaScript. </p><p>Finally, if you already know the web languages such as JavaScript and CSS, you can use these to develop for any platform, with a mobile cross-platform framework.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/javascript-fundamentals"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/544/preview_image/Js-fun.png"><div class="roundup-block__primary-category topic-code">JavaScript</div> <div class="roundup-block__content-title">JavaScript Fundamentals</div> <div class="roundup-block__author">Dan Wellman</div></a></li></ul><p>New programming languages are constantly being proposed and promoted. While it's not always clear whether these new languages have a big advantage over the old ones, it's a good idea to stay tuned for the latest trends. Some programming languages may become obsolete with the introduction of the new ones—Swift is a replacement for Objective-C, for example—and some old languages may find renewed existence, with totally new uses.<br></p><h3>Native vs. Hybrid Development<br> </h3><p>You have two options when it comes to developing smartphone apps: native apps and hybrid. A native app published on one platform won't run on another platform. For example, you can't install an Android native app on an iOS device. You need to publish a separate platform-specific version for that, built using the appropriate development and deployment tools, targeting iOS. By contrast, a hybrid app is a web app developed with HTML, CSS, and JavaScript, and wrapped in a native app shell (or UI). </p><p>What's great about native apps is that they are superior in performance, and they fully utilize the device's capabilities. Also, they are more secure. The downside is that the developer has to maintain several codebases for each of the platforms. Since hybrid apps have only moderate access to native APIs, their performance and the level of user experience (UX) is somewhat lagging behind. The key advantage of the hybrid apps is that the developer could publish for multiple platforms with the same codebase.</p><p>If you want to build native apps, you might want to check out our comprehensive courses on getting started coding apps for Android or iOS.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/getting-started-with-android"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/564/preview_image/getting-started-android-1.png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Getting Started With Android</div> <div class="roundup-block__author">Paul Trebilcox-Ruiz</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-ios-apps-with-swift-3"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/969/preview_image/swift-2.png"><div class="roundup-block__primary-category topic-code">Swift</div> <div class="roundup-block__content-title">Create iOS Apps With Swift 3</div> <div class="roundup-block__author">Markus Mühlberger</div></a></li> </ul><p>Ionic 2 is a popular framework for developing cross-platform hybrid mobile apps. It is based on the Angular 2 web framework. If you want to learn more, check out some of our courses or tutorials.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/get-started-with-ionic-2"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/888/preview_image/ionic-3.png"><div class="roundup-block__primary-category topic-code">Ionic</div> <div class="roundup-block__content-title">Get Started With Ionic 2</div> <div class="roundup-block__author">Reginald Dawson</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/introduction-to-ionic-2--cms-28193"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/28193/preview_image/ionic.png"><div class="roundup-block__primary-category topic-code">Ionic 2</div> <div class="roundup-block__content-title">Introduction to Ionic 2</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-create-a-camera-app-with-ionic-2--cms-28205"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28205/preview_image/ionic.png"><div class="roundup-block__primary-category topic-code">Ionic</div> <div class="roundup-block__content-title">How to Create a Camera App With Ionic 2</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> </ul><h3>Native Cross-Platform Apps</h3><p>Recently, a new batch of mobile cross-platform frameworks have emerged. These combine the best features of native apps and hybrid apps—they're fast and light and can access the full power of the native device, but they also are coded with JavaScript and other web languages, so a lot of code can be reused between platforms.</p><p>React Native and NativeScript are popular native cross-platform frameworks. If you want to learn more about these, check out our comprehensive beginner course or some of our many tutorials.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/get-started-with-react-native"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/16/courses/708/preview_image/react-1.png"><div class="roundup-block__primary-category topic-code">React Native</div> <div class="roundup-block__content-title">Get Started With React Native</div> <div class="roundup-block__author">Markus Mühlberger</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/get-started-with-layouts-in-react-native--cms-27418"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/27418/preview_image/rn.jpg"><div class="roundup-block__primary-category topic-code">React Native</div> <div class="roundup-block__content-title">Get Started With React Native Layouts</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/practical-animations-in-react-native--cms-27567"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1125/posts/27567/preview_image/rn.jpg"><div class="roundup-block__primary-category topic-code">React Native</div> <div class="roundup-block__content-title">Practical Animation Examples in React Native</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/an-introduction-to-nativescript--cms-26771"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/41/posts/26771/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Mobile Development</div> <div class="roundup-block__content-title">An Introduction to NativeScript</div> <div class="roundup-block__author">Wernher-Bel Ancheta</div></a></li> </ul><h3>Your Ability to Learn</h3><p>If you're a fast learner, then you could easily master the native development track. You'll need to understand basic programming concepts such as object-oriented programming (OOP), and you have to learn to be comfortable with the platform-specific technical concepts—such as Application Lifecycle Management in Android, for example. </p><p>To get started, just download the necessary tools and SDKs from the platform vendor and give it a try. Most of these tools are open source, and there are plenty of code samples and app templates bundled with them to help you get started fast. </p><p>If you are a web developer and want to explore the smartphone development space, then you might be more comfortable starting with hybrid or cross-platform native development. </p><h3>System Setup & Ease of Coding<br> </h3><p>Another factor to consider is the OS platform, and sometimes the hardware setup of the development computer. </p><p>If you want to develop native iOS apps, you won't be able to do so on a normal Windows computer. You need a Mac with macOS, and Xcode, Apple's IDE for iOS development. Similarly, Ubuntu Touch native apps are best developed with an Ubuntu computer. While Android SDK runs on all three major desktop OS platforms, it's always advisable to check if your system meets the recommended specs before you start developing.</p><h3>App Store Policies & Revenue Sharing</h3><p>Both Google's and Apple's app stores charge a nominal registration fee. Although both offer the same revenue sharing percentage (70% of sale price at present), developers can, in theory, earn more revenue by publishing on Apple's. That's because the number of apps is relatively smaller and there's less competition among similar apps. Also, you need to be aware that not all geographic locations are allowed to publish paid apps on Google's Play Store. So you must think of a method of monetizing your app in advance.</p><p>Besides selling the app itself, another way to monetize your app is by displaying ads or by offering to unlock additional features.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-add-admob-banner-ads-to-your-ios-swift-app--cms-27403"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1455/posts/27403/preview_image/preview.jpg"><div class="roundup-block__primary-category topic-code">iOS</div> <div class="roundup-block__content-title">How to Add AdMob Banner Ads to Your iOS Swift App</div> <div class="roundup-block__author">Francesco Franchini</div></a></li></ul><h3>Your Target Audience<br> </h3><p>This is an important factor because the success of your app depends on how well you address your audience, or how effectively you solve their problems. While most smartphone users tend to belong to younger generations, there are smartphone apps dedicated to older people and disabled people. Since the platform market share changes by country and age group, it's a good idea to research the platform demographics, if you want to target a specific demographic. </p><h3>Supported Device Features by Platform<br> </h3><p>Not all the devices support every feature of a platform. On the one hand, there are high-end devices, often dubbed "flagship products", supporting most of the features. On the other hand, there are low-cost, entry-level devices, supporting only the basic features. Then, there's everything in between. </p><p>So you need to be very selective and make informed decisions when you develop apps. Developing an app that needs features supported only by high-end devices might severely affect your app's sales.</p><p>On the other hand, this could be an opportunity, if you can offer users of an advanced device an app feature that is not available elsewhere.</p><h2>Conclusion<br> </h2><p>In this post, I've looked at the all the main mobile development platforms and tried to give you some guidance to help you choose between them. Applying these insights will surely help you become successful in your app development business.</p> 2017-06-12T13:00:00.000Z 2017-06-12T13:00:00.000Z Bala Durage Sandamal Siripathi tag:code.tutsplus.com,2005:PostPresenter/cms-28937 Google I/O 2017 Aftermath: What's New in Android Studio 3? <p>In this series of tips, we’ve been taking a closer look at some of the new Android features and tools announced at this year’s Google I/O, that you can get your hands on <em>today</em>.</p><p>In this post, we’re going to get some hands-on experience with the major new features coming up in Android Studio 3, by exploring the Android Studio 3.0 Preview.</p><p>If you haven’t already, you can <a href="https://developer.android.com/studio/preview/index.html" rel="external" target="_blank">download the Preview</a> from the official Android website. Just note that this is an early access release, so it’s not recommended to use it for your day-to-day development work. </p><h2>Built-In Support for Kotlin</h2><p>One of the most exciting Android announcements from this year’s Google I/O keynote is that Google is making Kotlin a first-class language for Android development. </p><p>Although you could previously add Kotlin support to Android Studio via a plugin, Android Studio 3.0 will have Kotlin support built in, making it even easier to start using Kotlin for Android development.</p><p>There are three ways that you can start using Kotlin in the Android Studio 3.0 Preview:</p><h4>Start a New Project With Kotlin</h4><p>First, if you’re creating a new project then the project creation wizard now features an <strong>Include Kotlin Support</strong> checkbox.</p><figure class="post_image"><img alt="When youre creating a project you can select the Include Kotlin Support checkbox" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28937/image/android-studio-3.0-kotlin-support.jpg"></figure><p>When you select this option, Android Studio generates all the code your project needs to support Kotlin. If you open your project-level <strong>build.gradle</strong> file, you’ll see that the version of Kotlin you’re using has been added to the <code class="inline">buildscript</code> section:</p><pre class="brush: plain noskimlinks noskimwords">buildscript { ext.kotlin_version = '1.1.2-4' repositories { maven { url 'https://maven.google.com' } jcenter() }</pre><p>And if you open your module-level <strong>build.gradle</strong> file, you’ll notice that some Kotlin-specific lines have been added here, too:</p><pre class="brush: xml noskimlinks noskimwords">apply plugin: 'com.android.application' apply plugin: 'kotlin-android' ... ... ... dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"</pre><h4>Convert Existing Java Files to Kotlin</h4><p>The second method is to convert an existing Java file into a Kotlin file:</p><ul> <li>Select the file you want to convert in Android Studio’s <strong>Project view</strong>.</li> <li>Select <strong>Code > Convert Java file to Kotlin file</strong> from the Android Studio toolbar. This runs the Java file through a converter, generating the equivalent Kotlin code.</li> <li>At this point, Android Studio will display a banner informing you that Kotlin isn’t configured in your project. Click the <strong>Configure</strong> link that appears in this banner.</li> <li>Select <strong>Android with Gradle</strong>.</li> <li> Choose from <strong>All modules</strong>, <strong>All modules containing Kotlin files</strong>, or select the specific module where you want to support Kotlin. </li> <li> Click <strong>OK</strong>.</li> </ul><h4>Add a Kotlin Class to an Existing Project</h4><p>The final method is to create a new Kotlin class, by <strong>Control</strong>-clicking the directory where you want to create your class, and then selecting <strong>New > Kotlin file / class</strong>. Again, if your project isn’t configured to support Kotlin, then Android Studio will display the <strong>Configure</strong> banner.</p><p>And, if you’re not familiar with Kotlin and want to find out what all the fuss is about, then we’ve published a whole series walking you through the process of <a href="https://code.tutsplus.com/series/coding-android-apps-in-kotlin--cms-1119">getting started with Kotlin for Android development</a>.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/java-vs-kotlin-should-you-be-using-kotlin-for-android-development--cms-27846"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27846/preview_image/java-or-kotlin-for-android-dev.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Java vs. Kotlin: Should You Be Using Kotlin for Android Development?</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/start-developing-android-apps-with-kotlin-part-1--cms-27827"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27827/preview_image/start-developing-android-apps-with-kotlin.jpg"><div class="roundup-block__primary-category topic-code">Android Studio</div> <div class="roundup-block__content-title">Coding Functional Android Apps in Kotlin: Getting Started</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/coding-functional-android-apps-in-kotlin-lambdas-null-safety-more--cms-27964"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27964/preview_image/Coding-Functional-Android-Apps-Kotlin-Lambdas-Null.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Coding Functional Android Apps in Kotlin: Lambdas, Null Safety & More</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul><h2>A New Android Profiler </h2><p>Android Studio 3.0 Preview replaces the familiar Android Monitor window with a brand-new <em>Android Profiler</em>.</p><p>To take a look at this new tool, select <strong>View > Tool Windows > Android Profiler</strong> from the Android Studio toolbar, or click the <strong>Android Profiler</strong> tab that appears along the bottom of the IDE window.</p><p>Similar to Android Monitor, the Android Profiler can only communicate with a running app, so make sure the app you want to test is running on an AVD or a connected smartphone or tablet, and that it’s currently visible onscreen. Select the device and the process you want to profile, using the dropdown menus.</p><p>As soon as you’ve selected a process, the Android Profiler attaches to that process and displays a timeline of your app’s Network, CPU and Memory usage, which updates in real time. </p><figure class="post_image"><img alt="The Android Profiler displays three timelines CPU Memory and Network" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28937/image/android-studio-3.0-profiler-network-cpu-memory.jpg"></figure><p>To view more information about Network, CPU or Memory, simply click that section of the Android Profiler, which launches a new profiler dedicated entirely to your chosen topic. </p><h4><strong>Network Profiler</strong></h4><p>This Profiler displays a timeline of your network activity, displaying data sent and received, and the current number of connections. Note that the Network Profiler currently only supports the HttpURLConnection and OkHttp libraries, so you may be unable to view your app’s network activity if you’re using a different library.</p><h4><strong>CPU Profiler</strong></h4><p>This Profiler displays your app’s CPU usage and thread activity. You can also see exactly which methods are being executed and the CPU resources each method consumes, by recording a method trace. </p><p>To record a trace, open the dropdown menu and select either <strong>Sampled</strong> or <strong>Instrumented</strong>, and then click the <strong>Record</strong> button. Spend some time interacting with your app, making sure to perform the actions you want to record, and then click the <strong>Stop recording</strong> button. The CPU Profiler will then display all the data recorded during this sampling period.</p><h4><strong>Memory Profiler</strong></h4><p>This Profiler helps you identify memory leaks, memory churn and undesirable memory allocation patterns, by displaying a graph of your app’s memory use. You can also use the Memory Profiler to capture a heap dump, which provides a snapshot of the objects your app has allocated, along with how much memory each object is using and where references to each object are being held in your code. Finally, you can record your app’s memory allocations, by clicking the <strong>Record memory allocations</strong> button. </p><h2>Create Standalone Instant App Modules</h2><p>Android Instant Apps allow users to run applications instantly via a URL, without having to install the application first. This feature allows you to make your app’s most important features available to more users—while hopefully tempting them into downloading the full version of your app in the process. </p><p>The first step to adding Android Instant App functionality to your project is to break your app into smaller modules, so users have the option to download a specific portion of your project. Since breaking your app into multiple, standalone modules isn’t exactly an easy task, Android Studio 3.0 Preview introduces a feature to help you modularize any class within your application: </p><ul> <li>Open the class you want to modularize, and highlight the class name.</li> <li> <strong>Control</strong>-click the class, and then select <strong>Refactor > Modularize</strong>.</li> </ul><figure class="post_image"><img alt="Control-click a class and select Refactor Modularize from the dropdown that appears" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28937/image/android-studio-3.0-instant-apps-modularize.jpg"></figure><ul> <li>Select <strong>Preview</strong> to see the exact classes, methods and resources that are going to be incorporated into this new module.</li> <li>If required, deselect some of the items you don’t want to include in this module. If you do remove one or more items, then you’ll typically need to spend some time adjusting the resulting module’s code, to make sure it functions correctly.</li> <li>When you’re happy with your selection, go ahead and create your module by clicking <strong>OK</strong>.</li> </ul><h2>Improved Java 8 Support </h2><p>Android Studio 3.0 Preview 1 provides built-in support for a subset of Java 8 language features and the third-party libraries that use them, specifically:</p><ul> <li>Lambda expressions</li> <li>Method References</li> <li>Type Annotations</li> <li>Default and static interface methods</li> <li>Repeating annotations</li> </ul><p>In addition, the following Java 8 features are compatible with API level 24 and higher: </p><ul> <li><code class="inline">java.lang.annotation.Repeatable</code></li> <li><code class="inline">java.util.function</code></li> <li><code class="inline">java.lang.reflect.Method.isDefault()</code></li> <li><code class="inline">java.lang.FunctionalInterface</code></li> <li><code class="inline">java.util.stream</code></li> <li><code class="inline">annotatedElement.getAnnotationsByType(Class)</code></li> </ul><p>To take advantage of this improved Java 8 support, you’ll need to update to version 3.0.0-alpha1 (or higher) of the Gradle plugin. Start by opening your <strong>gradle-wrapper.properties</strong> file and updating the <code class="inline">distributionUrl</code>:</p><pre class="brush: xml noskimlinks noskimwords">distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip</pre><p>Next, open your project-level <strong>build.gradle</strong> file and make sure you’re using Google’s new Maven repository. You’ll also need to update to version 3.0.0-alpha1 of the Gradle plugin: </p><pre class="brush: xml noskimlinks noskimwords">buildscript { repositories { maven { url 'https://maven.google.com' } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha1'</pre><p>If you’ve previously enabled the Jack compiler, then you’ll need to disable it in order to take advantage of Android Studio’s improved Java 8 support. To remove Jack, open your module-level <strong>build.gradle</strong> file and delete the <code class="inline">jackOptions</code> block:</p><pre class="brush: xml noskimlinks noskimwords">android { ... ... ... defaultConfig { // Remove the following block// jackOptions { enabled true ... } }</pre><p>Finally, you’ll need to add the Java 8 <code class="inline">compileOptions</code> block to your <strong>build.gradle</strong> file, if you haven’t already: </p><pre class="brush: xml noskimlinks noskimwords">compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }</pre><h2>Custom Fonts Made Even Easier</h2><p>Google is about to make it much easier to add custom fonts to your app, by upgrading fonts to a fully-supported resource type in Android O. We’ve already explored <a href="https://code.tutsplus.com/tutorials/quick-tip-working-with-custom-fonts-in-android-o--cms-28625">working with custom fonts</a> in detail, but the Android Studio 3.0 Preview adds a handy feature that makes it even easier to browse for custom fonts and add them to your project:</p><ul> <li>Open any layout resource file that contains a <code class="inline">TextView</code>.</li> <li>Select the <strong>Design</strong> tab.</li> <li>In the layout editor, select the TextView. The <strong>Properties</strong> menu should open along the left-hand side of the Android Studio window.</li> <li>Scroll to the menu’s <strong>textAppearance</strong> section, and then click its accompanying arrow icon to expand this section. Open the <strong>fontFamily</strong> dropdown, and select <strong>More fonts</strong>. This opens a window where you can browse a library of fonts that are available to download.</li> </ul><figure class="post_image"><img alt="In the Properties menu expand the textAppearance section and then open the subsequent fontFamily dropdown" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28937/image/android-studio-3.0-custom-fonts.jpg"></figure><ul> <li>To add a font to your project, select it and then click <strong>OK</strong>. </li> <li>Open your project’s <strong>res/font</strong> folder, and you’ll see that this font has been added to your project, ready for you to use.</li> <li>To apply this font to <em>any</em> piece of text, simply add the attribute <code class="inline">android:fontFamily="@font/name-of-your-font.” </code> </li> </ul><h3>Other Notable Updates</h3><p>Android Studio 3.0 Preview also introduces some useful new tools: </p><h4><strong>APK Debugger</strong></h4><p>This tool makes it easier to profile and debug APKs—simply select <strong>File > Profile or debug APK</strong> from the Android Studio toolbar, and then select the APK you want to take a closer look at. Alternatively, select <strong>Profile or debug APK</strong> from Android Studio’s <strong>Welcome</strong> screen.</p><h4><strong>Device File Explorer</strong></h4><p>You can use this tool to interact with the connected device’s file system, allowing you to view, copy and delete files, and also upload files to your Android device. To use this tool, either select the <strong>Device File Explorer</strong> tab towards the bottom-right of the Android Studio screen, or select <strong>View > Tool Windows > Device File Explorer</strong> from the Android Studio toolbar.</p><h4><strong>Adaptive Icon Wizard</strong></h4><p>In Android O, Original Equipment Manufacturers will be able to apply a mask to all the application launcher icons across their device. To make sure your launcher icon displays correctly regardless of the mask being used, you’ll need to provide an adaptive launcher icon. </p><p>We’ve explored <a href="https://code.tutsplus.com/tutorials/quick-tips-introducing-android-os-adaptive-icons-and-pinned-shortcuts--cms-28632">creating adaptive icons</a> previously, but the new Android Studio Preview introduces a dedicated wizard that makes it easier to build these adaptive icons. To launch the wizard, <strong>Control</strong>-click your project’s <strong>res </strong>folder and select <strong>New > Image Asset</strong>. In the window that appears, open the <strong>Icon type</strong> dropdown, and set it to <strong>Launcher Icons (Adaptive and Legacy)</strong>. You can then build your adaptive icon by selecting a foreground and background layer.</p><figure class="post_image"><img alt="Android Studios Image Asset window will walk you through the process of creating an adaptive icon " src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28937/image/android-studio-3.0-adaptive-icon.jpg"></figure><h2>Conclusion</h2><p>In this tip, we explored some of the most exciting new tools and features already available in Android Studio 3.0 Preview, including built-in support for the Kotlin programming language, improved Java 8 support, and the all-new Android Profiler. With all the new features and tools available, Android app development is about to get even more exciting!</p><p>While you're here, check out some of our other tutorials and our video courses on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-a-voice-controlled-android-app"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/1038/preview_image/voice400.png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Create a Voice-Controlled Android App</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/serverless-apps-with-firebase-cloud-functions--cms-28557"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28557/preview_image/popo.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Serverless Apps With Firebase Cloud Functions</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28396/preview_image/RxJava-2.0-reactive-programming-operators.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Reactive Programming Operators in RxJava 2</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul> 2017-06-08T10:43:31.000Z 2017-06-08T10:43:31.000Z Jessica Thornsby tag:code.tutsplus.com,2005:PostPresenter/cms-28931 Google I/O 2017 Aftermath: What's New for Android Wear? <p>In this series of tips, we’ve been taking a closer look at some of the new Android features and tools announced at this year’s Google I/O.</p><p>In this post, we’re going to be focusing on Android Wear. <br></p><p>Google has been providing Android Wear UI components via a dedicated Wearable Support Library for a while now, but this is all about to change! </p><p>At this year’s event, Google announced that the various components that make up the Wearable Support Library are going to be deprecated, merged, or migrated into the Android Support Library. In this article, we’ll be taking a look at which components are going to be merged, moved and removed, and how you can start using the Android Support Library’s new Wear module <em>today</em>. </p><p>We’ll also be looking at some new tools that are designed to make it easier to work with Android Wear’s Complications API.</p><h2>New Android Wear UI Library </h2><p>At this year’s Google I/O, the Android Wear team announced that the bulk of the Wearable Support Library is moving to the Android Support Library. The Wear-specific components will form the basis of a new support-wear module, similar to other modules in the Android Support Library, such as <code class="inline">support-recylerview</code> and <code class="inline">support-design</code>. </p><p>According to the Android Wear sessions at Google I/O, we can expect this new Wear module to graduate out of beta at the same time as Android O officially launches.</p><p>However, not <em>all</em> components from the Wearable Support Library will be making the move to the Android Support Library. Google also announced that some components from the Wearable Support Library will be:</p><ul> <li><p><strong>Merged. </strong>Components that are applicable to both wearable and handheld devices will be merged into either the Android framework or more generic support modules. Components that are due to be merged include <code class="inline">CircledImageView</code>, <code class="inline">DelayedConfirmationView</code>, and <code class="inline">ActionButton</code>.</p></li> <li><p><strong>Deprecated. </strong>Google is going to deprecate the Android Wear UI components associated with design patterns that haven’t proven popular with Android Wear users. Specifically, Google will remove the two-dimensional spatial model that allowed Android Wear users to move horizontally and vertically, and will replace it with a vertical <code class="inline">LinearLayout</code>. All of the classes associated with the two-dimensional spatial model will be deprecated, including <code class="inline">GridViewPager</code>, action buttons, and action layouts.</p></li> </ul><p>Although this migration is an ongoing process, Google has already integrated some Android Wear components into version 26.0.0 Beta1 of the Android Support Library.</p><ul> <li><p><strong><code class="inline">BoxInsetLayout</code>:</strong> This is a screen shape-aware <code class="inline">FrameLayout</code> that can help you design a single layout that works for both square and round watch faces. When your layout is displayed on a round screen, a <code class="inline">BoxInsetLayout</code> will box all its children into an imaginary square in the center of the circular screen. You can specify how your UI elements will be positioned in this center square, using the <code class="inline">layout_box</code> attribute. When your app is displayed on a square screen, Android ignores the <code class="inline">layout_box</code> attribute and uses a window inset of zero, so your views will be positioned as though they’re inside a regular <code class="inline">FrameLayout</code>.</p></li> <li><p><strong><code class="inline">SwipeDismissFrameLayout</code>: </strong>This is a layout that you can use to implement custom interactions for your <code class="inline">View</code>s and fragments. You’ll generally use <code class="inline">SwipeDismissFrameLayout</code> to enable users to dismiss views and fragments by swiping onscreen, essentially replicating the functionality of the <strong>Back</strong> button found on Android smartphones and tablets.</p></li> <li><p><strong><code class="inline">WearableRecyclerView</code>: </strong>This is a Wearable-specific implementation of <code class="inline">RecyclerView</code> that helps you design more effective layouts for round displays. The <code class="inline">WearableRecyclerView</code> makes more effective use of the curvature of a round screen, and is typically used for implementing curved lists. <code class="inline">WearableRecyclerView</code> also gives you the option to use circular scrolling gestures in your app, via its <code class="inline">setCircularScrollingGestureEnabled()</code> method.</p></li> </ul><h3>Adding the New Android Wear Module </h3><p>To start using the new Android Wear module, you’ll need to have Android Support Library 26.0.0 Beta1 installed—which leads us on to another Google I/O announcement.</p><p>At this year’s event, Google announced that it would be distributing all upcoming versions of the Android Support Library (26.0.0 Beta1 and higher) via the Google Maven repository <em>only</em>.</p><p>Downloading the Android Support Library from this repository simply requires you to add the Google Maven Repository to your <strong>build.gradle</strong> file: </p><pre class="brush: xml noskimlinks noskimwords">repositories { maven { url 'https://maven.google.com' } jcenter() }</pre><p>You can then set up your compile dependencies as usual, so open your wearable module’s <strong>build.gradle</strong> file and add the Wear library as a project dependency:</p><pre class="brush: xml noskimlinks noskimwords">dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) //Add the following// compile 'com.android.support:wear:26.0.0-beta1'</pre><p>To add a component from the Android Wear UI library to your UI, simply open the layout resource file and make sure you use the new, fully-qualified package name. Essentially, this means replacing <code class="inline">android.support.wearable.view</code> with <code class="inline">android.support.wear.widget</code>. For example, here I’m using the <code class="inline">BoxInsetLayout</code> class from the Android Support Library:</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <android.support.wear.widget.BoxInsetLayout http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/dark_grey" android:padding="@dimen/box_inset_layout_padding" tools:context="com.jessicathornsby.myapplication.MainActivity" tools:deviceIds="wear"> <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/inner_frame_layout_padding" app:layout_box="all"> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hi World" /> </FrameLayout> </android.support.wear.widget.BoxInsetLayout></pre><p>To import this class into your Java file, you just need to use the same name, so the old:</p><pre class="brush: java noskimlinks noskimwords">import android.support.wearable.view.BoxInsetLayout;</pre><p>Becomes the new:</p><pre class="brush: java noskimlinks noskimwords">import android.support.wear.widget.BoxInsetLayout;</pre><h2>Easier Integration With the Complications API </h2><p>Android Wear users can choose from a huge variety of styles of watch faces, and although the Complications API does give watch faces complete control over how they draw this data, this flexibility can make it difficult to add complications support to your watch faces. </p><p>At this year’s Google I/O, the Android Wear team introduced some additions that should make it easier to work with the Complication API.</p><h4><strong>ComplicationDrawable</strong></h4><p><code class="inline">ComplicationDrawable</code> is a new solution that promises to handle all of your complication’s styling and layout for you. </p><p>If you create a <code class="inline">ComplicationDrawable</code> but don't set any style parameters, then you'll get a default look, but you can also use the <code class="inline">ComplicationDrawable</code> to style every part of your complication, including its background colour, corner radius, and border. </p><p>If your project targets API 24 or higher, then you can define a <code class="inline">ComplicationDrawable</code> object by creating a dedicated layout resource file in your project’s <strong>/res/drawable</strong> folder. </p><p>Open your XML file, and then create a <code class="inline">ComplicationDrawable</code> using the following tags: </p><pre class="brush: xml noskimlinks noskimwords"><android.support.wearable.complications.rendering.ComplicationDrawable ... ... ... <ambient //Define the attributes you want to use when the device is in ambient mode// /> </android.support.wearable.complications.rendering.ComplicationDrawable></pre><p>Note that attributes defined at the top level apply to both standard and ambient modes, unless you specifically override these attributes in the file’s <code class="inline"><ambient></code> section.</p><p>You then need to pass the complication data to your drawable: </p><pre class="brush: java noskimlinks noskimwords">@Override public void onComplicationDataUpdate(int id, ComplicationData data) { myComplicationDrawable.setComplicationData(data); }</pre><p>And finally, draw your complication by calling <code class="inline">setBounds</code> on your drawable:</p><pre class="brush: java noskimlinks noskimwords">@Override public void onDraw(Canvas canvas, Rect bounds) { if(haveChanged(bounds)) { myComplicationDrawable.setBounds( complicationBoundsWithin(bounds)); } //Call draw on the ComplicationDrawable// myComplicationDrawable.draw(canvas, currentTimeMillis); ... ... ... }</pre><h4><strong>TextRenderer</strong></h4><p>Most complications include some form of text, and <code class="inline">TextRenderer</code> is a new class that makes a number of small but powerful adjustments to the way complication text is drawn on the canvas.</p><p>You can use <code class="inline">TextRenderer</code> to specify the bounds that your complication text has to work with, and <code class="inline">TextRenderer</code> will then resize the text or arrange it over several lines, in order to fit this area. In addition, when the screen enters Android Wear’s “always on” ambient mode, <code class="inline">TextRenderer</code> adjusts your text by hiding characters and styling that are not suitable for this mode. </p><p>To take advantage of this new class, you need to create a <code class="inline">TextRenderer</code> when you initialize your watch face, and then pass it the <code class="inline">TextPaint</code> you want to use, which defines style attributes such as the font and text colour:</p><pre class="brush: java noskimlinks noskimwords">@Override public void onCreate(SurfaceHolder holder) { ... ... ... myTextRenderer = new TextRenderer(); myTextRenderer.setPaint(myTextPaint(TextPaint);</pre><p>You need to create a <code class="inline">TextRenderer</code> for each field, so you’ll also need to create a <code class="inline">TextRenderer</code> for your title text:</p><pre class="brush: java noskimlinks noskimwords">myTitleRenderer = new TextRenderer(); myTitleRenderer.setPaint(myTitlePaint); ... ... ... }</pre><p>When it’s time to draw, you’ll need to set the text on the renderer by calling <code class="inline">setText</code>, and then retrieve the text by calling <code class="inline">getText</code>: </p><pre class="brush: java noskimlinks noskimwords">public void onDraw(Canvas canvas, Rect bounds) { ... ... ... myTextRenderer.setText(myComplicationText.getText( Context, data.getShortText(), currentTimeMillis)); myTextRenderer.draw(canvas, bounds); ... ... ... } </pre><p>Note that many complications are time-dependent, which is why <code class="inline">currentTimeMillis</code> is included in the above code snippet.</p><h2>Conclusion</h2><p>In this article, we looked at how to add the new Android Wear UI Library to your project, and how you can start working with a number of components from this library today. We also examined two components that promise to make integrating with Android Wear’s Complications API much easier than it’s previously been.</p><p>In the next instalment, we’ll be getting a preview of the up-and-coming features in Android 3.0, by exploring the latest Android Studio Canary build.</p><p>In the meantime, check out some of our other tutorials and our video courses on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-a-voice-controlled-android-app"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/1038/preview_image/voice400.png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Create a Voice-Controlled Android App</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/serverless-apps-with-firebase-cloud-functions--cms-28557"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28557/preview_image/popo.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Serverless Apps With Firebase Cloud Functions</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28396/preview_image/RxJava-2.0-reactive-programming-operators.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Reactive Programming Operators in RxJava 2</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul> 2017-06-05T10:00:00.000Z 2017-06-05T10:00:00.000Z Jessica Thornsby tag:code.tutsplus.com,2005:PostPresenter/cms-28930 Google I/O 2017 Aftermath: Building Lifecycle-Aware Components <p>As usual, this year’s Google I/O saw plenty of Android-related announcements.</p><p>In this series of quick tips, we’re going to take a closer look at some of the software updates and new releases you can get your hands on <em>today</em>. </p><p>In this first post, we’re going to look at a collection of libraries that aims to take the pain out of lifecycle management, by giving you a way to build lifecycle-aware components that can track and react to lifecycle events automatically. I’ll also be providing a brief introduction to two other components that have been designed to use with these new lifecycle-aware components: LiveData and Room.</p><h2>LifecycleOwner and LifecycleObserver</h2><p>Respecting the lifecycle of your <code class="inline">Activity</code>s and <code class="inline">Fragment</code>s is <em>crucial</em> to creating a successful app. Get these fundamentals wrong, and you’re going to wind up with memory leaks that cause your app to lag, and potentially even crash.</p><p>Another recurring problem you may encounter with lifecycle management is attempting to update your app’s UI when the activity or fragment isn’t in a valid state. For example, if an <code class="inline">Activity</code> receives a callback after it’s been stopped, then it’s pretty likely that your app is going to crash. </p><p>To help you avoid all the headaches that come with lifecycle management, Google has announced a new set of lifecycle-aware components that can track the lifecycle of an activity or fragment, and adjust their behaviour accordingly.</p><p>You can access these Android Architecture Components via Google’s Maven repository today. However, they are still in alpha, so you should expect some breaking changes before the 1.0 release. </p><p>In particular, the <code class="inline">Fragment</code> and <code class="inline">AppCompatActivity</code> classes currently cannot implement the new <code class="inline">LifecycleOwner</code> interface. You'll need to use the temporary <code class="inline">LifecycleActivity</code> and <code class="inline">LifecycleFragment</code> classes until the Android Architecture Components reach their 1.0 release. These classes will be deprecated as soon as Android’s fragments and Activities have been updated to support the lifecycle components.</p><p>To start experimenting with these components, you’ll need to add the Google Maven repository to your project-level <strong>build.gradle</strong> file:</p><pre class="brush: xml noskimlinks noskimwords">allprojects { repositories { jcenter() //Add the Google Maven repository// maven { url 'https://maven.google.com' } } }</pre><p>Then, open your module-level <strong>build.gradle</strong> file, and add the following:</p><pre class="brush: xml noskimlinks noskimwords">dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile "android.arch.lifecycle:runtime:1.0.0-alpha1" compile "android.arch.lifecycle:extensions:1.0.0-alpha1" annotationProcessor "android.arch.lifecycle:compiler:1.0.0-alpha1"</pre><p>There are a few Android Architecture Components, but in this article we’re just going to focus on the following two:</p><ul> <li> <strong><code class="inline">LifecycleOwner</code>: </strong>This is something that has a lifecycle, such as an <code class="inline">Activity</code> or <code class="inline">Fragment</code>.</li> <li> <strong><code class="inline">LifecycleObserver</code>: </strong>This is a class that can monitor a component's lifecycle status via annotated methods. These methods are called whenever the associated component enters the corresponding lifecycle state.</li> </ul><p>By moving the code that monitors and reacts to lifecycle events into a separate <code class="inline">LifecycleObserver</code>, you can prevent your activity or fragment’s lifecycle-related methods (such as <code class="inline">onStart</code> and <code class="inline">onStop</code>) from ballooning out of control, making your code much more human-readable.</p><p>In the following example, we’re implementing <code class="inline">LifecycleObserver</code>, and then using the <code class="inline">@OnLifeCycleEvent</code> to react to various lifecycle events:</p><pre class="brush: java noskimlinks noskimwords">import android.arch.lifecycle.Lifecycle; import android.arch.lifecycle.LifecycleObserver; import android.arch.lifecycle.OnLifecycleEvent; public class SecondActivity implements LifecycleObserver { ... ... ... lifecycle.addObserver(this); } @OnLifecycleEvent(Lifecycle.Event.ON_START) void start() { //When the Activity enters an ON_START state, do something// } @OnLifecycleEvent(Lifecycle.Event.ON_STOP) void stop() { //When the Activity enters an ON_STOP state, do something// } //When the Activity is destroyed, unregister the LifecycleObserver// @OnLifecycleEvent(Lifecycle.Event.ON_DESTORY) void cleanup() { lifecycle.removeObserver(this); } }</pre><p>Then, in the <code class="inline">Activity</code> you want to monitor, extend <code class="inline">LifecycleActivity</code> to get access to the <code class="inline">LifecycleObserver</code> information:</p><pre class="brush: java noskimlinks noskimwords">public class MainActivity extends LifecycleActivity {</pre><p>Many operations can only be performed when a fragment or activity is in a specific state. You can use <code class="inline">lifecycle.getState</code> to quickly and easily check the component’s current state, and then only perform the action if the component is in the correct state:</p><pre class="brush: java noskimlinks noskimwords">if (lifecycle.getState().isAtLeast(STARTED)) {</pre><h2><code class="inline">LiveData</code></h2><p><a href="https://developer.android.com/topic/libraries/architecture/livedata.html" rel="external" target="_blank"><code class="inline">LiveData</code></a> is an observable data holder that exposes a stream of events that you can observe.</p><p>The key difference between <code class="inline">LiveData</code> and other observables, such as RxJava, is that <code class="inline">LiveData</code> is aware of the Android lifecycle. <code class="inline">LiveData</code> respects the lifecycle state of your Activities, fragments, and services, and will manage subscriptions for you.</p><p>Crucially, if an observer’s lifecycle is inactive, then the observer won’t be notified about changes to the <code class="inline">LiveData</code>, preventing application crashes that can occur when you try to push updates to stopped components.</p><p>To use <code class="inline">LiveData</code>, you just need to tell your <code class="inline">Activity</code> that you want to observe some data within the lifecycle:</p><pre class="brush: java noskimlinks noskimwords">public class MyActivity extends LifecycleActivity { public void onCreate(Bundle savedState) { LiveData<User> userData; //Get user data from somewhere// userData.observe(this, user -> { }); } }</pre><p>As soon as the activity starts, it’ll begin observing the <code class="inline">LiveData</code>, and your observer will receive an update whenever the value of that <code class="inline">LiveData</code> changes. If the <code class="inline">Activity</code> is destroyed, then the subscription will be removed automatically.</p><p>If an <code class="inline">Activity</code> is stopped due to a configuration change, then the new instance of that <code class="inline">Activity</code> will receive the last available value from the <code class="inline">LiveData</code>.</p><p><code class="inline">LiveData</code> does share some similarities with RxJava, but the official word from Google I/O is that if you’re familiar with RxJava, then you should start your Android projects with <code class="inline">LiveData</code>, as it’s designed to be simple, fast and lightweight, and integrates well with the Android framework. You can then add RxJava features if you need <a href="https://code.tutsplus.com/tutorials/getting-started-with-rxjava-20-for-android--cms-28345">additional reactive programming functionality</a>.</p><p>If you do want to use <code class="inline">LiveData</code> with the RxJava 2 library, then open your module-level <strong>build.gradle</strong> file and add the following:</p><pre class="brush: java noskimlinks noskimwords">compile "android.arch.lifecycle:reactivestreams:1.0.0-alpha1" </pre><p>You’ll then be able to use the following methods: </p><ul><li><p><strong><code class="inline">toPublisher</code>: </strong>Adapts the <code class="inline">LiveData</code> stream to a ReactiveStreams <code class="inline">Publisher</code>. </p></li></ul><pre class="brush: java noskimlinks noskimwords">public static <T> Publisher<T> toPublisher( final LifecycleOwner lifecycle, final LiveData<T> liveData) { </pre><ul><li><p><strong><code class="inline">fromPublisher</code>: </strong>Creates an observable <code class="inline">LiveData</code> stream from a ReactiveStreams publisher. </p></li></ul><pre class="brush: java noskimlinks noskimwords">public static <T> LiveData<T> fromPublisher(final Publisher<T> publisher)</pre><h2>The Room Library</h2><p>Although the Android framework has built-in support for working with raw SQL content, these APIs are fairly low-level and time-consuming to implement.</p><p>Google’s new <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="external" target="_blank">Room library</a> promises to abstract away some of the underlying implementation details of working with raw SQL tables and queries. It should also help reduce the amount of boilerplate code you need to write in order to convert SQL queries into Java data objects, and it features a <code class="inline">Migration</code> class that you can use to update your app without losing the user’s data. </p><p>To use Room, open your module-level <strong>build.gradle</strong> file and add the following to the <code class="inline">dependencies</code> section:</p><pre class="brush: xml noskimlinks noskimwords">compile "android.arch.persistence.room:runtime:1.0.0-alpha1" annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha1" </pre><p>When performing queries, you'll typically want your UI to update automatically whenever the data changes; with Room, you can achieve this by using a return value type of <code class="inline">LiveData</code>.</p><p>Finally, if you’re using RxJava, then your Room queries can also return RxJava 2’s <code class="inline">Publisher</code> and <code class="inline">Flowable</code> objects. To use RxJava with Room, you’ll need to open your module-level <strong>build.gradle</strong> file and add the following to the <code class="inline">dependencies</code> section:</p><pre class="brush: xml noskimlinks noskimwords">compile 'android.arch.persistence.room:rxjava2:1.0.0-alpha1' </pre><h2>Conclusion</h2><p>In this quick tip, I showed you how to manage the Android lifecycle, using LifecycleOwner and LifecycleObserver, and introduced you to two additional components you may want to use alongside the Lifecycle project. </p><p>In the next tip, we’re going to look at Google’s plans to merge Android Wear UI components with the Android Support Library, as well as some additions to Android Wear complications. </p><p>In the meantime, check out some of our other tutorials and our video courses on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/courses/create-a-voice-controlled-android-app"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/71/courses/1038/preview_image/voice400.png"><div class="roundup-block__primary-category topic-code">Android</div> <div class="roundup-block__content-title">Create a Voice-Controlled Android App</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/serverless-apps-with-firebase-cloud-functions--cms-28557"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28557/preview_image/popo.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Serverless Apps With Firebase Cloud Functions</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28396/preview_image/RxJava-2.0-reactive-programming-operators.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Reactive Programming Operators in RxJava 2</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul><p></p> 2017-06-01T10:00:00.000Z 2017-06-01T10:00:00.000Z Jessica Thornsby tag:code.tutsplus.com,2005:PostPresenter/cms-28787 Ensure High-Quality Android Code With Static Analysis Tools <p>In today's tutorial, we'll learn about how to ensure high-quality Android code in our projects using some static code analysis tools for Java. We'll look at Checkstyle, FindBugs, PMD, and Android Studio Lint—all of them free and open source!</p><h2>What Are Static Code Analysis Tools?<br> </h2><p>These are tools that parse and analyse your source code without actually executing it. The goal is to find potential vulnerabilities such as bugs and security flaws. A popular free static code analyser such as FindBugs checks your code against a set of rules which your code should adhere to—if the code doesn't follow these rules, it's a sign that something may be wrong. Think of static code analysis tools as an additional compiler that is run before the final compilation into the system language. </p><p>Many software companies are requiring projects to pass static code analysis tests, in addition to doing code reviews and unit testing in the build process. Even maintainers of open-source projects often include one or more static code analysis steps in the build process. So learning about static analysis is an important step in writing quality code. Be aware that static code analysis—also known as "white-box" testing—should not be seen as a replacement for unit testing of your source code.</p><p>In this tutorial, we're going to learn about some popular static analysis tools that are available for Android and Java. But first, let's see some of the benefits of using static analysis.</p><h3>Benefits</h3><ul> <li>Helps detect potential bugs that even unit or manual testing might have missed.</li> <li>Defines project-specific rules. For example, static analysis as part of the build chain helps newcomers get up to speed with the code standards of their new team.</li> <li>Helps you improve your knowledge of a new language.</li> <li>Scans your whole project, including files that you might not have ever read.</li> </ul><h3>Setup</h3><p>All the code analysis tools we'll learn about in this tutorial are available as Gradle plugins, so we can create individual Gradle tasks for each of them. Let's use a single Gradle file that will include them all. But before that, let's create a folder that will contain all of our files for the static code analysis. </p><p>Open Android Studio and inside the app module (in <strong>Project </strong>view), create a new folder and name it <strong>code_quality_tools</strong>. This folder will contain the XML files for the code analysis tools, and it will also have a Gradle file, <strong>quality.gradle</strong>, which will run our static analysis tasks. </p><figure class="post_image"><img alt="Android studio project structure screenshot" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/image/t666.png"></figure><p>Finally, visit your <strong>build.gradle</strong> in the app module folder and include this line at the end of the file:</p><pre class="brush: groovy noskimlinks noskimwords">apply from: '/code_quality_tools/quality.gradle'</pre><p>Here, our <strong>quality.</strong><strong>gradle</strong> Gradle script is <a href="https://docs.gradle.org/current/userguide/plugins.html#sec:using_plugins" rel="external" target="_blank">being applied</a> with a reference to its local file location. </p><h2>Checkstyle</h2><p>Given rules you specify in an XML file to enforce a coding standard for your project, <a href="http://checkstyle.sourceforge.net/" rel="external" target="_blank">Checkstyle</a> enforces those rules by analysing your source code and compares them against known coding standards or conventions. </p><p>Checkstyle is an <a href="https://github.com/checkstyle/checkstyle" rel="external" target="_blank">open-source tool</a> that is actively maintained by the community. This means you can create your own custom checks or modify existing ones to suit your needs. For example, Checkstyle can run a check on the constant names (final, static, or both) in your classes. If your constant names do not stick to a rule of being in uppercase with words separated by an underscore, the problem will be flagged in the final report. </p><pre class="brush: java noskimlinks noskimwords">// incorrect private final static String myConstant = "myConstant"; // correct private final static String MY_CONSTANT = "myConstant";</pre><h4>Integrating Checkstyle</h4><p>I'll show you how to integrate Checkstyle into our Android Studio project and demonstrate a practical example.</p><p>First, we need to create our coding rules. Inside <strong>checkstyle</strong><strong>.</strong><strong>xml</strong>, we create some Checkstyle configuration rules that will be run against our code.</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0"?><!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> <module name="Checker"> <module name="FileTabCharacter"/> <module name="TreeWalker"> <!-- Checks for Naming Conventions --> <!-- See http://checkstyle.sourceforge.net/config_naming.html --> <module name="MethodName"/> <module name="ConstantName"/> <!-- Checks for Imports --> <!-- See http://checkstyle.sourceforge.net/config_imports.html--> <module name="AvoidStarImport"/> <module name="UnusedImports"/> <!-- Checks for Size --> <!-- See http://checkstyle.sourceforge.net/config_sizes --> <module name="ParameterNumber"> <property name="max" value="6"/> </module> <!-- other rules ignored for brevity --> </module></pre><p>In the above code, we include the rules or checks we want Checkstyle to validate in our source code. One rule is <a href="http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport" rel="external" target="_blank">AvoidStarImport</a> which, as the name says, checks if your source code included an import statement like <code class="inline">java.util.*</code>. (Instead, you should explicitly specify the package to import, e.g. <code class="inline">java.util.Observable</code>.) </p><p>Some rules have properties, which we can set just like we did for <a href="http://checkstyle.sourceforge.net/config_sizes.html#ParameterNumber" rel="external" target="_blank">ParameterNumber</a>—this limits the number of parameters of a method or constructor. By default, the property <code class="inline">max</code> is 7, but we changed it to 6 instead. Take a look at some of the <a href="http://checkstyle.sourceforge.net/checks.html" rel="external" target="_blank">other checks on the Checkstyle website</a>.</p><p>To run this check, we need to <a href="https://docs.gradle.org/current/userguide/tutorial_using_tasks.html" rel="external" target="_blank">create a Gradle task</a>. So visit the <strong>quality.gradle </strong>file and create a task called checkstyle:</p><pre class="brush: groovy noskimlinks noskimwords">apply plugin: 'checkstyle' task checkstyle(type: Checkstyle) { description 'Check code standard' group 'verification' configFile file('./code_quality_tools/checkstyle.xml') source 'src' include '**/*.java' exclude '**/gen/**' classpath = files() ignoreFailures = false }</pre><p>Notice that in the code above, we first applied the <a href="https://docs.gradle.org/current/userguide/checkstyle_plugin.html" rel="external" target="_blank">Checkstyle Gradle plugin</a>. We gave it a description and added it to an already predefined Gradle group called verification. </p><p>The key <a href="https://docs.gradle.org/3.5/dsl/org.gradle.api.plugins.quality.Checkstyle.html" rel="external" target="_blank">properties of the Checkstyle </a><a href="https://docs.gradle.org/3.5/dsl/org.gradle.api.plugins.quality.Checkstyle.html" rel="external" target="_blank">Gradle</a><a href="https://docs.gradle.org/3.5/dsl/org.gradle.api.plugins.quality.Checkstyle.html" rel="external" target="_blank"> task</a> we are concerned with are: </p><ul> <li> <strong>configFile</strong>: the Checkstyle configuration file to use.<br> </li> <li> <strong>IgnoreFailures</strong>: whether or not to allow the build to continue if there are warnings.</li> <li> <strong>include</strong>: the set of include patterns.</li> <li> <strong>exclude</strong>: the set of exclude patterns. In this case, we don't scan generated classes. </li> </ul><p>Finally, you can run the Gradle script by visiting the Gradle tool window on Android Studio, opening the <strong>verification</strong> group, and then clicking on <strong>checkstyle</strong> to run the task. </p><figure class="post_image"><img alt="Gradle toolbar open to run checkstyle task" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/image/g77.png"></figure><p>Another way is to use the command line: </p><pre class="brush: plain noskimlinks noskimwords">gradle checkstyle</pre><p>After the task has finished running, a report will be generated, which is available at <strong>app module > build > reports > checkstyle</strong>. You can open <strong>checkstyle.html</strong> to view the report. </p><figure class="post_image"><img alt="Android Studio Checkstyle report folder location" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/image/vt.png"></figure><p>A <a href="https://plugins.jetbrains.com/plugin/1065-checkstyle-idea" rel="external" target="_blank">Checkstyle plugin</a> is freely available for Android Studio or IntelliJ IDEA. It offers real-time scanning of your Java files. </p><h2>PMD</h2><p><a href="https://pmd.github.io/" rel="external" target="_blank">PMD</a> is another open-source code analysis tool that analyzes your source code. It finds common flaws like unused variables, empty catch blocks, unnecessary object creation and so on. PMD has many <a href="http://pmd.sourceforge.net/pmd-4.3.0/rules/index.html" rel="external" target="_blank">rule sets</a> you can choose from. An example of a rule which is part of the <a href="http://pmd.sourceforge.net/pmd-4.3.0/rules/design.html" rel="external" target="_blank">Design Rules set</a> is:</p><ul><li> <code class="inline">SimplifyBooleanExpressions</code>: avoid unnecessary comparisons in boolean expressions which complicate simple code. An example: </li></ul><pre class="brush: java noskimlinks noskimwords">public class Bar { // can be simplified to // bar = isFoo(); private boolean bar = (isFoo() == true); public isFoo() { return false;} }</pre><p>PMD is configured with the <strong>pmd</strong><strong>.xml</strong> file. Inside it, we'll include some configuration rules such as the ones for <a href="http://pmd.sourceforge.net/pmd-4.3.0/rules/android.html" rel="external" target="_blank">Android</a>, <a href="http://pmd.sourceforge.net/pmd-4.3.0/rules/naming.html" rel="external" target="_blank">Naming</a>, and <a href="http://pmd.sourceforge.net/pmd-4.3.0/rules/design.html" rel="external" target="_blank">Design</a>. <br></p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0"?> <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Android Application Rules" xmlns="http://pmd.sf.net/ruleset/1.0.0" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"> <description>Custom ruleset for Android application</description> <exclude-pattern>.*/R.java</exclude-pattern> <exclude-pattern>.*/gen/.*</exclude-pattern> <!-- Android ---> <!-- http://pmd.sourceforge.net/pmd-4.3.0/rules/android.html --> <rule ref="rulesets/java/android.xml"/> <!-- Design --> <!-- http://pmd.sourceforge.net/pmd-4.3.0/rules/design.html --> <rule ref="rulesets/java/design.xml"> <exclude name="UncommentedEmptyMethod"/> </rule> <!-- Naming --> <!-- http://pmd.sourceforge.net/pmd-4.3.0/rules/naming.html --> <rule ref="rulesets/java/naming.xml/ShortClassName"> <properties> <property name="minimum" value="3"/> </properties> </rule> <!-- other rules ignored for brevity --> </ruleset></pre><p>As we did for Checkstyle, we also need to create a PMD Gradle task for the check to be executed inside the <strong>quality.gradle</strong> file. </p><pre class="brush: groovy noskimlinks noskimwords">apply plugin: 'pmd' task pmd(type: Pmd) { description 'Run PMD' group 'verification' ruleSetFiles = files("./code_quality_tools/pmd.xml") source 'src' include '**/*.java' exclude '**/gen/**' reports { xml.enabled = false html.enabled = true } ignoreFailures = false }</pre><p>PMD is also available as <a href="https://docs.gradle.org/current/userguide/pmd_plugin.html" rel="external" target="_blank">a </a><a href="https://docs.gradle.org/current/userguide/pmd_plugin.html" rel="external" target="_blank">Gradle</a><a href="https://docs.gradle.org/current/userguide/pmd_plugin.html" rel="external" target="_blank"> plugin</a>. </p><p>The key properties of the task we've created are: </p><ul> <li> <strong>ruleSetFiles</strong>: The custom rule set files to be used.<br> </li> <li> <strong>source</strong>: The source for this task.</li> <li> <strong>reports</strong>: The reports to be generated by this task.</li> </ul><p>Finally, you can run the Gradle script by visiting the Gradle tool window, opening the verification group folder, and then clicking on <strong>pmd </strong>to run the task. Or you can run it via the command line:</p><pre class="brush: plain noskimlinks noskimwords">gradle pmd</pre><p>A report will also be generated after the execution of the task which is available at <strong>app module > build > reports > pmd</strong>. There is also a <a href="https://plugins.jetbrains.com/plugin/1137-pmdplugin" rel="external" target="_blank">PMD plugin</a> available for IntelliJ or Android Studio for you to download and integrate if you want. </p><h2>FindBugs</h2><p><a href="http://findbugs.sourceforge.net/" rel="external" target="_blank">FindBugs</a> is another free static analysis tool which analyses your class looking for potential problems by checking your bytecodes against a <a href="http://findbugs.sourceforge.net/bugDescriptions.html" rel="external" target="_blank">known list of bug patterns</a>. Some of them are:</p><ul> <li> <strong>Class defines hashCode() but not equals()</strong>: A class implements the hashCode() method but not equals()—therefore two instances might be equal but not have the same hash codes. This falls under the bad practice category. </li> <li> <strong>Bad comparison of int value with long constant</strong>: The code is comparing an int value with a long constant that is outside the range of values that can be represented as an int value. This comparison is vacuous and possibly will yield an unexpected result. This falls under the correctness category. </li> <li> <strong>TestCase has no tests</strong>: class is a JUnit <code class="inline">TestCase</code> but has not implemented any test methods. This pattern is also under the correctness category. </li> </ul><p>FindBugs is an open-source project, so you can view, contribute or monitor the progress of the source code on <a href="https://github.com/findbugsproject/findbugs" rel="external" target="_blank">GitHub</a>. </p><p>In the <strong>findbugs-exclude.xml</strong> file, we want to prevent FindBugs from scanning some classes (using regular expressions) in our projects, such as auto-generated resource classes and auto-generated manifest classes. Also, if you use Dagger, we want FindBugs not to check the generated Dagger classes. We can also tell FindBugs to ignore some rules if we want. </p><pre class="brush: xml noskimlinks noskimwords"><FindBugsFilter> <!-- Do not check auto-generated resources classes --> <Match> <Class name="~.*R\$.*"/> </Match> <!-- Do not check auto-generated manifest classes --> <Match> <Class name="~.*Manifest\$.*"/> </Match> <!-- Do not check auto-generated classes (Dagger puts $ into class names) --> <Match> <Class name="~.*Dagger*.*"/> </Match> <!-- http://findbugs.sourceforge.net/bugDescriptions.html#ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD--> <Match> <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" /> </Match> </FindBugsFilter></pre><p>And finally, we'll include the <strong>findbugs</strong> task in <strong>quality.gradle</strong>:</p><pre class="brush: groovy noskimlinks noskimwords">apply plugin: 'findbugs' task findbugs(type: FindBugs) { description 'Run findbugs' group 'verification' classes = files("$project.buildDir/intermediates/classes") source 'src' classpath = files() effort 'max' reportLevel = "high" excludeFilter file('./code_quality_tools/findbugs-exclude.xml') reports { xml.enabled = false html.enabled = true } ignoreFailures = false }</pre><p>In the first line above, we applied FindBugs as a <a href="https://docs.gradle.org/current/userguide/findbugs_plugin.html" rel="external" target="_blank">Gradle Plugin</a> and then created a task called <code class="inline">findbugs</code>. The key properties of the <code class="inline">findbugs</code> task we are really concerned with are: </p><ul> <li> <strong><code class="inline">classes</code></strong>: the classes to be analyzed.<br> </li> <li> <strong><code class="inline">effort</code></strong>: the analysis effort level. The value specified should be one of <code>min</code>, <code>default</code>, or <code>max</code>. Be aware that higher levels increase precision and find more bugs at the cost of running time and memory consumption.</li> <li> <strong><code class="inline">reportLevel</code></strong>: the priority threshold for reporting bugs. If set to low, all bugs are reported. If set to medium (the default), medium and high priority bugs are reported. If set to high, only high priority bugs are reported.</li> <li> <strong><code class="inline">excludeFilter</code></strong>: the filename of a filter specifying bugs to exclude from being reported, which we have created already. </li> </ul><p>You can then run the Gradle script by visiting the Gradle tool window, opening the verification group folder, and then clicking on <strong>findbugs</strong> to run the task. Or launch it from the command line:</p><pre class="brush: plain noskimlinks noskimwords">gradle findbugs</pre><p>A report will also be generated when the task has finished executing. This will be available at <strong>app module > build > reports > findbugs</strong>. The <a href="https://plugins.jetbrains.com/plugin/3847-findbugs-idea" rel="external" target="_blank">FindBugs plugin</a> is another freely available plugin for download and integration with either IntelliJ IDEA or Android Studio.</p><h2>Android Lint</h2><p><a href="https://developer.android.com/studio/write/lint.html" rel="external" target="_blank">Lint</a> is another code analysis tool, but this one comes with Android Studio by default. It checks your Android project source files for potential bugs and optimizations for correctness, security, performance, usability, accessibility, and internationalization. </p><p>To configure Lint, you have to include the <code class="inline">lintOptions {}</code> block in your module-level <strong>build.gradle</strong> file:</p><pre class="brush: groovy noskimlinks noskimwords">lintOptions { abortOnError false quiet true lintConfig file('./code_quality_tools/lint.xml') }</pre><p>The key <a href="https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.LintOptions.html" rel="external" target="_blank">Lint options</a> we are concerned with are: <br></p><ul> <li> <strong><code class="inline">abortOnError</code></strong>: whether lint should set the exit code of the process if errors are found.</li> <li> <strong><code class="inline">quiet</code></strong>: whether to turn off analysis progress reporting.</li> <li> <strong><code class="inline">lintConfig</code></strong>: the default configuration file to use.</li> </ul><p>Your <strong>lint.xml</strong> file can include issues you want Lint to ignore or modify, such as the example below:</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="UTF-8"?> <lint> <!-- Disable the given check in this project --> <issue id="IconMissingDensityFolder" severity="ignore" /> <!-- Change the severity of hardcoded strings to "error" --> <issue id="HardcodedText" severity="error" /> </lint></pre><p>You can run Lint manually from Android Studio by clicking on the <strong>Analyze </strong>menu, choosing <strong>Inspect Code...</strong> (the inspection scope is the whole project), and then clicking on the <strong>OK</strong> button to proceed.</p><figure class="post_image"><img alt="Android studio inspect code menu " src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/image/ty.png"></figure><figure class="post_image"><img alt="Android Studio lint inspect whole project code dialog" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28787/image/bnbn.png"></figure><p>You can also run Lint by visiting the Gradle tool window, opening the <strong>verification</strong> group, and then clicking on <strong>lint</strong>. Finally, you can run it via the command line.<br></p><p>On Windows:</p><pre class="brush: plain noskimlinks noskimwords">gradlew lint</pre><p>On Linux or Mac:</p><pre class="brush: plain noskimlinks noskimwords">./gradlew lint</pre><p>A report will also be generated when the task has finished executing, which is available at <strong>app module > build > outputs > lint-results.html</strong>.</p><h2>Bonus: StrictMode</h2><p><a href="https://developer.android.com/reference/android/os/StrictMode.html" rel="external" target="_blank">StrictMode</a> is a developer tool that helps prevent developers of your project doing any accidental flash I/O or network I/O on the main thread, because this can lead to the app being sluggish or unresponsive. It also helps in preventing ANR (App Not Responding) dialogs from showing up. With StrictMode issues corrected, your app will become more responsive and the user will enjoy a smoother experience. StrictMode uses two sets of policies to enforce its rules:</p><ul> <li> <a href="https://developer.android.com/reference/android/os/StrictMode.VmPolicy.Builder.html" rel="external" target="_blank">VM Policies</a>: guards against bad coding practices such as not closing <code class="inline">SQLiteCursor</code> objects or any <a href="https://developer.android.com/reference/java/io/Closeable.html" rel="external" target="_blank"><code class="inline">Closeable</code></a> object that was created. </li> <li> <a href="https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html" rel="external" target="_blank">Thread </a><a href="https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy.Builder.html" rel="external" target="_blank">Policies</a>: looks out for operations such as flash I/O and network I/O being performed on the main application thread instead of on a background thread. </li> </ul><pre class="brush: java noskimlinks noskimwords">if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectNetwork() // or .detectAll() for all detectable problems .penaltyLog() // Log detected violations to the system log. .build()); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .detectLeakedClosableObjects() .penaltyLog() .penaltyDeath() // Crashes the whole process on violation. .build()); }</pre><p>The code above can be either in your Application, Activity, or other application component's <code class="inline">onCreate()</code> method. </p><p>You can learn more about <code class="inline">StrictMode</code> here on Envato Tuts+. </p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/android-best-practices-strictmode--mobile-7581"><img class="roundup-block__preview-image" src="https://cdn.tutsplus.com/mobile/uploads/legacy/Android-SDK_StrictMode/Android-Best-Practicies-Strict-Mode.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Android Best Practices: StrictMode</div> <div class="roundup-block__author">Shane Conder & Lauren Darcey</div></a></li></ul><p>A sample Android project implementing all of the above including rule sets of the tools for a typical Android project can be found in this post's <a href="https://github.com/tutsplus/ensure-high-quality-android-code-with-static-analysis-tools" target="_self">GitHub repo</a>.<br></p><h2>Conclusion</h2><p>In this tutorial, you learned about how to ensure high-quality Android code using static code analysis tools: what they are, benefits of using them, and how to use Checkstyle, FindBugs, Lint, PMD, and StrictMode in your application. Go ahead and give these tools a try—you might discover some problems in your code that you never expected.</p><p>In the meantime, check out some of our other courses and tutorials on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/rxjava-for-android-apps-introducing-rxbinding-and-rxlifecycle--cms-28565"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28565/preview_image/RxJava-RxAndroid-Introducing-RxBinding-and-RxLifecycle.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">RxJava 2 for Android Apps: RxBinding and RxLifecycle</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/start-developing-android-apps-with-kotlin-part-1--cms-27827"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/27827/preview_image/start-developing-android-apps-with-kotlin.jpg"><div class="roundup-block__primary-category topic-code">Android Studio</div> <div class="roundup-block__content-title">Coding Functional Android Apps in Kotlin: Getting Started</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/android-from-scratch-using-rest-apis--cms-27117"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/27117/preview_image/picGeneric.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Android From Scratch: Using REST APIs</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-create-an-android-chat-app-using-firebase--cms-27397"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/27397/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">How to Create an Android Chat App Using Firebase</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> </ul><p></p> 2017-05-30T18:59:57.000Z 2017-05-30T18:59:57.000Z Chike Mgbemena tag:code.tutsplus.com,2005:PostPresenter/cms-28811 How to Use Android O's Autofill Framework <p>Auto form fill, often shortened to just autofill, is a feature browsers have supported for years now. Most of us use it all the time. I, for one, find it indispensable during tasks such as filling out a registration form or completing a checkout process.<em></em></p><p>The latest release of Android, <a href="https://developer.android.com/preview/index.html" rel="external" target="_blank">Android O</a>, brings similar functionality to Android apps. In other words, Android can now help users fill out forms that belong to all the apps they have installed on their devices. This was a much-awaited feature because typing with a virtual keyboard on a small screen tends to be quite a hassle.</p><p>As an app developer, you can use the new Autofill Framework to create your own custom autofill service, a service that decides how to populate an app's input fields. In this tutorial, I'll show you how.</p><h2>Prerequisites</h2><p>To be able to follow this tutorial, you'll need:</p><ul> <li> <a href="https://developer.android.com/studio/preview/index.html" rel="external" target="_blank">Android Studio 2.4 Preview 7</a> or high<em></em>er</li> <li>An emulator or device running Android O or higher</li> </ul><h2> <span class="sectionnum">1.</span> Create a New Project</h2><p>Fire up Android Studio and create a new project with an empty activity. You must, of course, remember to choose <strong>Android 7+</strong> in the <strong>Target Android Devices</strong> dialog.</p><figure class="post_image"><img alt="Target android devices dialog" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/androidpreview.png" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/androidpreview.png"></figure><p>This project will need a few widgets that belong to the Design Support Library, so open the <code class="inline">app</code> module's <strong>build.gradle</strong> file and add the following <code class="inline">compile</code> dependency to it:</p><pre class="brush: groovy noskimlinks noskimwords">compile 'com.android.support:design:26.+'</pre><p>Lastly, press the <strong>Sync Now</strong> button to update the project.<br></p><h2> <span class="sectionnum">2.</span> Create a Settings Activity</h2><p>In this tutorial, we'll be creating an app containing a very simple autofill service that targets only those input fields where the user is expected to type in an email address. Because almost every other app on Google Play today asks for an email address, this service will be quite useful.</p><p>Our service obviously needs to know what the user's email addresses are. Therefore, let us now build an activity where the user can type in and save two email addresses.</p><h3>Step 1: Define the Layout</h3><p>As you might expect, the layout of the activity will contain two <code class="inline">EditText</code> widgets where the user can type in his or her email addresses. If you want it to adhere to the guidelines of Material Design, placing the <code class="inline">EditText</code> widgets inside <code class="inline">TextInputLayout</code> containers is a good idea.</p><p>Additionally, the layout must have a <code class="inline">Button</code> widget the user can press to save the email addresses.</p><p>You are free to place the widgets anywhere you want. Nevertheless, for now, I suggest you place them all inside a <code class="inline">LinearLayout</code> whose orientation is vertical.</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp"> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/primary" android:hint="Your primary email address" android:inputType="textEmailAddress"/> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/secondary" android:hint="Your other email address" android:inputType="textEmailAddress"/> </android.support.design.widget.TextInputLayout> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/save_button" style="@style/Widget.AppCompat.Button.Colored" android:text="Save" android:onClick="saveEmailAddresses"/> </LinearLayout></pre><p>In the above code, you can see that the <code class="inline">Button</code> widget has an <code class="inline">onClick</code> attribute pointing to a method. Click on the yellow light bulb beside this attribute in Android Studio to generate a stub for it in the associated <code class="inline">Activity</code> class.</p><pre class="brush: java noskimlinks noskimwords">public void saveEmailAddresses(View view) { // More code will be added here }</pre><h3>Step 2: Save the Email Addresses</h3><p>We'll be using a shared preferences file called <strong>EMAIL_STORAGE</strong> to save our data. You can use the <code class="inline">getSharedPreferences()</code> method of your <code class="inline">Activity</code> class to access the file. Additionally, to be able to write to the file, you must call its <code class="inline">edit()</code> method, which generates a <code class="inline">SharedPreferences.Editor</code> object.</p><p>Accordingly, add the following code inside the <code class="inline">saveEmailAddresses()</code> method:</p><pre class="brush: java noskimlinks noskimwords">SharedPreferences.Editor editor = getSharedPreferences("EMAIL_STORAGE", MODE_PRIVATE).edit();</pre><p>To fetch the email addresses the user has typed into the <code class="inline">EditText</code> widgets, you'll have to first get references to them using the <code class="inline">findViewById()</code> method, and then call their <code class="inline">getText()</code> methods.</p><pre class="brush: java noskimlinks noskimwords">String primaryEmailAddress = ((EditText)findViewById(R.id.primary)) .getText().toString(); String secondaryEmailAddress = ((EditText)findViewById(R.id.secondary)) .getText().toString();</pre><p>At this point, you can call the <code class="inline">putString()</code> method of the editor to add the email addresses to the preferences file as two key value pairs. After you do so, don't forget to call the <code class="inline">commit()</code> method to make your changes permanent.</p><pre class="brush: java noskimlinks noskimwords">editor.putString("PRIMARY_EMAIL", primaryEmailAddress); editor.putString("SECONDARY_EMAIL", secondaryEmailAddress); editor.commit();</pre><h3>Step 3: Create a Meta-Data File</h3><p>The settings activity we created in the previous step is currently just an ordinary activity. To let the Android platform know that it is a settings activity for an autofill service, we must create a meta-data XML file saying so.</p><p>Create a new XML file called <strong>email_address_filler.xml</strong> in the project's <strong>res/xml</strong> folder. Inside it, add an <code class="inline"><autofill-service></code> tag and set the value of its <code class="inline">settingsActivity</code> attribute to the name of your <code class="inline">Activity</code> class.</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <autofill-service xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="com.tutsplus.simplefill.MainActivity"/></pre><p>You can now run the app, type in two email addresses, and press the <strong>Save</strong> button to save them.</p><figure class="post_image"><img alt="Settings activity running" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/firstrun1.png" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/firstrun1.png"></figure><h2> <span class="sectionnum">3.</span> Create an Autofill Service</h2><p>Any class that extends the abstract <code class="inline">AutoFillService</code> class can serve as an autofill service. So start by creating a new Java class with <strong>File > New > Java Class</strong>. In the dialog that pops up, name the class <strong>EmailAddressFiller</strong> and make sure that you set the value of the <strong>Superclass</strong> field to <code class="inline">AutoFillService</code>.</p><figure class="post_image"><img alt="Create new class dialog" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/newclass.png" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/newclass.png"></figure><p>Android Studio will now prompt you to generate stubs for two abstract methods: <code class="inline">onSaveRequest()</code> and <code class="inline">onFillRequest()</code>. In this tutorial, we'll be focusing only the <code class="inline">onFillRequest()</code> method, which is automatically called whenever the user opens an activity—of any app—containing input fields.</p><pre class="brush: java noskimlinks noskimwords">@Override public void onFillRequest(AssistStructure assistStructure, Bundle bundle, CancellationSignal cancellationSignal, FillCallback fillCallback) { // More code goes here }</pre><h3>Step 1: Analyze View Hierarchies</h3><p>An autofill service needs to analyze an app's user interface and identify input fields it can fill. That's why the <code class="inline">onFillRequest()</code> method receives an <code class="inline">AssistStructure</code> object, which contains details about all the widgets that are currently visible on the screen. More precisely, it contains a tree of <code class="inline">ViewNode</code> objects. </p><p>If you've never seen such a tree, I suggest you use the <strong>uiautomatorviewer</strong> tool, which is part of the Android SDK, to analyze the layout hierarchies of a few apps. For example, here's what the layout hierarchy of Android's default mail app looks like:</p><figure class="post_image"><img alt="View hierarchy of default mail app" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/uiautom.png" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/uiautom.png"></figure><p>Naturally, to analyze all nodes of a tree, you need a recursive method. Let's create one now:</p><pre class="brush: java noskimlinks noskimwords">void identifyEmailFields(AssistStructure.ViewNode node, List<AssistStructure.ViewNode> emailFields) { // More code goes here }</pre><p>As you can see, this method has a <code class="inline">ViewNode</code> and a <code class="inline">List</code> as its parameters. We'll be using the <code class="inline">List</code> to store all the input fields that expect email addresses.</p><p>You might now be wondering how you can programmatically tell if an input field expects an email address. Well, there's really no foolproof approach you can follow. For now, we're going to assume that all app developers always give meaningful resource IDs to their input fields. Based on that assumption, we can simply pick all input fields whose resource IDs contain strings such as "email" and "username".</p><p>Accordingly, add the following code to the method:</p><pre class="brush: java noskimlinks noskimwords">if(node.getClassName().contains("EditText")) { String viewId = node.getIdEntry(); if(viewId!=null && (viewId.contains("email") || viewId.contains("username"))) { emailFields.add(node); return; } }</pre><p>Next, whenever we encounter a <code class="inline">ViewNode</code> object that contains more <code class="inline">ViewNode</code> objects, we must recursively call the <code class="inline">identifyEmailFields()</code> method to analyze all its children. The following code shows you how:</p><pre class="brush: java noskimlinks noskimwords">for(int i=0; i<node.getChildCount();i++) { identifyEmailFields(node.getChildAt(i), emailFields); }</pre><p>At this point, we can call the <code class="inline">identifyEmailFields()</code> method inside the <code class="inline">onFillRequest()</code> method and pass the root node of the view hierarchy to it.</p><pre class="brush: java noskimlinks noskimwords">// Create an empty list List<AssistStructure.ViewNode> emailFields = new ArrayList<>(); // Populate the list identifyEmailFields(assistStructure .getWindowNodeAt(0) .getRootViewNode(), emailFields);</pre><p>If our service is unable to identify any input fields for emails, it should do nothing. Therefore, add the following code to it:</p><pre class="brush: java noskimlinks noskimwords">if(emailFields.size() == 0) return;</pre><h3>Step 2: Create and Populate Remote Views</h3><p>If our service does identify an input field it can fill, it must populate a drop-down list that will be shown below the input field. Doing so, however, is not straightforward because neither the input field nor the drop-down list belongs to our app.</p><p>To populate the drop-down list, we must use <code class="inline">RemoteViews</code> objects. As its name suggests, a <code class="inline">RemoteViews</code> object is a collection of views that can be displayed in another app.</p><p>To initialize a <code class="inline">RemoteViews</code> object, you'll need a layout XML file. Let's create one now called <strong>email_suggestion.xml</strong>. For now, it can contain just one <code class="inline">TextView</code> widget to display an email address.</p><p>Accordingly, add the following code to <strong>email_suggestion.xml</strong>:</p><pre class="brush: xml noskimlinks noskimwords"><?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/email_suggestion_item" android:textSize="18sp" android:textStyle="bold" android:padding="5dp"> </TextView></pre><p>You can now go back to the <code class="inline">onFillRequest()</code> method and create two <code class="inline">RemoteViews</code> objects: one for the primary email, and another for the secondary.</p><pre class="brush: java noskimlinks noskimwords">RemoteViews rvPrimaryEmail = new RemoteViews(getPackageName(), R.layout.email_suggestion); RemoteViews rvSecondaryEmail = new RemoteViews(getPackageName(), R.layout.email_suggestion);</pre><p>The <code class="inline">TextView</code> widgets inside the <code class="inline">RemoteViews</code> objects must display the two email addresses we stored in a shared preferences file earlier. To open the file, use the <code class="inline">getSharedPreferences()</code> method again. Once it's opened, you can use its <code class="inline">getString()</code> method to fetch both the email addresses.</p><p>Finally, to set the contents of the remote <code class="inline">TextView</code> widgets, you must use the <code class="inline">setTextViewText()</code> method.</p><pre class="brush: java noskimlinks noskimwords">// Load the email addresses from preferences SharedPreferences sharedPreferences = getSharedPreferences("EMAIL_STORAGE", MODE_PRIVATE); String primaryEmail = sharedPreferences.getString("PRIMARY_EMAIL", ""); String secondaryEmail = sharedPreferences.getString("SECONDARY_EMAIL", ""); // Update remote TextViews rvPrimaryEmail.setTextViewText(R.id.email_suggestion_item, primaryEmail); rvSecondaryEmail.setTextViewText(R.id.email_suggestion_item, secondaryEmail);</pre><h3>Step 3: Create Data Sets</h3><p>We can now use the remote views to create autofill data sets that can be sent to any app. To keep this tutorial from getting too long, we'll be creating data sets only for the first email input field we encounter. The following code shows how to pick only the first email input field:</p><pre class="brush: java noskimlinks noskimwords">AssistStructure.ViewNode emailField = emailFields.get(0);</pre><p>An autofill data set is nothing but an instance of the <code class="inline">Dataset</code> class, and can be built using the <code class="inline">Dataset.Builder</code> class.</p><p>When the user selects one of the email addresses our service shows in the drop-down list, it must set the contents of the associated input field using the <code class="inline">setValue()</code> method of the <code class="inline">Dataset.Builder</code> class. However, you cannot pass a <code class="inline">ViewNode</code> object to the <code class="inline">setValue()</code> method. It actually expects an autofill identifier, which must be obtained by calling the <code class="inline">getAutoFillId()</code> method of the <code class="inline">ViewNode</code> object.</p><p>Additionally, to specify the text that must be written into the input field, you must use the <code class="inline">AutoFillValue.forText()</code> method. The following code shows you how:</p><pre class="brush: plain noskimlinks noskimwords">Dataset primaryEmailDataSet = new Dataset.Builder(rvPrimaryEmail) .setValue( emailField.getAutoFillId(), AutoFillValue.forText(primaryEmail) ).build(); Dataset secondaryEmailDataSet = new Dataset.Builder(rvSecondaryEmail) .setValue( emailField.getAutoFillId(), AutoFillValue.forText(secondaryEmail) ).build();</pre><p>Before you send the data sets to an app, you must add them to a <code class="inline">FillResponse</code> object, which can be built using the <code class="inline">FillResponse.Builder</code> class. Call its <code class="inline">addDataset()</code> method twice to add both the data sets.</p><p>Once the <code class="inline">FillResponse</code> object is ready, pass it as an argument to the <code class="inline">onSuccess()</code> method of the <code class="inline">FillCallback</code> object, which is one of the parameters of the <code class="inline">onFillRequest()</code> method.</p><pre class="brush: java noskimlinks noskimwords">FillResponse response = new FillResponse.Builder() .addDataset(primaryEmailDataSet) .addDataset(secondaryEmailDataSet) .build(); fillCallback.onSuccess(response);</pre><h3>Step 4: Update the Manifest</h3><p>Like all services, the autofill service too must be declared in the project's <strong>AndroidManifest.xml</strong> file. While doing so, you must make sure that it is protected by the <code class="inline">android.permission.BIND_AUTO_FILL</code> permission.</p><p>This service also needs an <code class="inline"><intent-filter></code> tag that allows it to respond to the <code class="inline">android.service.autofill.AutoFillService</code> action, and a <code class="inline"><meta-data></code> tag that points to the meta-data XML file we created in an earlier step.</p><p>Accordingly, add the following lines to your manifest file:</p><pre class="brush: xml noskimlinks noskimwords"><service android:name=".EmailAddressFiller" android:permission="android.permission.BIND_AUTO_FILL"> <meta-data android:name="android.autofill" android:resource="@xml/email_address_filler"/> <intent-filter> <action android:name="android.service.autofill.AutoFillService"/> </intent-filter> </service></pre><p>Our autofill service and app are now ready. Build the project and install the app on your device.</p><h2> <span class="sectionnum">4.</span> Activate and Use the Autofill Service</h2><p>To activate the autofill service, open your device's <strong>Settings</strong> app and navigate to <strong>Apps & Notifications > Advanced > Default apps > Autofill app</strong>. In the next screen, select your app from the list of available autofill apps.</p><figure class="post_image"><img alt="Autofill app selection screen" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/Screenshot_1494242581.png" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/Screenshot_1494242581.png"></figure><p>You can now open any app that asks for an email address to see your autofill service in action. For example, here's what you'd see on the login screens of Instagram and Pinterest:</p><figure class="post_image"><img alt="Autofill suggestions displayed for two popular apps" src="https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/twoapps1.jpg" title="Image: https://cms-assets.tutsplus.com/uploads/users/362/posts/28811/image/twoapps1.jpg"></figure><h2>Conclusion</h2><p>You now know how to create and use a custom autofill service for Android. Feel free to extend it to support other common fields, such as first name or phone number. You can also try identifying input fields using other attributes, such as labels and hints.</p><p>To learn more about the Autofill Framework, do refer to its <a href="https://developer.android.com/preview/features/autofill.html" rel="external" target="_blank" title="Link: https://developer.android.com/preview/features/autofill.html">official documentation</a>. And in the meantime, check out some of our other posts about Android O and Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/getting-started-with-rxjava-20-for-android--cms-28345"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/28345/preview_image/Getting-Started-RxJava-2.0-for-Android.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Get Started With RxJava 2 for Android</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/quick-tip-working-with-custom-fonts-in-android-o--cms-28625"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28625/preview_image/android-o-ui-updates.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Quick Tip: Working With Custom Fonts in Android O</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/articles/android-things-and-machine-learning--cms-28089"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/798/posts/28089/preview_image/androidthings.png"><div class="roundup-block__primary-category topic-code">Android Things</div> <div class="roundup-block__content-title">Android Things and Machine Learning</div> <div class="roundup-block__author">Paul Trebilcox-Ruiz</div></a></li> </ul><p></p> 2017-05-18T17:00:00.000Z 2017-05-18T17:00:00.000Z Ashraff Hathibelagal tag:code.tutsplus.com,2005:PostPresenter/cms-28706 How to Solve Android’s 13 Most Common Error Messages <p>Testing is a crucial part of Android development, allowing you to iron out all the bugs, errors and performance problems that may be lurking in your app, before you unleash it on the general public.</p><p>Every time you encounter an error, Android generates an error message, and then either displays that message as part of Android Studio’s <strong>Logcat Monitor</strong> or as a dialogue on the device you’re using to test your app.</p><p>These error messages are typically short and to the point, and at first glance may not seem all that helpful. However, these messages actually contain all the information you need to get your project back on track—you just need to know how to decipher them!</p><p>In this article, we’re going to take an in-depth look at the 13 error messages you’re most likely to encounter when developing <em>any</em> Android app. We’ll be scrutinising what each of these error messages <em>really</em> means, examining all the possible reasons why you might encounter each error and, most importantly, sharing step-by-step instructions on how you can resolve them. </p><h2>Spotting Error Messages</h2><p>There’s a wide range of error messages you may encounter when testing your app, ranging from severe errors that will cause your app to crash the very first time you try to install it on a target device to more subtle errors that degrade your application’s performance over time.</p><p>Depending on the kind of error you encounter, Android will display the error message either on the device you’re using to test your app or in Android Studio.</p><p>Spotting error messages that appear on a physical device or AVD is easy—you just need to be paying attention to any dialogues that appear on your device's screen! However, spotting errors that appear in Android Studio can be tricky, as the Logcat Monitor records a huge amount of information, making it easy to miss important error messages. </p><p>The easiest way to make sure you don’t miss out any error messages is to open Logcat Monitor’s <strong>Verbose</strong> dropdown and set it to <strong>Error</strong>, which will filter out everything except error messages.</p><p><img alt="Open Logcat Monitors dropdown and select Error" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-error-messages-logcat-monitor.jpg"><br></p><h3>1. R.layout.main Cannot Be Found / Cannot Resolve Symbol R<br> </h3><p>This error is caused when Android Studio can’t generate your <strong>R.java</strong> file correctly, and it can often crop up out of nowhere—one minute everything will be working fine, and the next minute every part of your project is failing to compile. To make matters worse, when Android Studio encounters the <code class="inline">R.layout</code> error, it’ll usually flag all your layout resource files as containing errors, which makes it difficult to know where to start looking for the source of the error.</p><p>Often, the most effective solution is the simplest: clean and rebuild your project. Select <strong>Build > Clean Project </strong>from the Android Studio toolbar, wait a few moments, and then build your project by selecting <strong>Build > Rebuild Project</strong>.</p><p>If a single clean/rebuild cycle doesn’t work, then try repeating this process a few times, as some developers have reported positive results after completing multiple clean/rebuild cycles in quick succession.</p><p>If you encounter this error after moving some files and directories around, then it’s possible that the <code class="inline">R.layout</code> error is being caused by a mismatch between Android Studio’s cache and your project’s current layout. If you suspect this may be the case, then select <strong>File > Invalidate Caches / Restart > Invalidate and Restart </strong>from Android Studio’s toolbar.</p><p>Issues with the names of your resources can also prevent the <strong>R.java</strong> file from being created correctly, so check that you don't have multiple resources with the same name and that none of your file names contain invalid characters. Android Studio only supports lowercase a-z, 0-9, full stops and underscores, and a single invalid character can cause an <code class="inline">R.layout</code> error across your entire project, even if you don’t actually <em>use</em> this resource anywhere in your project!</p><p>If you do identify and resolve an error, but Android Studio is still displaying the <code class="inline">R.layout</code> error, then you may need to complete a clean/rebuild cycle before Android Studio properly registers your changes.</p><h3>2. Too Many Field References….Max is 65,536</h3><p>When you compile your app, the APK contains executable bytecode files in the form of Dalvik Executable (DEX) bytecode files. The DEX specification states that a single DEX file can reference a maximum of 65,536 methods, and if you encounter the <strong>Too many fields…</strong> error then it means your app has gone over this limit. Note that this is a limitation on the number of methods your project <em>references</em>, and not the number of methods your project <em>defines</em>.</p><p>If you encounter this error, then you can either: </p><ul> <li>Reduce the number of references in your project. One of the most effective ways of trimming your method references is to review your application’s dependencies, as these are often one of the biggest contributors of method references.</li> <li>Configure your app to use more than one DEX file, by enabling multidex.</li> </ul><p>The process of enabling multidex support will vary depending on the versions of Android your project supports.</p><p>If you’re targeting Android 5.0 or higher, then the first step is opening your module-level build.gradle file and setting <code class="inline">multiDexEnabled</code> to <code class="inline">true</code>:</p><pre class="brush: xml noskimlinks noskimwords">android { defaultConfig { minSdkVersion 21 multiDexEnabled true</pre><p>However, if your <code class="inline">minSdkVersion</code> is 20 or lower, then you’ll need to add the <code class="inline">multiDexEnabled true</code> attribute and then add the multidex support library as a project dependency:</p><pre class="brush: xml noskimlinks noskimwords">dependencies { compile 'com.android.support:multidex:1.0.1' }</pre><p>The next step depends on whether or not you’re overriding the <code class="inline">Application</code> class.</p><p>If your project does override the <code class="inline">Application</code> class, then open your Manifest and add the following to the <code class="inline"><application></code> tag:</p><pre class="brush: xml noskimlinks noskimwords"><application android:name="android.support.multidex.MultiDexApplication" > ... ... ... </application></pre><p>If your project doesn’t override the <code class="inline">Application</code> class, then you’ll need to extend <code class="inline">MultiDexApplication</code> instead:</p><pre class="brush: java noskimlinks noskimwords">public class MyApplication extends MultiDexApplication</pre><p>Finally, if you do override the <code class="inline">Application</code> class but can’t change the base class, then you can enable multidex by overriding the <code class="inline">attachBaseContext()</code> method and calling <code class="inline">MultiDex.install(this)</code>, for example:</p><pre class="brush: java noskimlinks noskimwords">@Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); }</pre><h3>3. Please Choose a Valid JDK Directory</h3><p>If you’re getting a JDK error whenever you try to build your app, then it means Android Studio is struggling to find where the JDK is installed on your development machine.</p><p>To fix this error:</p><ul> <li>Select <strong>File > Project structure…</strong> from the Android Studio toolbar.</li> <li>Select <strong>SDK Location</strong> from the left-hand menu.</li> <li>Make sure the <strong>Use embedded JDK </strong>checkbox is selected.</li> </ul><figure class="post_image"><img alt="Navigate to File Project structure SDK Location and select the Use embedded JDK checkbox" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-error-jdk-location.jpg"></figure><p>If this doesn’t solve the problem, then navigate back to <strong>File > Project structure… > SDK Location</strong>, and manually enter the full file path for your JDK. If you’re not sure where the JDK is installed on your development machine, then you can find out by opening the Terminal (Mac) or Command Prompt (Windows) and entering the following command:<br></p><pre class="brush: bash noskimlinks noskimwords">/usr/libexec/java_home</pre><h3>4. Error Installing APK</h3><p>While AVDs are great for testing your app across a wide range of different hardware and software, you should always test your app on at least one physical Android smartphone or tablet. However, Android Studio’s ability to recognize a connected Android device is notoriously hit and miss.</p><p>If you’ve attached your device to your development machine but are encountering an <strong>Error installing APK</strong> message whenever you try to install your APK, or your device isn’t even appearing in the <strong>Select Deployment Target</strong> window, then try the following fixes:</p><h4><strong>Check USB debugging is enabled. </strong></h4><p>Open your device’s <strong>Settings</strong>, then select <strong>Developer Options</strong>, and make sure <strong>USB Debugging</strong> is enabled. If you don’t see <strong>Developer Options</strong> in the <strong>Settings</strong> menu, then select <strong>About Phone</strong> and keep tapping <strong>Build Number</strong> until a <strong>You are now a developer</strong> notification appears. Return to the main <strong>Settings</strong> screen, and you should find that <strong>Developer Options</strong> has been added.</p><h4> <strong>Check your smartphone or tablet’s screen.</strong> </h4><p>Sometimes your device may require some additional input before it connects to your development machine. For example, it may be asking you to choose between different modes, or to explicitly authorize the connection.</p><h4> <strong>Make sure you have the correct USB driver installed.</strong> </h4><p>If you're developing on Windows, then you’ll need to download the appropriate <a href="https://developer.android.com/studio/run/oem-usb.html#Drivers" rel="external" target="_blank">OEM USB driver</a> for your device. If you’re a Nexus user, then you can download the <strong>Google USB</strong> driver through Android Studio’s SDK Manager.</p><h4><strong>Check that your device meets your project’s minimum SDK requirements. </strong></h4><p>You’ll find your project’s minimum SDK in your module-level gradle.build file, and can check what version of Android is installed on your device by opening its <strong>Settings</strong> and swiping to the <strong>About Phone</strong> section.</p><h4> <strong>Try restarting your adb (Android Debug Bridge) process.</strong> </h4><p>Open a Terminal or Command Prompt window, and then change directory (<code class="inline">cd</code>), so it’s pointing at your <strong>platform-tools</strong> window, for example:</p><pre class="brush: bash noskimlinks noskimwords">cd /Users/Downloads/adt-bundle-mac/sdk/platform-tools</pre><p>Then, terminate and restart the adb process by entering the following commands, one after the other:</p><pre class="brush: bash noskimlinks noskimwords">./adb kill-server</pre><pre class="brush: bash noskimlinks noskimwords">./adb start-server</pre><h4><strong>Restart everything! </strong></h4><p>If all else fails, then try disconnecting and then reconnecting your device, restarting your device, restarting Android Studio and, as an absolute last resort, restarting your development machine.</p><h3>5. INSTALL_FAILED_INSUFFICIENT_STORAGE</h3><p>If you encounter this error when attempting to install your project, then it means the target device doesn’t have enough memory.</p><p>If you’re trying to install your project on an AVD, then you should check how much space you’ve assigned this particular AVD:</p><ul> <li>Launch the AVD Manager.</li> <li>Find the AVD in question, and click its accompanying <strong>Edit this AVD</strong> icon.</li> <li>In the window that appears, click <strong>Show Advanced Settings</strong>.</li> <li>Scroll to the <strong>Memory and Storage</strong> section.</li> </ul><p>This section lists the various types of memory you've allocated to this particular AVD. If any of these values are unusually low, then you should increase them to more closely reflect the memory that’s available to your typical Android smartphone or tablet:</p><ul> <li> <strong>RAM. </strong>The amount of RAM available to the emulated device.</li> <li> <strong>VM Heap.</strong> How much heap space (i.e. memory) is allocated to the Virtual Machine (VM) of the emulated smartphone or tablet.</li> <li> <strong>Internal Storage. </strong>The amount of non-removable memory available to the emulated device.</li> <li> <strong>SD card.</strong> The amount of removable memory available. If you want to use a virtual SD card that’s managed by Android Studio, then select <strong>Studio-managed</strong> and enter the size of the virtual SD card you want to create (the minimum recommended value is 100 MB). Alternatively, you can manage the SD card “space” in a file, by selecting <strong>External file</strong> and then specifying the location you want to use.</li> </ul><p>If there’s nothing odd about your AVD’s memory, or you’re trying to install your app on a physical Android smartphone or tablet, then this error usually means that your compiled app is simply too large. An application that takes a significant bite out of the device’s memory at install time is never going to go down well. </p><p>If you need to dramatically reduce the size of your APK, then try the following techniques: </p><ul><li><p>Use ProGuard to remove unused classes, fields, methods, and attributes. To enable ProGuard, open your module-level build.gradle file and add the following:</p></li></ul><pre class="brush: xml noskimlinks noskimwords">buildTypes { release { //Enable ProGuard// minifyEnabled true //Since we want to reduce our APK size as much as possible, I’m using the settings from the proguard-android-optimize.txt file// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } }</pre><ul> <li>Use the aapt tool to optimize your drawables with lossless compression, or use a program that’s designed to reduce the size of your PNG files (<a href="https://github.com/google/zopfli" rel="external" target="_blank">zopflipng</a>, <a href="http://pmt.sourceforge.net/pngcrush/" rel="external" target="_blank">pngcrush</a>, <a href="http://optipng.sourceforge.net/" rel="external" target="_blank">OptiPNG</a>, <a href="https://tinypng.com/" rel="external" target="_blank">TinyPNG</a>, or <a href="https://pngquant.org/" rel="external" target="_blank">pngquant</a>) or the size of your JPEGs (<a href="http://www.elektronik.htw-aalen.de/packjpg/" rel="external" target="_blank">packJPG</a>). Alternatively, you may want to try replacing your PNG and JPEG files with images in the <a href="https://developer.android.com/studio/write/convert-webp.html" rel="external" target="_blank">WebP format</a>.</li> <li>Remember to remove all debug-related functionality from the release version of your app. Android doesn’t require this information to run, so it’s just taking up unnecessary space.</li> <li>Scour your project for any duplicate resources. Even lightweight resources like duplicate strings contribute something towards your final APK size.</li> <li>Use Lint to identify any resources that aren’t referenced anywhere in your code, and remove these resources. To run Lint, select <strong>Analyze > Inspect Code...</strong> from the Android Studio toolbar.</li> <li>Enable resource shrinking, by adding <code class="inline">shrinkResources true</code> to your project’s build.gradle file.</li> <li>If you need to use variations of the same image, then use the same base image and customize it at runtime, rather than adding multiple versions of the same image to your project. For example, you can apply different colours to an image using <code class="inline">android:tint</code> and <code class="inline">tintMode</code>, and you can rotate an image using <code class="inline">android:fromDegrees</code>, <code class="inline">android:toDegrees</code>, <code class="inline">android:pivotX</code>, and <code class="inline">android:pivotY</code>.</li> <li><p>Optimize your libraries. Try to remove any unnecessary or memory-intensive libraries from your project. If you do need to use a large library, then check whether there’s any way you can optimize this library for the mobile environment, as external library code often isn’t written with mobile in mind. You should also bear in mind that many libraries contain a large amount of localized strings. If your app doesn’t officially support these libraries, then you may be able to reduce the size of the library by telling Gradle not to include these strings in your compiled APK. To specify the languages that your app officially supports, open your module-level build.gradle file and use the <code class="inline">resConfigs</code> attribute. For example, here we’re specifying that we want to include only English-language strings in our project:</p></li> </ul><pre class="brush: xml noskimlinks noskimwords">android { defaultConfig { resConfigs "en"</pre><ul><li><p>Consider whether your APK contains a large amount of content that the individual user may download but never use. For example, a device with an hdpi screen doesn’t have much use for <code class="inline">xxxhdpi</code> assets! One of the most effective ways of reducing the size of your APK is to separate it into multiple APKs, so when the user downloads your app, they’ll receive an APK that contains only the code and resources that make sense for their particular device. You’ll find more information on <a href="https://developer.android.com/studio/build/configure-apk-splits.html" rel="external" target="_blank" title="Link: https://developer.android.com/studio/build/configure-apk-splits.html">creating APKs that target different screen densities and specific ABIs</a> (application binary interfaces) over at the official Android docs.</p></li></ul><h3>6. ActivityNotFoundException</h3><p>An <code class="inline">ActivityNotFoundException</code> occurs when a call to <code class="inline">startActivity(Intent)</code> or one of its variants fails because the <code class="inline">Activity</code> can’t execute the given <code class="inline">Intent</code>.</p><p>The most common cause of an <code class="inline">ActivityNotFoundException</code> is forgetting to declare an activity in your manifest, so open your manifest and check that you’ve declared all your activities. You should also check that you’ve declared each activity <em>correctly</em>, using either a fully qualified class name or a full stop as a shorthand for the package name. For example, both of the following are valid:</p><pre class="brush: xml noskimlinks noskimwords"><activity android:name=".MainActivity"></pre><pre class="brush: xml noskimlinks noskimwords"><activity android:name="com.jessicathornsby.myapplication.MainActivity"></pre><p>If you can’t spot any problems with your manifest, then there are a few other potential causes of <code class="inline">ActivityNotFoundExceptions</code>. Firstly, if you encounter this error after moving an <code class="inline">Activity</code> class from one package to another, then it’s possible that you’ve confused Android Studio and just need to clean and rebuild your project.</p><p>An <code class="inline">ActivityNotFoundException</code> can also be caused if an error in the target <code class="inline">Activity</code> is not loading correctly. To check whether this is occurring in your project, put your intent code inside a try-catch block:</p><pre class="brush: java noskimlinks noskimwords">try { //Your code here// } catch ( ActivityNotFoundException e) { e.printStackTrace(); }</pre><p>Run your application again, and then take a look at Android Studio’s Logcat Monitor to see whether it’s captured any exceptions that may be preventing the target activity from being created. If this is the case, then resolving these errors should solve the <code class="inline">ActivityNotFoundException</code>, too.<br></p><h3>7. ClassCastException</h3><p>The <code class="inline">ClassCastException</code> error is related to Java’s type conversion feature, which allows you to cast variables of one type to another. You encounter a <code class="inline">ClassCastException</code> when you try to cast an object to a class of which it’s not an instance. For example, both of the following code snippets will result in a <code class="inline">ClassCastException</code>:</p><pre class="brush: java noskimlinks noskimwords">Object x = new Integer(0); System.out.println((String)x);</pre><pre class="brush: java noskimlinks noskimwords">ImageView image = (ImageView)context.findViewById(R.id.button);</pre><p>This error message contains information about the line that’s causing the <code class="inline">ClassCastException</code> error, so navigate to this part of your project, check what objects are being cast there, and resolve any mismatch.</p><p>If you can’t spot a problem with your casting, then consider whether you’ve recently moved some <code class="inline">Views</code> around in your layout resource files, as some users have reported encountering a <code class="inline">ClassCastException</code> after rearranging their <code class="inline">Views</code>. If you suspect this may be the cause of your <code class="inline">ClassCastException</code>, then tell Android Studio to regenerate your layout files from scratch, by performing a clean/rebuild cycle. This forces Android Studio to properly register your recent layout changes, which should resolve your <code class="inline">ClassCastException</code>.</p><h3>8. NullPointerException</h3><p>In Java, when you declare a reference variable, you’re actually creating a pointer to an object. You can declare that an object is currently pointing at an unknown piece of data by assigning a null value to that object’s reference. Null values can be useful in coding some design patterns, but if you encounter a NullPointerException (NPE) then it means that you’ve tried to use a reference that’s pointing at a null value, as though it were referencing an object. Since there’s no code to execute in the location where this reference is pointing, you wind up with an NPE.</p><p>An NPE is usually accompanied by information about where this exception was caught, so the Logcat Monitor should contain the exact line where this error occurred. Navigate to this area of your project and identify the reference that equals null. You'll then need to find the location where the value should be set, and set it.</p><p>The <code class="inline">findViewById</code> method can also return null if the requested <code class="inline">View</code> can’t be found, so if your NPE is occurring in a line that contains a <code class="inline">findViewById</code>, check that you’ve initialized the layout that contains this <code class="inline">View</code>. Also be on the lookout for any spelling mistakes or typos that may have crept into your <code class="inline">findViewById</code> call, as these can also result in an NPE. </p><p>To avoid NPEs occurring in your project, make sure all your objects are initialized before you attempt to use them, and always verify that a variable isn’t null before you request a method or field from that object.</p><h3>9. Application Not Responding Error</h3><p>This is an error that appears as a dialogue on the Android device or AVD you’re using to test your app. The <strong>Application Not Responding</strong> (ANR) error occurs when your app’s UI freezes and remains unresponsive to user input for more than five seconds. This usually happens because your app is trying to perform lengthy or intensive operations on Android’s main UI thread.</p><p>In Android, the main UI thread is responsible for dispatching all user input events to the appropriate UI widgets, and for updating your app’s UI. However, this thread can only process one task at a time, so if you block the main thread with any long-running or intensive operations, then your UI will be completely unresponsive until this task is complete.</p><p>If you encounter an ANR message while testing your app, then you <em>definitely</em> need to take a look at the work you’re performing on the main thread. However, if you don’t explicitly encounter this error but notice that your app sometimes feels sluggish or laggy, then this is an indication that you’re on the verge of an ANR error, and once again you should take a look at the state of your UI thread.</p><p>To resolve ANR errors (and <em>near</em>-ANR errors), you need to identify all the operations that have the potential to run slowly, or that require significant processing power, and then move them off the main thread. You do this by creating a worker thread where these operations can be performed with zero risk of blocking the main UI thread.</p><p>There are several methods of creating additional threads, but the simplest solution is to use an <code class="inline">AsynTask</code>, as this class already contains its own worker thread <em>and</em> an <code class="inline">onPostExecute()</code> callback that you can use to communicate with Android’s main UI thread.</p><p>However, AsyncTasks are better suited to performing short background operations, so if you need to perform a long-running operation, then you should use a <code class="inline">Service</code> or an <code class="inline">IntentService</code> instead.</p><p>Although moving long-running and intensive tasks off the main thread will have the most impact on your app’s performance, it’s best practice to perform as little work as possible on the main UI thread. Even running a small amount of unnecessary code on the main thread can have an impact on your app’s responsiveness, so once you’ve successfully relocated all of your long-running and intensive operations, you should look at whether there’s any more code that you can move off the main thread.</p><h3>10. Only the Original Thread That Created a View Hierarchy Can Touch Its Views</h3><p>In Android, you can update your UI from the main thread only. If you try to access UI elements from any other thread, then you’re going to encounter this error.</p><p>To resolve this issue, identify the part of your background task that’s attempting to update the UI and move it to a <code class="inline">runOnUiThread</code>, for example:</p><pre class="brush: java noskimlinks noskimwords">runOnUiThread(new Runnable() { @Override public void run() { //Update your UI// } });</pre><p>Alternatively, you can use a <a href="https://developer.android.com/training/multiple-threads/communicate-ui.html" rel="external" target="_blank">handler</a> or perform your background work in an AsyncTask, as you can communicate with the main thread using AsyncTask’s <code class="inline">onPostExecute()</code> callback method. Finally, if you find yourself regularly switching between threads, then you may want to look into <a href="https://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396">RxAndroid</a>, as this library allows you to create a new thread, schedule work to be performed on this thread, and then post the results to the main thread, all with just a few lines of code.</p><ul class="roundup-block__contents posts--half-width roundup-block--list"><li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/reactive-programming-operators-in-rxjava-20--cms-28396"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28396/preview_image/RxJava-2.0-reactive-programming-operators.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Reactive Programming Operators in RxJava 2</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li></ul><h3>11. NetworkOnMainThreadException</h3><p>This exception is thrown when your app attempts to perform networking operations on the main thread, such as sending API requests, connecting to a remote database, or downloading a file. Since network operations can be time-consuming and labour-intensive, they are highly likely to block the main thread, so Android 3.0 (Honeycomb) and higher will throw this error whenever you attempt to make a network request on the main thread.</p><p>If you do encounter a <code class="inline">NetworkOnMainThreadException</code>, then find the networking code that’s running on your main thread, and move it to a separate thread.</p><p>If you do need to make frequent networking requests, then you may want to take a look at <a href="https://developer.android.com/training/volley/index.html" rel="external" target="_blank">Volley</a>, an HTTP library that initiates its own background threads so that all networking requests are performed off the main thread by default.</p><h3>12. Activity Has Leaked Window That Was Originally Added Here</h3><p>This error occurs when trying to show a dialogue after exiting the Activity. If you do encounter this issue, then open your Activity and make sure you’re dismissing the dialogue properly, by calling <code class="inline">dismiss()</code> in either your Activity’s <code class="inline">onDestroy()</code> or <code class="inline">onPause()</code> method, for example:</p><pre class="brush: java noskimlinks noskimwords">@Override protected void onDestroy() { super.onDestroy(); if(pDialogue!= null) pDialogue.dismiss(); }</pre><h3>13. OutofMemoryError</h3><p>This error occurs when your app makes a memory request that the system can’t meet. If you encounter this error message, then start by ruling out all of the most common memory management mistakes. Check that you’ve remembered to unregister all your broadcast receivers and that you’ve stopped all of your services; make sure you’re not holding onto references in any static member variables, and that you’re not attempting to load any large bitmaps.</p><p>If you’ve ruled out all the obvious causes of an <code class="inline">OutOfMemoryError</code>, then you’ll need to dig deeper and examine exactly how your app is allocating memory, as chances are there are a few areas where you can improve your app’s memory management.</p><p>Android Studio has a whole area dedicated to helping you analyze your app’s memory usage, so start by selecting <strong>View > Tools Window</strong> from the Android Studio toolbar. At this point you’ll see either an <strong>Android Monitor</strong> or <strong>Android Profiler</strong> option, depending on the version of Android Studio you have installed.</p><p>We’ve discussed <a href="https://code.tutsplus.com/tutorials/detect-and-resolve-performance-problems-on-android--cms-24058" title="Link: https://code.tutsplus.com/tutorials/detect-and-resolve-performance-problems-on-android--cms-24058">working with the Memory Monitor</a> on this website before, but since Android Profiler is a new addition to Android Studio, let’s take a quick look at its major features.</p><p>When you open Android Profiler, it starts recording three pieces of information automatically.</p><figure class="post_image"><img alt="The Android Profiler tracks the apps CPU Memory and Network information automatically" src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-errors-profiler.jpg" title="Image: https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-errors-profiler.jpg"></figure><p>Since we’re interested in the way our app is using memory, give the <strong>Memory</strong> section a click, which will launch the <strong>Memory Profiler</strong>.<br></p><p>The Memory Profiler consists of a timeline that displays the different kinds of memory currently being allocated by your app, for example <strong>Java</strong>, <strong>native</strong>, and <strong>stack</strong>. Above this graph you’ll find a row of icons that you can use to trigger different actions:</p><ul> <li><strong>Force a garbage collection event.</strong></li> <li> <strong>Take an Hprof snapshot of the application memory. </strong>This is a snapshot of all the objects in your app’s heap, including the kind of objects your app is allocating, the number of allocated objects, and how much space these objects are taking up.</li> <li> <strong>Record memory allocations. </strong>By recording your app’s memory allocations while performing certain actions, you can identify the specific operations that are consuming too much memory.</li> </ul><figure class="post_image"><img alt="The Memory Profiler displays the different kinds of memory your app is allocating " src="https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-errors-memory-profiler.jpg" title="Image: https://cms-assets.tutsplus.com/uploads/users/369/posts/28706/image/android-common-errors-memory-profiler.jpg"></figure><p>To identify the parts of your application that are responsible for the <code class="inline">OutOfMemoryError</code>, spend some time interacting with your app, and monitor how your app’s memory allocations change in response to different actions. Once you’ve identified the section of your project that’s causing the problem, spend some time scrutinising it for any memory leaks, as well as any inefficiencies in the way it’s using memory.</p><h2>Conclusion</h2><p>In this article we looked at 13 of the error messages you’re most likely to encounter when developing for Android. We discussed all the different factors that can contribute towards these errors, and the steps you need to take to resolve them.</p><p>If you’re being plagued by an error message that we didn’t cover, then your first step should be copy/pasting the entire error message into Google, as this will often turn up threads and blog posts where people are discussing how to solve this particular error.</p><p>And, if you can’t find a solution anywhere on the web, then you can always reach out to the Android community for help directly, by posting your question to <a href="http://stackoverflow.com/" rel="external" target="_blank">Stack Overflow</a>.</p><p>While you're here, check out some of our other posts on Android app development!</p><ul class="roundup-block__contents posts--half-width roundup-block--list"> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/how-to-create-an-android-chat-app-using-firebase--cms-27397"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/27397/preview_image/[email protected]"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">How to Create an Android Chat App Using Firebase</div> <div class="roundup-block__author">Ashraff Hathibelagal</div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/sending-data-with-retrofit-2-http-client-for-android--cms-27845"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/27845/preview_image/image_post.png"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Sending Data With Retrofit 2 HTTP Client for Android</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/code-an-image-gallery-android-app-with-glide--cms-28207"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/1499/posts/28207/preview_image/hy.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Code an Image Gallery Android App With Glide</div> <div class="roundup-block__author">Chike Mgbemena </div></a></li> <li class="roundup-block__content"><a class="roundup-block__content-link" href="http://code.tutsplus.com/tutorials/getting-started-with-rxjava-20-for-android--cms-28345"><img class="roundup-block__preview-image" src="https://cms-assets.tutsplus.com/uploads/users/769/posts/28345/preview_image/Getting-Started-RxJava-2.0-for-Android.jpg"><div class="roundup-block__primary-category topic-code">Android SDK</div> <div class="roundup-block__content-title">Get Started With RxJava 2 for Android</div> <div class="roundup-block__author">Jessica Thornsby</div></a></li> </ul><p></p> 2017-05-09T12:00:00.000Z 2017-05-09T12:00:00.000Z Jessica Thornsby
|
{
"url": "https://code.tutsplus.com/categories/android.atom",
"source_domain": "code.tutsplus.com",
"snapshot_id": "crawl=CC-MAIN-2017-30",
"warc_metadata": {
"Content-Length": "291079",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:FVXQXSORIJSN57BCMNVOJSBGJHRLOZ56",
"WARC-Concurrent-To": "<urn:uuid:a19b96a9-082a-47a9-be3d-cb046aad301d>",
"WARC-Date": "2017-07-25T02:29:55Z",
"WARC-IP-Address": "104.16.255.60",
"WARC-Identified-Payload-Type": "application/atom+xml",
"WARC-Payload-Digest": "sha1:IYUAIEI2BIPB4BOQACZJZXPTCDUIYXFC",
"WARC-Record-ID": "<urn:uuid:f279dbaa-5fca-44e9-b2b9-31b5bf6eb474>",
"WARC-Target-URI": "https://code.tutsplus.com/categories/android.atom",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:adbe47ee-1102-45b2-92c3-a62269877d94>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-166-26-52.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-30\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for July 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0
],
"line_end_idx": [
249322
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 249322,
"ccnet_original_nlines": 0,
"rps_doc_curly_bracket": 0.0013115600449964404,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.21519160270690918,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01012887991964817,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.353002667427063,
"rps_doc_frac_unique_words": 0.19144359230995178,
"rps_doc_mean_word_length": 7.700963973999023,
"rps_doc_num_sentences": 2630,
"rps_doc_symbol_to_word_ratio": 0.0009254799806512892,
"rps_doc_unigram_entropy": 6.776093006134033,
"rps_doc_word_count": 25104,
"rps_doc_frac_chars_dupe_10grams": 0.15233932435512543,
"rps_doc_frac_chars_dupe_5grams": 0.22885814309120178,
"rps_doc_frac_chars_dupe_6grams": 0.19872236251831055,
"rps_doc_frac_chars_dupe_7grams": 0.17231087386608124,
"rps_doc_frac_chars_dupe_8grams": 0.1634397953748703,
"rps_doc_frac_chars_dupe_9grams": 0.15569119155406952,
"rps_doc_frac_chars_top_2gram": 0.004200180061161518,
"rps_doc_frac_chars_top_3gram": 0.017354199662804604,
"rps_doc_frac_chars_top_4gram": 0.010024569928646088,
"rps_doc_books_importance": -26960.603515625,
"rps_doc_books_importance_length_correction": -26960.603515625,
"rps_doc_openwebtext_importance": -14685.748046875,
"rps_doc_openwebtext_importance_length_correction": -14685.748046875,
"rps_doc_wikipedia_importance": -10446.8193359375,
"rps_doc_wikipedia_importance_length_correction": -10446.8193359375
},
"fasttext": {
"dclm": 0.10886865854263306,
"english": 0.6287633180618286,
"fineweb_edu_approx": 2.1271796226501465,
"eai_general_math": 0.14316952228546143,
"eai_open_web_math": 0.12971913814544678,
"eai_web_code": 0.7286201119422913
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.4",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.0285",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "6",
"label": "Content Listing"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
6,071,901,534,717,484,000 |
Attribute selectors
The CSS attribute selector matches elements based on the element having a given attribute explicitly set, with options for defining an attribute value or substring value match.
css
/* <a> elements with a title attribute */
a[title] {
color: purple;
}
/* <a> elements with an href matching "https://example.org" */
a[href="https://example.org"]
{
color: green;
}
/* <a> elements with an href containing "example" */
a[href*="example"] {
font-size: 2em;
}
/* <a> elements with an href ending ".org", case-insensitive */
a[href$=".org" i] {
font-style: italic;
}
/* <a> elements whose class attribute contains the word "logo" */
a[class~="logo"] {
padding: 2px;
}
Syntax
[attr]
Represents elements with an attribute name of attr.
[attr=value]
Represents elements with an attribute name of attr whose value is exactly value.
[attr~=value]
Represents elements with an attribute name of attr whose value is a whitespace-separated list of words, one of which is exactly value.
[attr|=value]
Represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, - (U+002D). It is often used for language subcode matches.
[attr^=value]
Represents elements with an attribute name of attr whose value is prefixed (preceded) by value.
[attr$=value]
Represents elements with an attribute name of attr whose value is suffixed (followed) by value.
[attr*=value]
Represents elements with an attribute name of attr whose value contains at least one occurrence of value within the string.
[attr operator value i]
Adding an i (or I) before the closing bracket causes the value to be compared case-insensitively (for characters within the ASCII range).
[attr operator value s]
Adding an s (or S) before the closing bracket causes the value to be compared case-sensitively (for characters within the ASCII range).
Values
<attr>
An <ident>, that is, the unquoted name of the attribute. This can be any valid language-specific attribute (SVG, HTML, XML, etc), a data-* attribute, or an author-created attribute.
<value>
An <ident> or <string>, representing the attribute value. The value must be quoted if it contains spaces or special characters.
s or i
Case sensitivity or insensitivity flag. If included before the closing bracket (]), makes the value case sensitive or insensitive, irrespective of the markup language.
Description
The case sensitivity of attribute names and values depends on the document language. In HTML, attribute names are case-insensitive, as are spec-defined enumerated values. The case-insensitive HTML attribute values are listed in the HTML spec. For these attributes, the attribute value in the selector is case-insensitive, regardless of whether the value is invalid or the attribute for the element on which it is set is invalid.
If the attribute value is case-sensitive, like class, id, and data-* attributes, the attribute selector value match is case-sensitive. Attributes defined outside of the HTML specification, like role and aria-* attributes, are also case-sensitive. Case-sensitive attribute selectors can be made case-insensitive with the inclusion of the case-insensitive modifier (i).
Examples
CSS
css
a {
color: blue;
}
/* Internal links, beginning with "#" */
a[href^="#"] {
background-color: gold;
}
/* Links with "example" anywhere in the URL */
a[href*="example"] {
background-color: silver;
}
/* Links with "insensitive" anywhere in the URL,
regardless of capitalization */
a[href*="insensitive" i] {
color: cyan;
}
/* Links with "cAsE" anywhere in the URL,
with matching capitalization */
a[href*="cAsE" s] {
color: pink;
}
/* Links that end in ".org" */
a[href$=".org"] {
color: red;
}
/* Links that start with "https://" and end in ".org" */
a[href^="https://"][href$=".org"]
{
color: green;
}
HTML
html
<ul>
<li><a href="#internal">Internal link</a></li>
<li><a href="http://example.com">Example link</a></li>
<li><a href="#InSensitive">Insensitive internal link</a></li>
<li><a href="http://example.org">Example org link</a></li>
<li><a href="https://example.org">Example https org link</a></li>
</ul>
Result
Languages
CSS
css
/* All divs with a `lang` attribute are bold. */
div[lang] {
font-weight: bold;
}
/* All divs without a `lang` attribute are italicized. */
div:not([lang]) {
font-style: italic;
}
/* All divs in US English are blue. */
div[lang~="en-us"] {
color: blue;
}
/* All divs in Portuguese are green. */
div[lang="pt"] {
color: green;
}
/* All divs in Chinese are red, whether
simplified (zh-Hans-CN) or traditional (zh-Hant-TW). */
div[lang|="zh"] {
color: red;
}
/* All divs with a Traditional Chinese
`data-lang` are purple. */
/* Note: You could also use hyphenated attributes
without double quotes */
div[data-lang="zh-Hant-TW"] {
color: purple;
}
HTML
html
<div lang="en-us en-gb en-au en-nz">Hello World!</div>
<div lang="pt">Olá Mundo!</div>
<div lang="zh-Hans-CN">世界您好!</div>
<div lang="zh-Hant-TW">世界您好!</div>
<div data-lang="zh-Hant-TW">世界您好!</div>
Result
HTML ordered lists
The HTML specification requires the type attribute to be matched case-insensitively because it is primarily used in the <input> element. Note that if a modifier is not supported by the user agent, then the selector will not match.
CSS
css
/* Case-sensitivity depends on document language */
ol[type="a"]:first-child {
list-style-type: lower-alpha;
background: red;
}
ol[type="i" s] {
list-style-type: lower-alpha;
background: lime;
}
ol[type="I" s] {
list-style-type: upper-alpha;
background: grey;
}
ol[type="a" i] {
list-style-type: upper-alpha;
background: green;
}
HTML
html
<ol type="A">
<li>
Red background for case-insensitive matching (default for the type selector)
</li>
</ol>
<ol type="i">
<li>Lime background if `s` modifier is supported (case-sensitive match)</li>
</ol>
<ol type="I">
<li>Grey background if `s` modifier is supported (case-sensitive match)</li>
</ol>
<ol type="A">
<li>
Green background if `i` modifier is supported (case-insensitive match)
</li>
</ol>
Result
Specifications
Specification
Selectors Level 4
# attribute-selectors
Browser compatibility
BCD tables only load in the browser
See also
|
{
"url": "https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors",
"source_domain": "developer.mozilla.org",
"snapshot_id": "CC-MAIN-2024-33",
"warc_metadata": {
"Content-Length": "326382",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:HOAIAZUE4DVNYRHR3IRVWQFFKKCQJIU6",
"WARC-Concurrent-To": "<urn:uuid:a92b9845-5a4d-4365-a355-150e8060158c>",
"WARC-Date": "2024-08-13T18:16:14Z",
"WARC-IP-Address": "34.111.97.67",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:JRE43SSHDETG7P5ORQJRHE3I6EUZHMUI",
"WARC-Record-ID": "<urn:uuid:ba638250-432d-4fe2-b2c2-20a0f451faa0>",
"WARC-Target-URI": "https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:87d95f49-111f-448f-a92e-80d50910dbc7>"
},
"warc_info": "isPartOf: CC-MAIN-2024-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-211\r\nsoftware: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
20,
21,
198,
199,
203,
245,
256,
273,
275,
276,
339,
369,
371,
387,
389,
390,
443,
464,
482,
484,
485,
549,
569,
591,
593,
594,
660,
679,
695,
697,
698,
705,
706,
713,
714,
766,
767,
780,
781,
862,
863,
877,
878,
1013,
1014,
1028,
1029,
1230,
1231,
1245,
1246,
1342,
1343,
1357,
1358,
1454,
1455,
1469,
1470,
1594,
1595,
1619,
1620,
1758,
1759,
1783,
1784,
1920,
1921,
1928,
1929,
1936,
1937,
2119,
2120,
2128,
2129,
2257,
2258,
2265,
2266,
2434,
2435,
2447,
2448,
2877,
2878,
3246,
3247,
3256,
3257,
3261,
3262,
3266,
3270,
3285,
3287,
3288,
3329,
3344,
3370,
3372,
3373,
3420,
3441,
3469,
3471,
3472,
3521,
3556,
3583,
3598,
3600,
3601,
3643,
3675,
3695,
3710,
3712,
3713,
3744,
3762,
3776,
3778,
3779,
3836,
3870,
3872,
3888,
3890,
3891,
3896,
3897,
3902,
3907,
3956,
4013,
4077,
4138,
4206,
4212,
4213,
4220,
4221,
4231,
4232,
4236,
4237,
4241,
4290,
4302,
4323,
4325,
4326,
4384,
4402,
4424,
4426,
4427,
4466,
4487,
4502,
4504,
4505,
4545,
4562,
4578,
4580,
4581,
4621,
4680,
4698,
4712,
4714,
4715,
4754,
4784,
4834,
4862,
4892,
4909,
4911,
4912,
4917,
4918,
4923,
4978,
5010,
5045,
5080,
5120,
5121,
5128,
5129,
5148,
5149,
5380,
5381,
5385,
5386,
5390,
5442,
5469,
5501,
5520,
5522,
5523,
5540,
5572,
5592,
5594,
5595,
5612,
5644,
5664,
5666,
5667,
5684,
5716,
5737,
5739,
5740,
5745,
5746,
5751,
5765,
5772,
5853,
5861,
5867,
5881,
5960,
5966,
5980,
6059,
6065,
6079,
6086,
6161,
6169,
6175,
6176,
6183,
6184,
6199,
6200,
6214,
6232,
6254,
6255,
6277,
6278,
6314,
6315
],
"line_end_idx": [
20,
21,
198,
199,
203,
245,
256,
273,
275,
276,
339,
369,
371,
387,
389,
390,
443,
464,
482,
484,
485,
549,
569,
591,
593,
594,
660,
679,
695,
697,
698,
705,
706,
713,
714,
766,
767,
780,
781,
862,
863,
877,
878,
1013,
1014,
1028,
1029,
1230,
1231,
1245,
1246,
1342,
1343,
1357,
1358,
1454,
1455,
1469,
1470,
1594,
1595,
1619,
1620,
1758,
1759,
1783,
1784,
1920,
1921,
1928,
1929,
1936,
1937,
2119,
2120,
2128,
2129,
2257,
2258,
2265,
2266,
2434,
2435,
2447,
2448,
2877,
2878,
3246,
3247,
3256,
3257,
3261,
3262,
3266,
3270,
3285,
3287,
3288,
3329,
3344,
3370,
3372,
3373,
3420,
3441,
3469,
3471,
3472,
3521,
3556,
3583,
3598,
3600,
3601,
3643,
3675,
3695,
3710,
3712,
3713,
3744,
3762,
3776,
3778,
3779,
3836,
3870,
3872,
3888,
3890,
3891,
3896,
3897,
3902,
3907,
3956,
4013,
4077,
4138,
4206,
4212,
4213,
4220,
4221,
4231,
4232,
4236,
4237,
4241,
4290,
4302,
4323,
4325,
4326,
4384,
4402,
4424,
4426,
4427,
4466,
4487,
4502,
4504,
4505,
4545,
4562,
4578,
4580,
4581,
4621,
4680,
4698,
4712,
4714,
4715,
4754,
4784,
4834,
4862,
4892,
4909,
4911,
4912,
4917,
4918,
4923,
4978,
5010,
5045,
5080,
5120,
5121,
5128,
5129,
5148,
5149,
5380,
5381,
5385,
5386,
5390,
5442,
5469,
5501,
5520,
5522,
5523,
5540,
5572,
5592,
5594,
5595,
5612,
5644,
5664,
5666,
5667,
5684,
5716,
5737,
5739,
5740,
5745,
5746,
5751,
5765,
5772,
5853,
5861,
5867,
5881,
5960,
5966,
5980,
6059,
6065,
6079,
6086,
6161,
6169,
6175,
6176,
6183,
6184,
6199,
6200,
6214,
6232,
6254,
6255,
6277,
6278,
6314,
6315,
6323
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 6323,
"ccnet_original_nlines": 254,
"rps_doc_curly_bracket": 0.0069587198086082935,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.23856858909130096,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.024519549682736397,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3605036437511444,
"rps_doc_frac_unique_words": 0.3425000011920929,
"rps_doc_mean_word_length": 5.664999961853027,
"rps_doc_num_sentences": 46,
"rps_doc_symbol_to_word_ratio": 0.0033134499099105597,
"rps_doc_unigram_entropy": 5.025576114654541,
"rps_doc_word_count": 800,
"rps_doc_frac_chars_dupe_10grams": 0.1390114724636078,
"rps_doc_frac_chars_dupe_5grams": 0.17519858479499817,
"rps_doc_frac_chars_dupe_6grams": 0.1626213639974594,
"rps_doc_frac_chars_dupe_7grams": 0.14849956333637238,
"rps_doc_frac_chars_dupe_8grams": 0.14849956333637238,
"rps_doc_frac_chars_dupe_9grams": 0.1390114724636078,
"rps_doc_frac_chars_top_2gram": 0.029126210138201714,
"rps_doc_frac_chars_top_3gram": 0.03089144080877304,
"rps_doc_frac_chars_top_4gram": 0.03706973046064377,
"rps_doc_books_importance": -690.9366455078125,
"rps_doc_books_importance_length_correction": -690.9366455078125,
"rps_doc_openwebtext_importance": -446.93798828125,
"rps_doc_openwebtext_importance_length_correction": -446.93798828125,
"rps_doc_wikipedia_importance": -284.63165283203125,
"rps_doc_wikipedia_importance_length_correction": -284.63165283203125
},
"fasttext": {
"dclm": 0.4812138080596924,
"english": 0.5976978540420532,
"fineweb_edu_approx": 2.257688283920288,
"eai_general_math": 0.24142026901245117,
"eai_open_web_math": 0.29981738328933716,
"eai_web_code": 0.7309935092926025
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.435",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "-1",
"labels": {
"level_1": "",
"level_2": "",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "5",
"label": "Exceptionally Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,556,819,957,313,059,000 |
468 reputation
1413
bio website michaelsanford.com
location
age
visits member for 5 years, 1 month
seen Aug 25 at 20:33
Jul
28
revised straight to grub prompt on boot
Codeify for readbility.
Mar
25
revised What is the difference between mSATA and SATA SSDs?
Msata -> mSATA
Feb
28
revised Change Windows 7 taskbar location automatically based on screen shape or on docking status
Codified block
Feb
28
revised How can I extract data from Toshiba Satellite with a dead Windows installation?
added 165 characters in body
Dec
13
revised iTunes OS X full system crash cont'd: is a bad media file the culprit? How do I isolate it?
Added answer to the top
Dec
13
revised iTunes causes the entire system to crash when downloading some media OS X
added answer
Dec
1
revised iTunes OS X full system crash cont'd: is a bad media file the culprit? How do I isolate it?
Added edit on QTKitServer
Nov
30
revised iTunes causes the entire system to crash when downloading some media OS X
added 70 characters in body
Nov
30
revised iTunes causes the entire system to crash when downloading some media OS X
added 291 characters in body
Nov
27
revised iTunes causes the entire system to crash when downloading some media OS X
added 689 characters in body
Nov
17
revised iTunes causes the entire system to crash when downloading some media OS X
added 288 characters in body
Jun
30
revised Solution or webapp for encryption before sending to server?
Clarified packages, certificates
|
{
"url": "http://superuser.com/users/9254/msanford?tab=activity&sort=revisions",
"source_domain": "superuser.com",
"snapshot_id": "crawl=CC-MAIN-2014-42",
"warc_metadata": {
"Content-Length": "41440",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:UH6LTWG3APOQHDZCDXJ3L5P7EL4VUDAQ",
"WARC-Concurrent-To": "<urn:uuid:c31c37ab-5015-4b5b-89ca-fc3d5adaccb8>",
"WARC-Date": "2014-10-20T08:21:46Z",
"WARC-IP-Address": "198.252.206.16",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:YL2VMO2UTX4VHAUFZG7JXUEYIWJ5VDB2",
"WARC-Record-ID": "<urn:uuid:144e387d-3349-47e5-a40e-592ef4f79c51>",
"WARC-Target-URI": "http://superuser.com/users/9254/msanford?tab=activity&sort=revisions",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:321ca33d-5327-488d-b7ab-46252b96da96>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-16-133-185.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2014-42\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for October 2014\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
15,
20,
51,
60,
64,
99,
120,
121,
125,
128,
168,
192,
196,
199,
259,
274,
278,
281,
380,
395,
399,
402,
490,
519,
523,
526,
626,
650,
654,
657,
739,
752,
756,
758,
858,
884,
888,
891,
973,
1001,
1005,
1008,
1090,
1119,
1123,
1126,
1208,
1237,
1241,
1244,
1326,
1355,
1359,
1362,
1430
],
"line_end_idx": [
15,
20,
51,
60,
64,
99,
120,
121,
125,
128,
168,
192,
196,
199,
259,
274,
278,
281,
380,
395,
399,
402,
490,
519,
523,
526,
626,
650,
654,
657,
739,
752,
756,
758,
858,
884,
888,
891,
973,
1001,
1005,
1008,
1090,
1119,
1123,
1126,
1208,
1237,
1241,
1244,
1326,
1355,
1359,
1362,
1430,
1462
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1462,
"ccnet_original_nlines": 55,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2418772578239441,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.06498195230960846,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.15162454545497894,
"rps_doc_frac_unique_words": 0.44921875,
"rps_doc_mean_word_length": 4.63671875,
"rps_doc_num_sentences": 10,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.404926300048828,
"rps_doc_word_count": 256,
"rps_doc_frac_chars_dupe_10grams": 0.4524010121822357,
"rps_doc_frac_chars_dupe_5grams": 0.4524010121822357,
"rps_doc_frac_chars_dupe_6grams": 0.4524010121822357,
"rps_doc_frac_chars_dupe_7grams": 0.4524010121822357,
"rps_doc_frac_chars_dupe_8grams": 0.4524010121822357,
"rps_doc_frac_chars_dupe_9grams": 0.4524010121822357,
"rps_doc_frac_chars_top_2gram": 0.07666385918855667,
"rps_doc_frac_chars_top_3gram": 0.06739679723978043,
"rps_doc_frac_chars_top_4gram": 0.09267059713602066,
"rps_doc_books_importance": -119.91692352294922,
"rps_doc_books_importance_length_correction": -114.47772979736328,
"rps_doc_openwebtext_importance": -66.38217163085938,
"rps_doc_openwebtext_importance_length_correction": -66.38217163085938,
"rps_doc_wikipedia_importance": -51.35127639770508,
"rps_doc_wikipedia_importance_length_correction": -41.899391174316406
},
"fasttext": {
"dclm": 0.7310682535171509,
"english": 0.876690149307251,
"fineweb_edu_approx": 1.1527597904205322,
"eai_general_math": 0.007477640174329281,
"eai_open_web_math": 0.0786014199256897,
"eai_web_code": 0.09115183353424072
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.02",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.456",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "6",
"label": "Not Applicable/Indeterminate"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
8,419,539,257,465,367,000 |
Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.
I'm trying to display the camera stream in a GLSurfaceView via a SurfaceTexture trasmitted to OpenGL ES 2.0 shaders.
I took inspiration from this post.
The image is complete but is not correctly displayed on my tablet. The screen seems divided in 2x2 parts. The image is displayed in the upper-left part whereas the other three parts are black.
I suspect that the problem comes from my usage of the transformation matrix returned by the sequence documented here
updateTexImage();
getTransformMatrix(...);
I transmit this matrix in the vertex shader to generate the texture coordinates for the fragment shader.
vertex shader:
attribute vec3 aPosition;
uniform mat4 uMvpTransform;
// Matrix retrieved by getTransformMatrix(...);
uniform mat4 uTexMatTransform;
varying vec2 vTexCoord;
void main(void)
{
gl_Position = uMvpTransform *vec4(aPosition.xyz, 1);
vec4 l_tex = uTexMatTransform*vec4(aPosition.xyz, 1);
vTexCoord=l_tex.xy;
}
fragment shader:
#extension GL_OES_EGL_image_external : require
varying mediump vec2 vTexCoord;
uniform samplerExternalOES uSampler;
void main(void)
{
mediump vec4 l_tex = texture2D(uSampler, vTexCoord);
gl_FragColor=l_tex;
}
The texture is attached to the following square:
// Image container
GLfloat l_vertices[] = {
-1.0f, 1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
1.0f, 1.0f, 0.0f };
Did anyone achieve something similar ?
Edited nov 3, 2012:
Correction of the vertex shader:
attribute vec3 aPosition;
attribute vec2 aTexCoord;
uniform mat4 uMvpTransform;
// Matrix retrieved by getTransformMatrix(...);
uniform mat4 uTexMatTransform;
varying vec2 vTexCoord;
void main(void)
{
gl_Position = uMvpTransform *vec4(aPosition.xyz, 1);
vec4 l_tex = uTexMatTransform*vec4(aTexCoord.xy,0, 1);
vTexCoord=l_tex.xy;
}
with:
// Texture
GLfloat l_texCoord[] = {
0.0f, 1.0f,
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 1.0f
};
share|improve this question
2 Answers 2
up vote 3 down vote accepted
I have used the SurfaceTexture succesfully to draw camera frames on a custom opengl texture without using the transformation matrix provided by android.
Just try defining your indices vertices and textures the way you would do it for a normal texture draw. Like this for example.
const GLfloat Vertices[] = {0.5, -0.5, 0,
0.5, 0.5, 0,
-0.5, 0.5, 0,
-0.5, -0.5, 0};
const GLubyte Indices[] = { 0, 1, 2,
2, 3, 0 };
const GLfloat Textures[] = { 1.,0.,
0.,0.,
0.,1.,
1.,1. };
You should be able to use the surfacetexture the way you use a normal texture.
In case you want to perform some sort of 3D projection, this is a good post on how to generate a proper MVP matrix. Which you could use to multiply with the position in the vertex shader.
share|improve this answer
Good suggestion. Or I can send the correct texture coordinates to the shader. I update the vertex shader so that it may help others. – Fabien R Nov 3 '12 at 17:35
1
Then why are we provided the transform matrix? – Shubhadeep Chaudhuri Oct 5 '13 at 4:05
See Fabien R edit of "Edited nov 3, 2012". I'm adding a short answer to address this point. – Rick77 Sep 21 '14 at 21:23
Since I had the same issue, even though the question is a bit old, it might be worth it to elaborate a bit about "why use the transformation matrix".
The transformation Matrix maps the particular coordinate set used by SurfaceTexture (or more likely, by the current video source streaming into SurfaceTexture...) to the standard OpenGL texture coordinates.
The reason why it should be definitely used is that, although Startibartfast answer works in one or more particular setups, and might be easy and tempting to implement, it might produce strange visualization bugs when the same program is ran on different devices, depending for instance on the video drivers implementation of each platform.
In my case, for instance, the transform matrix just flips the content upside down (I'm using SurfaceTexture in conjunction with the MediaPlayer on Nexus 7) instead of the result pointed out by Fabien R.
The correct way to use the matrix is pointed out in Fabien R edit on nov 3, 2012, which I report with some minor embellishments (like the use of st indexes), and a small correction of int/float mismatch:
attribute vec2 uv;
varying vec2 vTexCoord;
uniform mat4 transformMatrix;
vTexCoord = (transformMatrix * vec4(uv, 0.0, 1.0)).st;
Hope it helps
share|improve this answer
Your Answer
discard
By posting your answer, you agree to the privacy policy and terms of service.
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "http://stackoverflow.com/questions/13200652/displaying-the-camera-stream-on-a-glsurfaceview-via-surfacetexture",
"source_domain": "stackoverflow.com",
"snapshot_id": "crawl=CC-MAIN-2015-35",
"warc_metadata": {
"Content-Length": "83974",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PV3TMTZMF6EJBH676IMQYIR22YXM63MF",
"WARC-Concurrent-To": "<urn:uuid:07641c2f-3587-47f1-9929-4638503341f3>",
"WARC-Date": "2015-08-31T16:42:46Z",
"WARC-IP-Address": "104.16.103.85",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:TG4UPSHDBCIFIDTCPBGX2GHDOCAZGKLU",
"WARC-Record-ID": "<urn:uuid:ef317483-0b3c-403e-8f73-eeb2e3e9a4e2>",
"WARC-Target-URI": "http://stackoverflow.com/questions/13200652/displaying-the-camera-stream-on-a-glsurfaceview-via-surfacetexture",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:3c906ce7-da21-4310-9036-aa09163cef11>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-171-96-226.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2015-35\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for August 2015\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
25,
131,
132,
249,
250,
285,
286,
479,
480,
597,
598,
616,
641,
642,
747,
748,
763,
764,
790,
818,
866,
897,
921,
922,
938,
940,
995,
1052,
1074,
1076,
1077,
1094,
1095,
1142,
1174,
1212,
1213,
1230,
1233,
1290,
1314,
1316,
1317,
1366,
1367,
1387,
1413,
1435,
1458,
1481,
1505,
1506,
1545,
1546,
1566,
1567,
1600,
1601,
1627,
1653,
1681,
1729,
1760,
1784,
1785,
1801,
1803,
1858,
1916,
1938,
1940,
1941,
1947,
1948,
1959,
1984,
1999,
2014,
2030,
2045,
2046,
2049,
2050,
2078,
2079,
2091,
2092,
2121,
2122,
2275,
2276,
2403,
2404,
2446,
2487,
2528,
2571,
2572,
2609,
2648,
2649,
2685,
2721,
2757,
2795,
2796,
2875,
2876,
3064,
3065,
3091,
3096,
3260,
3264,
3353,
3358,
3480,
3481,
3631,
3632,
3839,
3840,
4181,
4182,
4385,
4386,
4590,
4591,
4612,
4640,
4674,
4675,
4730,
4731,
4745,
4746,
4772,
4773,
4785,
4786,
4788,
4796,
4797,
4875,
4876
],
"line_end_idx": [
25,
131,
132,
249,
250,
285,
286,
479,
480,
597,
598,
616,
641,
642,
747,
748,
763,
764,
790,
818,
866,
897,
921,
922,
938,
940,
995,
1052,
1074,
1076,
1077,
1094,
1095,
1142,
1174,
1212,
1213,
1230,
1233,
1290,
1314,
1316,
1317,
1366,
1367,
1387,
1413,
1435,
1458,
1481,
1505,
1506,
1545,
1546,
1566,
1567,
1600,
1601,
1627,
1653,
1681,
1729,
1760,
1784,
1785,
1801,
1803,
1858,
1916,
1938,
1940,
1941,
1947,
1948,
1959,
1984,
1999,
2014,
2030,
2045,
2046,
2049,
2050,
2078,
2079,
2091,
2092,
2121,
2122,
2275,
2276,
2403,
2404,
2446,
2487,
2528,
2571,
2572,
2609,
2648,
2649,
2685,
2721,
2757,
2795,
2796,
2875,
2876,
3064,
3065,
3091,
3096,
3260,
3264,
3353,
3358,
3480,
3481,
3631,
3632,
3839,
3840,
4181,
4182,
4385,
4386,
4590,
4591,
4612,
4640,
4674,
4675,
4730,
4731,
4745,
4746,
4772,
4773,
4785,
4786,
4788,
4796,
4797,
4875,
4876,
4966
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4966,
"ccnet_original_nlines": 145,
"rps_doc_curly_bracket": 0.0032219099812209606,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.25364431738853455,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.017492709681391716,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.34207969903945923,
"rps_doc_frac_unique_words": 0.45428571105003357,
"rps_doc_mean_word_length": 5.122857093811035,
"rps_doc_num_sentences": 78,
"rps_doc_symbol_to_word_ratio": 0.0048590898513793945,
"rps_doc_unigram_entropy": 5.2879133224487305,
"rps_doc_word_count": 700,
"rps_doc_frac_chars_dupe_10grams": 0.09258226305246353,
"rps_doc_frac_chars_dupe_5grams": 0.1271611750125885,
"rps_doc_frac_chars_dupe_6grams": 0.10819855332374573,
"rps_doc_frac_chars_dupe_7grams": 0.10819855332374573,
"rps_doc_frac_chars_dupe_8grams": 0.10819855332374573,
"rps_doc_frac_chars_dupe_9grams": 0.10819855332374573,
"rps_doc_frac_chars_top_2gram": 0.010039039887487888,
"rps_doc_frac_chars_top_3gram": 0.02565532922744751,
"rps_doc_frac_chars_top_4gram": 0.013385389931499958,
"rps_doc_books_importance": -335.6764221191406,
"rps_doc_books_importance_length_correction": -335.6764221191406,
"rps_doc_openwebtext_importance": -263.6539611816406,
"rps_doc_openwebtext_importance_length_correction": -263.6539611816406,
"rps_doc_wikipedia_importance": -203.0169677734375,
"rps_doc_wikipedia_importance_length_correction": -203.0169677734375
},
"fasttext": {
"dclm": 0.5750846266746521,
"english": 0.7633714079856873,
"fineweb_edu_approx": 2.024054527282715,
"eai_general_math": 0.4209088087081909,
"eai_open_web_math": 0.15164929628372192,
"eai_web_code": 0.021250899881124496
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.035",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "005.457",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
2,564,474,338,577,186,300 |
Worker AI Digs on its Own
Avatar
• Views 4,916
• updated
• Pending Customer
[Build]: v2.0.7f1
Windows 10, 64bit, 16GB RAM, Nvidia 750Ti GPU
While building a Custom Campaign, I was testing out some things with Mighty Script in getting a Party to spawn after an Empire's Inhibitor's destruction. As it kept spawning THREE of the same Party, I continued to tinker until I made it only spawn one. HOWEVER! During this time I noticed my own workers digging on their OWN ACCORD to the Empire. The Player in this map is allowed with the Empire AI and the "Underlord 2" AI versus two Underlords. I had multiple Patrols and Parties set up to spawn appropriately. Figuring that the Empire Patrols' Dig Path scripts might have been bugged and somehow enabling for the Player INSTEAD, I removed them. The problem persisted and so I went about disabling all of my script until I found the issue: A Party that spawned a Hero, "Lord of the Land", for the Player. This was an intentional script and was only designed to spawn him and change this name. Disabling fixed my Worker AI. Making a new script that simply changed the name of an existing template of him seemed to not affect my Workers anymore HOWEVER I then noticed that the Empire AI was digging straight to my base and creating an even corridor with a large width, and THEN one of their Patrols was stuck running into a wall in my Dungeon Core that was NOWHERE NEAR their destination (this particular group was only supposed to patrol and defend the Empire's base). Going back to the Mighty Script I unchecked the Patrols of each Empire Party that was to be spawning and attacking the enemy Underlord AI. This seemed to fix the problem, even though I was still noticing the Empire Parties going about their patrols. Without a Dig Path in their script, and with the Patrols unchecked in the Selection, they were still going about their patrol minus digging to the enemy. Uncertain of what specifically caused the workers of mine and the Empire to dig to each other, I'm at a loss to what that issue is and will try to circumvent some of my scripts to not need such. Attached should be two pictures showing different instances of workers breaking (Player's and then the Empire's), as well as a stuck Patrol. Hoping to create a cool and fun Custom Campaign by the end of all of this that folks will enjoy! <3
Image 7385
Image 7384
output_log.txt5 the siege_20191109185026.meta
5 the siege_20191109185026
5 the siege_20191108205251.meta
5 the siege_20191108205251
Game Version:
Steam Public
Platform:
Windows
Avatar
Lee "Noontide" Moon Designer & Community Manager
• Pending Customer
Hi CrimsonTouch,
Can you send us editor files for your level so that we can look into it directly from the map editor and understand your script setup and replicate the issue ourselves.
You can locate the map files with instructions from this article: https://support.brightrockgames.com/knowledge-bases/2/articles/2539-upload-and-share-content-on-the-foundry
Can you also list in bullet points a series of steps to make the issue occur in your map.
Thanks,
Lee
Avatar
CrimsonTouch
I assume these files are what you mean:
• "Script: Spawn a Lord of the Land party On Start"
• This script seemed to be what was causing the issue. I could outright spawn him and then the bugs wouldn't exist, but that wouldn't solve WHY the bugs happened. Disabling it and nothing else, worked. Activating it and nothing else? MY workers, as a Player, would begin digging. Working around it a bit soon had the Empire's Workers digging that wide corridor in one of the above pictures.
• I only noticed this while testing the Necromancer Party because it was spawning multiples of itself until I finally found a convoluted method of scripting to have it spawn the Necromancers properly. Other than the Lord of the Land, nothing else seemed to be an issue.
5 the siege_edit_76561198065620026.meta
5 the siege_edit_76561198065620026
|
{
"url": "https://support.brightrockgames.com/communities/1/topics/5301-worker-ai-digs-on-its-own",
"source_domain": "support.brightrockgames.com",
"snapshot_id": "CC-MAIN-2024-33",
"warc_metadata": {
"Content-Length": "38121",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:QXOWEDDS2FOKMAF3MCQRYRXYPOXMZFZX",
"WARC-Concurrent-To": "<urn:uuid:e917d533-4a34-4c30-a1a5-e172dd40cb88>",
"WARC-Date": "2024-08-06T01:03:55Z",
"WARC-IP-Address": "138.201.250.173",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:57ESYOHJG3AFJLEEMDB6XPD3OJTGP4WN",
"WARC-Record-ID": "<urn:uuid:d4cb9610-f022-4b4c-b513-9c9afed74841>",
"WARC-Target-URI": "https://support.brightrockgames.com/communities/1/topics/5301-worker-ai-digs-on-its-own",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:94c8352d-2def-4050-9031-bd92ffa6494b>"
},
"warc_info": "isPartOf: CC-MAIN-2024-33\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for August 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-209\r\nsoftware: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
26,
27,
34,
50,
62,
83,
84,
102,
103,
149,
150,
2361,
2362,
2373,
2374,
2385,
2386,
2432,
2459,
2491,
2518,
2519,
2533,
2546,
2556,
2564,
2571,
2620,
2641,
2642,
2659,
2660,
2829,
2830,
3004,
3005,
3095,
3096,
3104,
3105,
3109,
3110,
3117,
3130,
3131,
3171,
3172,
3226,
3621,
3895,
3896,
3897,
3898,
3899,
3900,
3940,
3975,
3976
],
"line_end_idx": [
26,
27,
34,
50,
62,
83,
84,
102,
103,
149,
150,
2361,
2362,
2373,
2374,
2385,
2386,
2432,
2459,
2491,
2518,
2519,
2533,
2546,
2556,
2564,
2571,
2620,
2641,
2642,
2659,
2660,
2829,
2830,
3004,
3005,
3095,
3096,
3104,
3105,
3109,
3110,
3117,
3130,
3131,
3171,
3172,
3226,
3621,
3895,
3896,
3897,
3898,
3899,
3900,
3940,
3975,
3976,
3977
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3977,
"ccnet_original_nlines": 58,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.4158291518688202,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04648241028189659,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.1532663255929947,
"rps_doc_frac_unique_words": 0.44294294714927673,
"rps_doc_mean_word_length": 4.738738536834717,
"rps_doc_num_sentences": 36,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.12608003616333,
"rps_doc_word_count": 666,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.017110269516706467,
"rps_doc_frac_chars_top_3gram": 0.00855513010174036,
"rps_doc_frac_chars_top_4gram": 0.012357410043478012,
"rps_doc_books_importance": -388.34991455078125,
"rps_doc_books_importance_length_correction": -388.34991455078125,
"rps_doc_openwebtext_importance": -249.8608856201172,
"rps_doc_openwebtext_importance_length_correction": -249.8608856201172,
"rps_doc_wikipedia_importance": -184.2474822998047,
"rps_doc_wikipedia_importance_length_correction": -184.2474822998047
},
"fasttext": {
"dclm": 0.0923084020614624,
"english": 0.9524209499359131,
"fineweb_edu_approx": 1.5493128299713135,
"eai_general_math": 0.29097115993499756,
"eai_open_web_math": 0.31339532136917114,
"eai_web_code": 0.12202035635709763
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "794.8",
"labels": {
"level_1": "Arts",
"level_2": "Amusements and Recreation",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,306,202,169,356,430,000 |
3
$\begingroup$
In Hanamura's paper Mixed Motives and Algebraic Cycles III
http://intlpress.com/site/pub/files/_fulltext/journals/mrl/1999/0006/0001/MRL-1999-0006-0001-a005.pdf
He proved that if assume Grothendieck's standard conjecture, Murre's conjecture and vanishing conjecture, there is a $t$ structure on Voevodsky's category of mixed motives $\textbf{DM}_{\text{gm}}(k,\mathbb{Q})$, whose heart is an abelian category $\text{MM}(k)$. Each of Betti, etale or de Rham cohomology (realisation) functor \begin{equation} \mathbb{R}\Gamma:\textbf{DM}_{\text{gm}}(k,\mathbb{Q}) \rightarrow D^b(\Lambda-\text{Vec}) \end{equation} (for suitable $\Lambda$) is a $t$-exact functor with respect to this $t$ structure and the natural $t$ structure on $D^b(\Lambda-\text{Vec})$. I have several questions,
1, Is the vanishing conjecture Hanamura assumed in his paper stronger or equivalent to the Beilinson-Soule vanishing conjecture about field $k$?
2, Is $\textbf{DM}_{\text{gm}}(k,\mathbb{Q})$ the bounded derived category of $\text{MM}(k)$?, i.e. $\textbf{DM}_{\text{gm}}(k,\mathbb{Q})=D^b(\text{MM}(k))$? Has this been proved in Hanamura's paper or is it still only a conjecture (even with several conjectures assumed)?
3, Let the restriction of $\mathbb{R}\Gamma$ to $\text{MM}(k)$ be \begin{equation} \Gamma:\text{MM}(k) \rightarrow \Lambda-\text{Vec} \end{equation} Since $\mathbb{R}\Gamma$ is $t$ exact, then $\Gamma$ is an exact functor, therefore the derived functor of $\Gamma$ is well defined. \begin{equation} D\Gamma:D^b(\text{MM}(k)) \rightarrow D^b(\Lambda-\text{Vec}) \end{equation} If 2 is true, if $D\Gamma$ the same as (or equivalent to $\mathbb{R}\Gamma$)? Any references or comments will be sincerely appreciated!
$\endgroup$
2
• $\begingroup$ For (2), see mathoverflow.net/questions/240474/… $\endgroup$ – Jon Pridham Jul 3 '17 at 20:23
• $\begingroup$ Thank you, the example proves the heart $\text{MM}_{k}$ of the $t$ structure of $\text{DM}_{gm}(k,\mathbb{Q})$ is equivalent to Nori's mixed motives $\text{NMM}(k)_{\mathbb{Q}}$, could you elaborate why $\text{DM}_{gm}(k,\mathbb{Q})$ is equivalent to the bounded derived category $D^b(\text{NMM}(k)_{\mathbb{Q}})$? Sorry for these kind of questions, I am a beginner! $\endgroup$ – Wenzhe Jul 3 '17 at 21:00
5
$\begingroup$
1) I believe that the (Murre's) vanishing needed for Hanamura's argument is stronger than the BS conjecture.
2) There are certain standard conditions ensuring that a triangulated category is equivalent to the derived category of the heart of a t-structure on it. Yet I don't known much about them and they were not treated by Hanamura; thus it is not clear which conjectures are needed to answer your question.
3) This should be easy since the category of vector spaces is semi-simple.
$\endgroup$
3
• $\begingroup$ Thank you very much. Ayoub's in his paper a guide to (etale) motivic sheaves gives an ambiguous remark 5.8, i.e. conjecture A and conjecture B, in his paper "L'algebre de Hopf et le groupe de Galois motiviques d'un corps de caracteristique nulle, I." should imply the t structure conjecture of $\textbf{DA}^{et}_{ct}(S,\Lambda)$ andmore, "by more, we have in mind the property that $\textbf{DA}^{et}_{ct}(S,\Lambda)$ is equivalent to the derived category of the heart of its motivic t-structure ". Do you know whether this "more" has been proved or not? $\endgroup$ – Wenzhe Jun 30 '17 at 15:15
• $\begingroup$ It's easy to believe that certain conjectures on the "motivic Hopf algebra" imply the statement you are interested in. Yet I doubt that anybody has written this down carefully. $\endgroup$ – Mikhail Bondarko Jun 30 '17 at 19:22
• $\begingroup$ I would recommend you to contact either Leonid Positselski (positselski.narod.ru, positselski at yandex dot ru) or Sasha Beilinson. $\endgroup$ – Mikhail Bondarko Jul 1 '17 at 6:05
5
$\begingroup$
As I don't have enough rep to comment, I'll have to make my reply to Wenzhe's comment an answer. The example cited in References - Voevodsky motives are the derived category of Nori motives? doesn't just show the heart of the t-structure would be given by Nori's mixed motives, it shows that Voevodsky motives would also have to be the derived category of the heart (the statement $\mathcal{M}_{dg,\mathbb{A}^1}(F,\mathbb{Q})\simeq \mathcal{D}_{dg}(\mathcal{MM}_F)$ in that example).
$\endgroup$
Your Answer
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged or ask your own question.
|
{
"url": "https://mathoverflow.net/questions/273381/clarification-on-hanamuras-work-on-t-structure-of-triangulated-category-of-mi/273621",
"source_domain": "mathoverflow.net",
"snapshot_id": "crawl=CC-MAIN-2021-17",
"warc_metadata": {
"Content-Length": "147854",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:JP3KKS4CN5QJYSMBIEA6YIK5LI67PTNB",
"WARC-Concurrent-To": "<urn:uuid:9768f8d6-098a-49ab-925d-ad7f6e5cd61d>",
"WARC-Date": "2021-04-20T13:54:46Z",
"WARC-IP-Address": "151.101.193.69",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:KK2YL5B35AU5O72YWRT6LR7BGSAXZ576",
"WARC-Record-ID": "<urn:uuid:83c2dd15-11fe-4c84-8119-93aba9aa1234>",
"WARC-Target-URI": "https://mathoverflow.net/questions/273381/clarification-on-hanamuras-work-on-t-structure-of-triangulated-category-of-mi/273621",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:63c0471d-ecd7-478b-8034-be500bf9b99d>"
},
"warc_info": "isPartOf: CC-MAIN-2021-17\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for April 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-126.ec2.internal\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
2,
16,
17,
76,
77,
179,
180,
801,
802,
947,
948,
1222,
1223,
1735,
1736,
1748,
1750,
1862,
2287,
2289,
2303,
2304,
2413,
2414,
2716,
2717,
2792,
2793,
2805,
2807,
3420,
3666,
3865,
3867,
3881,
3882,
4366,
4367,
4379,
4380,
4392,
4393,
4493,
4494
],
"line_end_idx": [
2,
16,
17,
76,
77,
179,
180,
801,
802,
947,
948,
1222,
1223,
1735,
1736,
1748,
1750,
1862,
2287,
2289,
2303,
2304,
2413,
2414,
2716,
2717,
2792,
2793,
2805,
2807,
3420,
3666,
3865,
3867,
3881,
3882,
4366,
4367,
4379,
4380,
4392,
4393,
4493,
4494,
4584
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 4584,
"ccnet_original_nlines": 44,
"rps_doc_curly_bracket": 0.027486909180879593,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2554621696472168,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.05126050114631653,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.37310925126075745,
"rps_doc_frac_unique_words": 0.4294871687889099,
"rps_doc_mean_word_length": 5.439102649688721,
"rps_doc_num_sentences": 37,
"rps_doc_symbol_to_word_ratio": 0.0008403399842791259,
"rps_doc_unigram_entropy": 5.156599998474121,
"rps_doc_word_count": 624,
"rps_doc_frac_chars_dupe_10grams": 0.025928109884262085,
"rps_doc_frac_chars_dupe_5grams": 0.034177958965301514,
"rps_doc_frac_chars_dupe_6grams": 0.034177958965301514,
"rps_doc_frac_chars_dupe_7grams": 0.025928109884262085,
"rps_doc_frac_chars_dupe_8grams": 0.025928109884262085,
"rps_doc_frac_chars_dupe_9grams": 0.025928109884262085,
"rps_doc_frac_chars_top_2gram": 0.02062463015317917,
"rps_doc_frac_chars_top_3gram": 0.02504419907927513,
"rps_doc_frac_chars_top_4gram": 0.023571010679006577,
"rps_doc_books_importance": -578.2398681640625,
"rps_doc_books_importance_length_correction": -578.2398681640625,
"rps_doc_openwebtext_importance": -371.49212646484375,
"rps_doc_openwebtext_importance_length_correction": -371.49212646484375,
"rps_doc_wikipedia_importance": -293.4447021484375,
"rps_doc_wikipedia_importance_length_correction": -293.4447021484375
},
"fasttext": {
"dclm": 0.06579923629760742,
"english": 0.8223077654838562,
"fineweb_edu_approx": 1.5630443096160889,
"eai_general_math": 0.46254628896713257,
"eai_open_web_math": 0.7447519898414612,
"eai_web_code": 0.0005555700045078993
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "516.35",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry, Algebraic"
}
},
"secondary": {
"code": "512.64",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Algebra"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "4",
"label": "Analyze"
},
"secondary": {
"code": "5",
"label": "Evaluate"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "1",
"label": "Leftover HTML"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "3",
"label": "Academic Writing"
}
},
"reasoning_depth": {
"primary": {
"code": "4",
"label": "Advanced Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
9,146,610,258,388,968,000 |
Permalink
Browse files
added the final exams sql note
• Loading branch information...
yangchenyun committed Mar 27, 2013
1 parent 2951b59 commit 2a60f4b57cbf12e617ac3acdfd31ffc4f9e40c17
Showing with 122 additions and 0 deletions.
1. +122 −0 6.final_exam.sql
View
@@ -0,0 +1,122 @@
+/* Questions 10 */
+-- R(A) = { (1) }
+-- S(B) = { (2), (2), (3) }
+
+create trigger First
+ after insert on R
+ for each row
+ update S set B = 3 where B = New.A
+;
+
+create trigger Second
+ after update on S
+ for each row
+ update R set A = A+1
+;
+
+insert into R values (2)
+/* -> */
+update S set B = 3 where B = 2
+/* S(B) = { (3), (3), (3) } */
+/* -> */
+/* there are two tuples updated */
+update R set A = A+1
+/* R(A) = { (2), (3) } */
+update R set A = A+1
+/* R(A) = { (3), (4) } */
+
+/* Questions 11 */
+-- T(A) = { (1), (1), (2), (3) }
+
+/* to make the two triggers no difference, */
+/* the row-level trigger should be executed only once */
+
+create trigger RowLevel
+ after update on T
+ for each row
+ insert into T values (0)
+
+create trigger StatementLevel
+ after update on T
+ insert into T values (0)
+
+/* Question 12 - 14 */
+-- Bid(item,price)
+
+/* S1, S2, S3, and S4 within the transactions each execute atomically.
+meaning: update is atomic. */
+/* T1 - Always Serializable */
+ /* S1: update Bid set price = price + 5 */
+ /* S2: insert into Bid values (desktop,30) */
+/* T2 */
+ /* S3: select sum(price) as s from Bid */
+ /* S4: select max(price) as m from Bid */
+
+/* T2 - Serializable */
+-- T1, T2: s = 70, m = 30
+-- T2, T1: s = 30, m = 20
+
+/* T2 - Read Committed */
+-- T1, T2: s = 70, m = 30
+-- T2, T1: s = 30, m = 20
+-- S3, T1, S4: s = 30, m = 30
+
+/* T2 - Read Un-Committed */
+-- T1, T2: s = 70, m = 30
+-- T2, T1: s = 30, m = 20
+-- S3, T1, S4: s = 30, m = 30
+-- S3(10, 20), S1(15, 25), S4(25), S2: s = 30, m = 25
+-- S1(15, 25), S3(40), S4(25), S2: s = 40, m = 25
+-- S1(15, 25), S3(40), S2(15, 25, 30), S4(30): s = 40, m = 30
+
+/* Question 15 - updatable view */
+/* cannot, aggregation is used */
+create view V as select person, avg(score) from Rating group by person
+/* cannot, involved in two relations */
+create view V as select Movie.title, director, person, score from Movie, Rating where Movie.title = Rating.title
+/* cannot, select distinct is used instead of select */
+create view V as select distinct(director) from Movie
+
+create view V as select title, director from Movie where title in (select title from Rating where score > 3)
+
+/* Question 18 */
+/* G(n1,n2,label) */
+/* a directed edge from node n1 to node n2 with the given label */
+/* n1 -> n2 */
+
+/* the length of (i.e., the number of edges in) the longest path */
+/* in the graph that contains red edges only. */
+with recursive
+ Path(n1, n2, length) as
+ (
+ /* The first round path available */
+ select (n1, n2, 1) from G where label = 'red'
+ union
+ select P.n1, G.n2, P.length + 1
+ from Path P, G
+ where P.n2 = G.n1
+ and G.label = 'red'
+ )
+
+/* Question 19 */
+create view FlightRollup
+ select origin, destination, airline, sum(price) as p from Flight
+ group by origin, destination, airline with rollup;
+
+-- ROLLUP
+-- origin, destination, airline
+-- value, value, value
+-- value, value, null
+-- value, null, null *
+-- null, null, null
+
+-- CUBE
+-- origin, destination, airline
+-- value, value, value *
+-- value, value, null
+-- value, null, value
+-- null, value, value
+-- value, null, null *
+-- null, value, null
+-- null, null, value
+-- null, null, null
0 comments on commit 2a60f4b
Please sign in to comment.
|
{
"url": "https://github.com/yangchenyun/dbclass-exercises/commit/2a60f4b57cbf12e617ac3acdfd31ffc4f9e40c17",
"source_domain": "github.com",
"snapshot_id": "crawl=CC-MAIN-2018-09",
"warc_metadata": {
"Content-Length": "88073",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:O6HAZG5T3WOSIALLR7AKH6I2ZGVN42RC",
"WARC-Concurrent-To": "<urn:uuid:a2aeeaeb-ae18-412a-a5a2-6271625f3bab>",
"WARC-Date": "2018-02-24T12:57:58Z",
"WARC-IP-Address": "192.30.253.112",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:EASEP2SCYHK2VKLXSF72455ECX2U5LLL",
"WARC-Record-ID": "<urn:uuid:5dcda194-114c-4ee1-878f-713e4bbc0232>",
"WARC-Target-URI": "https://github.com/yangchenyun/dbclass-exercises/commit/2a60f4b57cbf12e617ac3acdfd31ffc4f9e40c17",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:b7f0637e-0a73-4cef-92b0-20ea4330ff73>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-164-50-22.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-09\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for February 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
10,
23,
24,
55,
56,
90,
125,
190,
234,
264,
269,
287,
307,
326,
355,
357,
379,
399,
414,
451,
454,
456,
479,
499,
514,
537,
540,
542,
568,
578,
610,
642,
652,
688,
710,
737,
759,
786,
788,
808,
842,
844,
891,
949,
951,
976,
996,
1011,
1038,
1040,
1071,
1091,
1118,
1120,
1144,
1164,
1166,
1238,
1269,
1301,
1346,
1394,
1404,
1448,
1492,
1494,
1519,
1546,
1573,
1575,
1602,
1629,
1656,
1687,
1689,
1719,
1746,
1773,
1804,
1859,
1910,
1973,
1975,
2011,
2046,
2118,
2159,
2273,
2330,
2385,
2387,
2497,
2499,
2518,
2540,
2608,
2624,
2626,
2695,
2745,
2761,
2787,
2791,
2830,
2878,
2886,
2920,
2937,
2957,
2979,
2983,
2985,
3004,
3030,
3097,
3150,
3152,
3163,
3196,
3220,
3243,
3267,
3288,
3290,
3299,
3332,
3358,
3381,
3404,
3427,
3451,
3473,
3495,
3516,
3517,
3546,
3547
],
"line_end_idx": [
10,
23,
24,
55,
56,
90,
125,
190,
234,
264,
269,
287,
307,
326,
355,
357,
379,
399,
414,
451,
454,
456,
479,
499,
514,
537,
540,
542,
568,
578,
610,
642,
652,
688,
710,
737,
759,
786,
788,
808,
842,
844,
891,
949,
951,
976,
996,
1011,
1038,
1040,
1071,
1091,
1118,
1120,
1144,
1164,
1166,
1238,
1269,
1301,
1346,
1394,
1404,
1448,
1492,
1494,
1519,
1546,
1573,
1575,
1602,
1629,
1656,
1687,
1689,
1719,
1746,
1773,
1804,
1859,
1910,
1973,
1975,
2011,
2046,
2118,
2159,
2273,
2330,
2385,
2387,
2497,
2499,
2518,
2540,
2608,
2624,
2626,
2695,
2745,
2761,
2787,
2791,
2830,
2878,
2886,
2920,
2937,
2957,
2979,
2983,
2985,
3004,
3030,
3097,
3150,
3152,
3163,
3196,
3220,
3243,
3267,
3288,
3290,
3299,
3332,
3358,
3381,
3404,
3427,
3451,
3473,
3495,
3516,
3517,
3546,
3547,
3573
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3573,
"ccnet_original_nlines": 137,
"rps_doc_curly_bracket": 0.0033585201017558575,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.14202898740768433,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.09082125872373581,
"rps_doc_frac_lines_end_with_ellipsis": 0.0072463802061975,
"rps_doc_frac_no_alph_words": 0.530434787273407,
"rps_doc_frac_unique_words": 0.3719165027141571,
"rps_doc_mean_word_length": 4.132827281951904,
"rps_doc_num_sentences": 21,
"rps_doc_symbol_to_word_ratio": 0.0009661799995228648,
"rps_doc_unigram_entropy": 4.864162921905518,
"rps_doc_word_count": 527,
"rps_doc_frac_chars_dupe_10grams": 0.09550046175718307,
"rps_doc_frac_chars_dupe_5grams": 0.22865013778209686,
"rps_doc_frac_chars_dupe_6grams": 0.14921946823596954,
"rps_doc_frac_chars_dupe_7grams": 0.13544535636901855,
"rps_doc_frac_chars_dupe_8grams": 0.11891643702983856,
"rps_doc_frac_chars_dupe_9grams": 0.09550046175718307,
"rps_doc_frac_chars_top_2gram": 0.045913681387901306,
"rps_doc_frac_chars_top_3gram": 0.04820936918258667,
"rps_doc_frac_chars_top_4gram": 0.02387510985136032,
"rps_doc_books_importance": -420.1988525390625,
"rps_doc_books_importance_length_correction": -420.1988525390625,
"rps_doc_openwebtext_importance": -283.9906311035156,
"rps_doc_openwebtext_importance_length_correction": -283.9906311035156,
"rps_doc_wikipedia_importance": -235.13482666015625,
"rps_doc_wikipedia_importance_length_correction": -235.13482666015625
},
"fasttext": {
"dclm": 0.6575268507003784,
"english": 0.7644915580749512,
"fineweb_edu_approx": 1.84639573097229,
"eai_general_math": 0.540632963180542,
"eai_open_web_math": 0.7938355803489685,
"eai_web_code": 0.052065011113882065
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.746",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-4,019,476,500,919,912,400 |
Spinners give users instant feedback when the system needs more time to complete a task or display information.
Usage
Our users expect experiences that quickly accomplish tasks and display information. But sometimes doing those things takes a little time. During that lag, it’s important to show loading spinners because they let users know the system is working and will catch up.
There are 4 types of loading spinners. The four types are: determinate short, determinate long, indeterminate short, and indeterminate long
Determinate loading spinners
Determinate spinners are used when at any point we know the beginning and end points, whether it be time or steps. The visual should show a sense of completeness to be considered determinate.
Determinate short
Use when % of time to load is available
Determinate long
Use when % of time to load is available and more than 4 seconds
Indeterminate loading spinners
Indeterminate spinners are used when at any point the time or steps are not known. Instead of a visual for “completeness”, there is a visual that shows indication that something is happening in the background. Sometimes there can be content associated with the spinner to reinforce to the users that something is happening in the background.
The system should be fast enough so that we don’t need to display this spinner. However, should you use this component, use it sparingly.
Indeterminate short
Use when % of time to load is unavailable
Indeterminate long
Use when % of time to load is unavailable, but estimated that it will be more than 4 seconds
Lazy loading
Sometimes the user can initiate loading more content by clicking or scrolling. In this case, we allow for lazy loading; the infinite loader appears until the content does. Nothing in the application should be disabled.
• Was this Helpful?
•
|
{
"url": "https://designsystem.quickbooks.com/component/spinners/",
"source_domain": "designsystem.quickbooks.com",
"snapshot_id": "crawl=CC-MAIN-2020-40",
"warc_metadata": {
"Content-Length": "172359",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:5IP7APFND7PZFAZUAEFJ25IVUKU3VADA",
"WARC-Concurrent-To": "<urn:uuid:2d10381e-ebde-4360-8f5b-b1906bbc7b09>",
"WARC-Date": "2020-10-01T01:16:18Z",
"WARC-IP-Address": "34.67.143.110",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:Q347TX6WNIW63CDV3FPYRUS7WMI7ZE27",
"WARC-Record-ID": "<urn:uuid:86582cdb-eabd-49d2-a1b7-60f8332e16a2>",
"WARC-Target-URI": "https://designsystem.quickbooks.com/component/spinners/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:d7481788-413f-45c7-b136-946a03197b42>"
},
"warc_info": "isPartOf: CC-MAIN-2020-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-108.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
112,
113,
119,
120,
384,
385,
525,
526,
528,
529,
558,
559,
751,
752,
754,
755,
773,
774,
814,
815,
832,
833,
897,
898,
900,
901,
932,
933,
1275,
1276,
1414,
1415,
1417,
1418,
1438,
1439,
1481,
1482,
1484,
1485,
1504,
1505,
1598,
1599,
1601,
1602,
1615,
1616,
1835,
1836,
1858
],
"line_end_idx": [
112,
113,
119,
120,
384,
385,
525,
526,
528,
529,
558,
559,
751,
752,
754,
755,
773,
774,
814,
815,
832,
833,
897,
898,
900,
901,
932,
933,
1275,
1276,
1414,
1415,
1417,
1418,
1438,
1439,
1481,
1482,
1484,
1485,
1504,
1505,
1598,
1599,
1601,
1602,
1615,
1616,
1835,
1836,
1858,
1865
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1865,
"ccnet_original_nlines": 51,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.443113774061203,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.11976048350334167,
"rps_doc_frac_unique_words": 0.4343434274196625,
"rps_doc_mean_word_length": 5.010100841522217,
"rps_doc_num_sentences": 16,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.5270891189575195,
"rps_doc_word_count": 297,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.18682795763015747,
"rps_doc_frac_chars_dupe_6grams": 0.18682795763015747,
"rps_doc_frac_chars_dupe_7grams": 0.18682795763015747,
"rps_doc_frac_chars_dupe_8grams": 0.09543011337518692,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.02016128972172737,
"rps_doc_frac_chars_top_3gram": 0.024193549528717995,
"rps_doc_frac_chars_top_4gram": 0.03494624048471451,
"rps_doc_books_importance": -156.19969177246094,
"rps_doc_books_importance_length_correction": -156.16099548339844,
"rps_doc_openwebtext_importance": -82.57579040527344,
"rps_doc_openwebtext_importance_length_correction": -82.57579040527344,
"rps_doc_wikipedia_importance": -51.605857849121094,
"rps_doc_wikipedia_importance_length_correction": -51.6058349609375
},
"fasttext": {
"dclm": 0.0221868809312582,
"english": 0.8803209066390991,
"fineweb_edu_approx": 2.4380671977996826,
"eai_general_math": 0.24925249814987183,
"eai_open_web_math": 0.401896595954895,
"eai_web_code": 0.25275564193725586
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.019",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-175,360,310,020,399,800 |
Kerbal Space Program
Reply to topic
6124 posts • Previous
• 1
• ...
• 31
• 32
• 33
• ...
• 154
• Next
A few more docking tips/comments:
• Always use symmetry for installing RCS quads... 4x seems to work best, but 6x & 8x also work & give greater fore/aft thrust. 2x and 3x don't work as well.
• Use the COM indicator (below parts menu) with your 'orbital' stage to install RCS prior to building the rest of your launch vehicle. Either place the RCS 'ring' at the COM or matched above and below.
• For maneuvering, I prefer activating ASAS with 'T' then using 'F' to temporarily disable ASAS and/or reset the ASAS target.
• Tapping 'F' to kill rotation works better for me than toggling ASAS with 'T'
• If ASAS is on and translation causes rotation (i.e. RCS imbalance) give ASAS a second and it will correct... be patient and use small RCS bursts to induce translation if this happens.
• If you don't have an analog controller (gamepad, joystick) then precise control (CAPSLOCK) or using a mod (HydroJeb is an example) to reduce rotation and translation input goes a long way to making docking and other maneuvers easier. Additionally, HydroJeb has a VAB panel that gives you the max accel (translation & rotation) that RCS can provide which helps to size the RCS properly. Note - takes the whole vehicle into account so build the 'orbital stage' first, size the RCS, then move to the lifter.
• HydroJeb allows the RCS translation and rotation to be set independently - use it. RCS for rotation is often too powerful if the RCS allows for easy translation for docking.
• The command pod torque is usually sufficient - so turn off RCS to rotate the vehicle, stop the rotation, and then turn on RCS for translation. Save a bit of monoprop and avoid consuming RCS due to oscillations / over-correction
• Thus far nobody has released a 'configurable PID' controller... ASAS is just a PID but its gains aren't optimal for large, bendy ships or ships with lots of RCS control authority. If I knew how to program in C# I'd take a crack at it as controls is my background but alas C# isn't MATLAB and I'm rusty.
Also, once you're within 100 meters or so, right-click on the specific docking port you're going for. Then you can use a mod like Smart ASS to keep you pointed right at it. This + SAS is pretty clutch for slowly powering in once you're more or less in an approach cone and you've killed other relative vectors (ie, you're in the same orbit and within 100m, but not docked yet)
Success, after 12 attempts to land some base modules together, I have finally gotten two of them together. As a side note, the difference between orbital bombardment and building a base on another planet is actually very vague. If there are martians (or Dunians) on Duna, I may have accidentally started a war.
Spoiler: show
Image
However, the docking ports refuse to work, so I can't actually assemble the base, and I somehow broke 4 out of my 5 solar panels. I think I have to go back to the drawing board on this, probably make each base section bigger so I don't have to assemble as many pieces, but I also need some way to land them accurately because orbital ballistic trajectories are really hard to aim accurately.
And I just have to show off my solution to refueling my ships before I started using the cheat parts. Behold the ugly fuel lifter MK 2:
Spoiler: show
Image
It is hard to see the center, but it can get all 7 central fuel tanks into orbit full, the central tank is used for orbital manuevers, and with care it can usually give me 6+ full orange tanks of fuel. Of course, there is absolutely no elegance to the design, just a lot of engines.
Here is my first attempt at a space station.
Spoiler: show
Multiple pieces of testing out fuel tanks, solar arrays, a space tug, habitation modules, and orbital tugs to get pieces to the central node.
Image
Image
The orange tank is part of the refuel rocket left for storage of spent rockets. If you look close you can see the 5-stack of RCS tanks in the middle of several different modules.
After seeing what worked and what did not, I changed my design idea. Instead of trying to use stock station design parts and add a truss for service modules (fuel, solar arrays, extra docking ports) I realized that a central truss that everything docks to would work better. Another thing I found out... messing and mixing Clamp-o-tron's with Clamp-o-tron Jr's just makes life difficult. Stick to one type of docking ring to everything. Also, having effective SAS so I could control orientation without using RCS and adding unwanted momentum would stop the pain of spinning out of control during docking. Lastly, making the truss itself a pilot-able craft with a perfect center of gravity and RCS at the corners will take out the problem of steering a big hulk with a tiny engine at one end flexing around like a cheap ruler.
So here it is... the Mega Truss.
Spoiler: show
On the Pad.....
Image
On Orbit with its orbital tug attached
Image
After trying and creating multiple launch failures worthy of song, I finally got it to orbit. Have yet to start testing to see how maneuverable the design is on orbit and if it has enough SAS to turn without using RCS. Will eventually launch a second truss to dock to the end of the first to see how well they fly together. Then its time to start sending up modules!
*blinks*
That's no moon...
frozentech wrote:
He means for the return trip to Kerbin. Much harder to land under power on Kerbin especially when you've detached the crew module for splash down, only to find there is no chute to slow down your re-entry, turning your Kerbal return into a balastics test with live test dummies.
(if I recall the original story correctly)
You did indeed :)
To Einbrecher - my first Munar orbit mission was going well right up to the point when I tried to deploy a non-existent parachute. Mashing the spacebar didnt work too well and my first ever attempt at lithobraking (great word btw :) ) didn't really work either.
I havn't tried a Munar landing yet. Bit tricky (although far from impossible I'm sure) with just demo game parts and besides landing Jeb on the Mun but not letting him go outside and explore probably counts as a cruel and unusual punishment!
I have the latest version now but I'm very much in the Gemini Program stage of development - trying out docking and EVAs. The post by LonghornChris04 will most likely get printed out and stuck to a wall near my computer!
Einbrecher wrote:
So, I finally broke down and gave MechJeb a try...holy crap! I can land stuff on Mun I could barely get off the surface of Kerbin via manual (keyboard) controls. It takes a bit to get used to all of the buttons, but it's a pretty comprehensive autopilot system - beats the crap out of the SAS and ASAS systems.
Granted, I'm not sure this is a net positive, but my rocket stacks have severely shrunk as well.
The last time I tried MechJeb it kept trying to hover my rocket at about 1.5km above the ground and wouldn't go any higher. It was surreal to watch.
Staubo wrote:
Here is my first attempt at a space station.
Spoiler: show
Multiple pieces of testing out fuel tanks, solar arrays, a space tug, habitation modules, and orbital tugs to get pieces to the central node.
Image
Image
The orange tank is part of the refuel rocket left for storage of spent rockets. If you look close you can see the 5-stack of RCS tanks in the middle of several different modules.
After seeing what worked and what did not, I changed my design idea. Instead of trying to use stock station design parts and add a truss for service modules (fuel, solar arrays, extra docking ports) I realized that a central truss that everything docks to would work better. Another thing I found out... messing and mixing Clamp-o-tron's with Clamp-o-tron Jr's just makes life difficult. Stick to one type of docking ring to everything. Also, having effective SAS so I could control orientation without using RCS and adding unwanted momentum would stop the pain of spinning out of control during docking. Lastly, making the truss itself a pilot-able craft with a perfect center of gravity and RCS at the corners will take out the problem of steering a big hulk with a tiny engine at one end flexing around like a cheap ruler.
So here it is... the Mega Truss.
Spoiler: show
On the Pad.....
Image
On Orbit with its orbital tug attached
Image
After trying and creating multiple launch failures worthy of song, I finally got it to orbit. Have yet to start testing to see how maneuverable the design is on orbit and if it has enough SAS to turn without using RCS. Will eventually launch a second truss to dock to the end of the first to see how well they fly together. Then its time to start sending up modules!
Excellent idea/work with the truss/super structure approach. I think I will do something similar to build my spacestation of doom. With liberal usage of quantum stuts and strut guns I should be able to house 20 astronauts with 5-6 landers. Then I can visit every planet, land on it, leave a probe and come back to kerbin.
Now I really want some kind of on-orbit VAB ability :(
Now I really want some kind of on-orbit VAB ability
http://kerbalspaceport.com/orbitalconstruction/
Thanks! I can't wait to check that out at home.
Victory is mine!
Spoiler: show
Image
Thanks everyone for the advice.
Key points:
* RCS thrusters centered on the center of mass of the vehicle. This craft has two rings of 4 RCS units each; the first is at the COM of the command module. When the booster stage is still attached (as it is here), that ring is well above the revised COM; the second ring is the same distance below that COM.
* Even with balanced thrusters, aligning the two ships on a common axis is a pain. Eventually, I gave up and let MechJeb's SmartASS module deal with orientation (the 'Parallel -' mode keeps the two ships anti-aligned) while I did the lateral positioning by hand.
* Chase mode camera, with the camera directly behind the ship, helps a lot in getting the x-y positioning right, and then just need to ease forward in z.
* Patience and practice...
Now, onward to the next challenge...
Nice work.
baloroth wrote:
dmsilev wrote:
Anyone have tips on docking? My problem is matching velocities between the two craft; I can get to within a couple of km of distance and maybe 15 m/s relative velocity, but nulling out the last bits of relative v eludes me. Should I be trying to match apo/peri -apsis to the exact meter or something?
Set your target as your target on the map screen. Look down at your navball. If you rotate around, you should see a green circle and a green circle with an X mark. The first is your direction of motion relative to the target, the second is the reverse of that (it's confusing because that marking is also used for orbital directions when a target is not set). Pink is the direction to your target, don't try to eyeball it, that only sort-of works.
Aha! That makes it all a bit clearer - I didn't realise that the green markings switched to show motion relative to target rather than orbital motion. In hindsight it should have been obvious I guess but meh - that's hindsight for you.
So basically if the green circle is lined up with the pink circle and both are lined up with the pointy triangle thing, then you're pointing and *moving* towards the target and everything is good? I love these technical descriptions :)
Managed to get within 1.5km of docking last night. Hopefully things will go better next time now that I have slightly more clue.
Ianal wrote:
baloroth wrote:
dmsilev wrote:
Anyone have tips on docking? My problem is matching velocities between the two craft; I can get to within a couple of km of distance and maybe 15 m/s relative velocity, but nulling out the last bits of relative v eludes me. Should I be trying to match apo/peri -apsis to the exact meter or something?
Set your target as your target on the map screen. Look down at your navball. If you rotate around, you should see a green circle and a green circle with an X mark. The first is your direction of motion relative to the target, the second is the reverse of that (it's confusing because that marking is also used for orbital directions when a target is not set). Pink is the direction to your target, don't try to eyeball it, that only sort-of works.
Aha! That makes it all a bit clearer - I didn't realise that the green markings switched to show motion relative to target rather than orbital motion. In hindsight it should have been obvious I guess but meh - that's hindsight for you.
So basically if the green circle is lined up with the pink circle and both are lined up with the pointy triangle thing, then you're pointing and *moving* towards the target and everything is good? I love these technical descriptions :)
Managed to get within 1.5km of docking last night. Hopefully things will go better next time now that I have slightly more clue.
For the initial approach, what eventually worked for me was an iterative process:
1) Rotate ship so that you're aligned with the retrograde velocity marker. Burn (slowly) with main engine until the relative velocity reads close to zero. Like under 1 m/s.
2) Flip the ship around and orient with the prograde position marker (the purple one). Burn with main engine until you get about 20 or 30 m/s of closing velocity
3) Keep an eye on the distance between you and target. Once it stops decreasing (i.e. you've reached the point of closest approach), go back to step 1.
With care, this will get you to within 20 or so meters of the target. Now it's time to switch to RCS and follow everyone else's advice on the last steps.
If you're using the MechJeb mod, open up the Rendezvous module. It doesn't really do any control, but it does give you a bunch of useful data (velocity with an additional digit of precision, distance of closest approach, time to closest approach) which helps in making the process a bit more efficient.
^^ I basically just do that, except I eyeball it and then use RCS once I'm within 1km or so. The most helpful thing the rendezvous module does is align your orbits on the correct plane.
ALSO, don't be a afraid to swap out to the station to orient it the way you want to make docking easier. ESPECIALLY if it's spinning.
Fidel Cashflow wrote:
^^ I basically just do that, except I eyeball it and then use RCS once I'm within 1km or so. The most helpful thing the rendezvous module does is align your orbits on the correct plane.
ALSO, don't be a afraid to swap out to the station to orient it the way you want to make docking easier. ESPECIALLY if it's spinning.
This is important, align both ships rather than trying to spin around one.
Aligning -- it will be easier to dock the station if the line between you and the target is pointing north/south; that way, the face of the docking port isn't turning away from you as the target travels along its orbit.
That is, for example, with a docking port at the 'top' of the target, the target is oriented with the navball centered at either 0 or 180 on the horizon line.
The station will still rotate as it orbits, but this way the rotation won't screw with your docking. Just roll if you care about panels lining up or whatever.
Image
I feel like a space program should be more complicated than that.
I mean, it isn't, but I feel like it should be.
Some notes on aerobraking. I had some spare delta-V on the return leg from my first successful Munar landing (Wooo!) and decided to play around with aerobraking at various altitudes to see how well it worked.
After leaving the Mun, I injected into an elongated Kerbin orbit, apoapsis of about 3.2 mega meters and then burned enough to bring the periapsis down to 65 km initially and then lower. Peak speed at periapsis started out at something north of 3 km/sec. Ship was a fairly low-drag affair, consisting of a command capsule and a fairly small booster/tank service module.
Aerobraking at 65 km, the apoapsis was barely changed; dropping less than one percent
At 60 km, apoapsis dropped by a percent or so
At 50, apoapsis dropped from 3.2 down to 2.8 Mm, maybe around 12 or 13 percent drop
At 40, apoapsis dropped from 2.8 to 1.2 on the first pass (with a slight drop in periapsis down to 39). Second pass at 39 dropped the apo down to about 400 km and peri down to 38. Third and final pass started at 38, got down to 35 and was still dropping, at which point I popped my chute and started the landing cycle.
So, for aerobraking in Kerbin, anything above about 50 km is basically a waste of time. Somewhere in the 40 to 45 range is good, and anything lower than 40 you better be careful that you don't convert your aerobrake into a lithobrake.
Staubo - let's see some mega truss pics.
My space program is proceeding nicely. First successful orbital docking (need to get a Flickr account or similar so I can link to screenshots) and first successful EVA. My prototype deep space probe is sitting in what would be a stationary orbit above Kerbin if it wasn't tilted 90 degrees into a polar orbit. There should be plenty of delta v there for interplanetary missions.
For now though I'm working on a space station. Core module is in orbit with a habitation module set to join it. Not going to be much compared to the behemoths on this thread but hey - it'll still be a half dozen modules all linked together by the time I'm done. Might try a Surveyer style unmanned Mun landing if I get bored of station building.
For orbital missions I've also found a way of getting rid of my upper stages to avoid cluttering the 100-200km orbits with spent rockets or having those same rockets randomly stuck onto my station. Just attach four Separatrons pointing retrograde and link them with the appropriate decoupler. Makes the upper stage a little heavier but works very nicely for deorbiting it. Nothing terribly clever but it was still satisfying to see a plan come together and work!
I too, am crazy and require all of my tugs/upper stages to have de-orbit capabilities.
Ianal wrote:
need to get a Flickr account or similar so I can link to screenshots
http://imgur.com
Motherfucker...
A three stage rocket with strap-on boosters JUST got me to Minmus orbit. The SAME rocket, under MechJeb, LANDED THE GODDAMNED SECOND STAGE on Minmus.
Nobody knows what made Jeb such a great rocket pilot...
I know what makes Jeb a great pilot.
Spoiler: show
Not being you.
Yeah :(
A three stage rocket with strap-on boosters JUST got me to Minmus orbit. The SAME rocket, under MechJeb, LANDED THE GODDAMNED SECOND STAGE on Minmus.
There's something to be said for optimal transfer windows.
Magus` wrote:
A three stage rocket with strap-on boosters JUST got me to Minmus orbit. The SAME rocket, under MechJeb, LANDED THE GODDAMNED SECOND STAGE on Minmus.
There's something to be said for optimal transfer windows.
And gravity turns (ascent & descent), limiting air drag losses (MechJeb keeps atmo velocity on launch at 'terminal' velocity to keep drag down), optimized orbit entry (assuming stable orbit prior to exit burn), etc.
If it makes you feel any better, autopilots are better than humans at nearly all space related tasks if they are programmed correctly. That and MechJeb has access to information that isn't available in the GUI. As an example, MechJeb can easily calculate the proper velocity for your climb to keep air drag down based on the current air density. A mod can add that speed to the GUI and you can fly it... or let MechJeb do it for you. Either way, its a game so as long as you are having fun.
I've decided I need a space station. That way I'll be forced to learn how to dock :)
Magus` wrote:
I've decided I need a space station. That way I'll be forced to learn how to dock :)
Its easier to learn with 2 identical ships... but why start with the easy way ;)
Oh, I was planning on learning like that, but I meant that docking is required for a station, whereas it hasn't been for everything else I've been doing, so I've been putting it off :)
Magus` wrote:
Oh, I was planning on learning like that, but I meant that docking is required for a station, whereas it hasn't been for everything else I've been doing, so I've been putting it off :)
Docking is quite satisfying.
For a station, I recommend you download the quantum strut mod. The docking ports aren't very strong, so you will get wobbles at the connections. If you've got RCS and ASAS on both sides of the port. The no mods method is to use multiple docking ports... which is best done with the 2x and 3x couplers and is still hard to get lined up.
The other option is to use quantum struts which work like regular struts when on, except for needing power. For a station this should be a non-issue, just make sure you've got a few batteries for eclipse. Once the 2 ships dock and become a 'single ship' the struts become active.
Yah I already have the quantum struts mod. I just need to actually play more; I've been a bit distracted with Path of Exile ;)
I'm still barely able to break orbit. :(
Magus` wrote:
A three stage rocket with strap-on boosters JUST got me to Minmus orbit. The SAME rocket, under MechJeb, LANDED THE GODDAMNED SECOND STAGE on Minmus.
There's something to be said for optimal transfer windows.
The transfer windows MechJeb uses are pretty shitty. It's "What's the next direct Hohmann I can do to this object?" and it then REALLY sucks at the mid-course correction as it doesn't factor in eccentricity or inclination to the initial burn, where it'd be most efficient to. I've found you're better off using MechJeb to find the transfer window, then plot a manual manoeuvre to actually get there. Use MechJeb to drop your periapsis once you hit closest approach.
It's all about the ascent, and MechJeb does an awesome gravity turn.
I need to learn how to use the in-game maneuverserersrs.
Likewise. I've got the hang of maneuver nodes for changing the inclination or height of my orbit. Changing height is easy enough without them - I can usually get into a decent enough circular myself - but I find them massively useful for inclination changes.
What I havn't figured out is how to use them for intercepts, either for intercepting other stuff in orbit around Kerbin or, more importantly, for interplanetary transfers. I can live without the first but getting anywhere beyond the Mun or Minmus without the second is going to be tricky.
Any pointers would be most welcome.
6124 posts • Previous
• 1
• ...
• 31
• 32
• 33
• ...
• 154
• Next
|
{
"url": "http://arstechnica.com/civis/viewtopic.php?f=22&t=1150213&start=1240",
"source_domain": "arstechnica.com",
"snapshot_id": "crawl=CC-MAIN-2015-48",
"warc_metadata": {
"Content-Length": "120781",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:KF5SB27SBC4SNGM73IQUQMKVG6JRHQLA",
"WARC-Concurrent-To": "<urn:uuid:aa59302e-e386-4d89-a5e8-b7fbbbf58097>",
"WARC-Date": "2015-11-29T22:53:33Z",
"WARC-IP-Address": "50.31.151.33",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:34PEOHTV7ACX43LUUFS4A7KTOVWPYDWD",
"WARC-Record-ID": "<urn:uuid:5c4a581e-0633-4ec0-9b5e-1e8499e4d0ba>",
"WARC-Target-URI": "http://arstechnica.com/civis/viewtopic.php?f=22&t=1150213&start=1240",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:99f2c6de-8463-4a9e-9395-32177a5c86e2>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-71-132-137.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2015-48\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for Nov 2015\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
21,
22,
37,
61,
67,
75,
82,
89,
96,
104,
112,
123,
161,
322,
528,
658,
741,
931,
1442,
1622,
1856,
2165,
2546,
2861,
2862,
2880,
2890,
2891,
2892,
3288,
3289,
3429,
3430,
3448,
3458,
3459,
3460,
3747,
3796,
3797,
3815,
3961,
3962,
3972,
3973,
3983,
3984,
4167,
4168,
4169,
4999,
5000,
5037,
5038,
5056,
5076,
5077,
5087,
5088,
5131,
5132,
5142,
5143,
5144,
5515,
5528,
5529,
5551,
5573,
5856,
5857,
5904,
5905,
5906,
5928,
5929,
6195,
6196,
6442,
6443,
6668,
6690,
7005,
7006,
7107,
7108,
7109,
7262,
7280,
7329,
7330,
7348,
7494,
7495,
7505,
7506,
7516,
7517,
7700,
7701,
7702,
8532,
8533,
8570,
8571,
8589,
8609,
8610,
8620,
8621,
8664,
8665,
8675,
8676,
8677,
9048,
9049,
9375,
9434,
9490,
9491,
9543,
9595,
9616,
9634,
9644,
9645,
9646,
9682,
9683,
9699,
10011,
10278,
10436,
10467,
10468,
10509,
10524,
10544,
10563,
10868,
10869,
10870,
11322,
11323,
11324,
11564,
11565,
11805,
11806,
11939,
11956,
11976,
11995,
12300,
12301,
12302,
12754,
12755,
12756,
12996,
12997,
13237,
13238,
13371,
13372,
13373,
13459,
13636,
13802,
13958,
13959,
14117,
14118,
14425,
14615,
14616,
14754,
14780,
14970,
14971,
15109,
15110,
15111,
15190,
15414,
15415,
15578,
15579,
15742,
15752,
15822,
15823,
15875,
16088,
16089,
16462,
16463,
16553,
16603,
16691,
17014,
17015,
17254,
17299,
17682,
17683,
18033,
18034,
18501,
18592,
18609,
18682,
18683,
18704,
18724,
18725,
18879,
18939,
18980,
18981,
18999,
19018,
19030,
19184,
19185,
19248,
19266,
19420,
19421,
19484,
19485,
19486,
19706,
19707,
20202,
20291,
20309,
20398,
20399,
20400,
20485,
20674,
20692,
20881,
20882,
20883,
20916,
20917,
21257,
21258,
21542,
21673,
21718,
21736,
21890,
21891,
21954,
21955,
22425,
22426,
22499,
22560,
22823,
22824,
23117,
23118,
23158,
23186,
23192,
23200,
23207,
23214,
23221,
23229,
23237
],
"line_end_idx": [
21,
22,
37,
61,
67,
75,
82,
89,
96,
104,
112,
123,
161,
322,
528,
658,
741,
931,
1442,
1622,
1856,
2165,
2546,
2861,
2862,
2880,
2890,
2891,
2892,
3288,
3289,
3429,
3430,
3448,
3458,
3459,
3460,
3747,
3796,
3797,
3815,
3961,
3962,
3972,
3973,
3983,
3984,
4167,
4168,
4169,
4999,
5000,
5037,
5038,
5056,
5076,
5077,
5087,
5088,
5131,
5132,
5142,
5143,
5144,
5515,
5528,
5529,
5551,
5573,
5856,
5857,
5904,
5905,
5906,
5928,
5929,
6195,
6196,
6442,
6443,
6668,
6690,
7005,
7006,
7107,
7108,
7109,
7262,
7280,
7329,
7330,
7348,
7494,
7495,
7505,
7506,
7516,
7517,
7700,
7701,
7702,
8532,
8533,
8570,
8571,
8589,
8609,
8610,
8620,
8621,
8664,
8665,
8675,
8676,
8677,
9048,
9049,
9375,
9434,
9490,
9491,
9543,
9595,
9616,
9634,
9644,
9645,
9646,
9682,
9683,
9699,
10011,
10278,
10436,
10467,
10468,
10509,
10524,
10544,
10563,
10868,
10869,
10870,
11322,
11323,
11324,
11564,
11565,
11805,
11806,
11939,
11956,
11976,
11995,
12300,
12301,
12302,
12754,
12755,
12756,
12996,
12997,
13237,
13238,
13371,
13372,
13373,
13459,
13636,
13802,
13958,
13959,
14117,
14118,
14425,
14615,
14616,
14754,
14780,
14970,
14971,
15109,
15110,
15111,
15190,
15414,
15415,
15578,
15579,
15742,
15752,
15822,
15823,
15875,
16088,
16089,
16462,
16463,
16553,
16603,
16691,
17014,
17015,
17254,
17299,
17682,
17683,
18033,
18034,
18501,
18592,
18609,
18682,
18683,
18704,
18724,
18725,
18879,
18939,
18980,
18981,
18999,
19018,
19030,
19184,
19185,
19248,
19266,
19420,
19421,
19484,
19485,
19486,
19706,
19707,
20202,
20291,
20309,
20398,
20399,
20400,
20485,
20674,
20692,
20881,
20882,
20883,
20916,
20917,
21257,
21258,
21542,
21673,
21718,
21736,
21890,
21891,
21954,
21955,
22425,
22426,
22499,
22560,
22823,
22824,
23117,
23118,
23158,
23186,
23192,
23200,
23207,
23214,
23221,
23229,
23237,
23247
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 23247,
"ccnet_original_nlines": 276,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 8,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.42204853892326355,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04360346123576164,
"rps_doc_frac_lines_end_with_ellipsis": 0.03971118852496147,
"rps_doc_frac_no_alph_words": 0.16083915531635284,
"rps_doc_frac_unique_words": 0.2610531449317932,
"rps_doc_mean_word_length": 4.379532814025879,
"rps_doc_num_sentences": 242,
"rps_doc_symbol_to_word_ratio": 0.0049362401477992535,
"rps_doc_unigram_entropy": 5.98577880859375,
"rps_doc_word_count": 4026,
"rps_doc_frac_chars_dupe_10grams": 0.37931033968925476,
"rps_doc_frac_chars_dupe_5grams": 0.37931033968925476,
"rps_doc_frac_chars_dupe_6grams": 0.37931033968925476,
"rps_doc_frac_chars_dupe_7grams": 0.37931033968925476,
"rps_doc_frac_chars_dupe_8grams": 0.37931033968925476,
"rps_doc_frac_chars_dupe_9grams": 0.37931033968925476,
"rps_doc_frac_chars_top_2gram": 0.005104360170662403,
"rps_doc_frac_chars_top_3gram": 0.003686479991301894,
"rps_doc_frac_chars_top_4gram": 0.0031760400161147118,
"rps_doc_books_importance": -1955.536865234375,
"rps_doc_books_importance_length_correction": -1955.536865234375,
"rps_doc_openwebtext_importance": -1322.83251953125,
"rps_doc_openwebtext_importance_length_correction": -1322.83251953125,
"rps_doc_wikipedia_importance": -852.2613525390625,
"rps_doc_wikipedia_importance_length_correction": -852.2613525390625
},
"fasttext": {
"dclm": 0.16131430864334106,
"english": 0.9443903565406799,
"fineweb_edu_approx": 1.5684746503829956,
"eai_general_math": 0.6970387697219849,
"eai_open_web_math": 0.37123048305511475,
"eai_web_code": 0.1459605097770691
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.67",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "629.4",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Engineering",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-2,465,903,733,448,862,000 |
DDH Software, Inc Making a big world smaller
PizzaDelivery.pdb
Author:Ben Clinger [Send Author Email]
Homepage:
Date
Added:
July 06, 2002
Description:A simple database that tracks information useful to delivery drivers. Date, in/out times, in/out mileage, mileage and other amounts owed, tip information, hours worked, number of deliveries, notes, and related information/totals is provided. Multiple months may be kept in the database and reported on using the filter option.
Has Data:No
Has Forms:No
Filters:Individual months/periods may be viewed using a "sort" filter.
Sorting:Sorting is normally by date.
Reports:Miles driven, amounts collected, tip, number of hours worked.
Comments:Revised checkout and tip formulas.
Price:FREE
Version:HanDBase v.2.7x or greater
File:pizzadeliveryv1a.pdb Downloads: This Month 8 / Total* 1369
Note:MAC Users will need to enter the filename pizzadeliveryv1a.pdb when saving this file.
* since October 1, 2000.
Other Titles from Ben Clinger
07/17/2002 Pizza Driver [Sales]
A followup to the original submission, PizzaDelivery.pdb. This file contains two databases, Tiplog.pdb and Driverlog.pdb. The main file, Driverlog.pdb, draws from two fields in the Tiplog.pdb file. Tiplog.pdb is used to track individual deliveries. Driverlog.pdb is used to capture mieage, time, and summary information. The "other database" name must be set using the the "Database Properties" options in order for the DriverLog.pdb file to obtain information from the Tiplog.pdb file. The "Other database name" option must be edited in the "Runs" and "Amount Collected" fields. The "browse" option should be used to locate the Tiplog.pdb file.
08/04/2002 pizzadriver.zip [Sales]
A followup to the two previous delivery tracking apps. This app consists of 11 databases and works in the Version 3 environment. A "readme.txt" file is included in the download that discusses the databases. Sales, tips, mileage, hours worked and other functions are tracked. The relationship, DB Popup, linked and calculated functions are used.
08/14/2002 Project Tracker V3 [Automobiles]
Project Tracker was written using HanDBase version 3. It's primary purpose is to provide a simple method to track projects. A readme.txt file is included to describe the applicaiton.
07/13/2003 Medbag [Medical]
Medbag was written using HanDBase version 3 and its companion form program. Its purpose is to provide a simple method to record what is in multiple first aid boxes based on "owner name." The "linked", "relationship," and database popup (DB popup)field types are used throughout the application. Editing of the "child databases" should be done through the "parent" database in order to maintain proper indexing. There are three databases. Medbag is the primary database. It provides a place to record the owner's name, bag description, and notes. The "relationship" field type is used to "view owner items" and "# items in bag." The "linked" field type is used to link to the item list so that database may be edited. Tapping on "View OWNER Items" is the first step toward adding the inventory to the database. The MegBagItems database is where the work is really done. It captures the item description using the "database popup" field type and links to the item list using the "linked" field type. Item description, purchaes date, expiration, number stocked, supplier information, and similar information is maintained here. The MedBagList database is used to maintain a single item list of supplies to be tracked by the MegBagItems database. Cost information may be added to the application by adding supplier and cost information to this database and then use the MegBagItems database to calculate the totals. Within the Medbag database, the "filter" option may be used to provide a list of items needing to be replinished, a list of items needed, and related information. Setting up the internal linking for the "linked," "relationship," and "database popup" fields may be necessary in order for the databases to interact.
07/06/2003 Family Medical V3 [Medical]
FamilyMedical was written using HanDBase version 3 and its companion forms program. Its purpose is to record family medical history. The "calculated," "linked", "relationship," and database popup" (DB popup) field types are used throughout the application. There are seven databases. Its design allows the user to track the entire family. This release includes forms for each of the databases. FamilyMedical is the primary database. It provides a place to enter names using the "DB Popup" field type that is linked to FamPersInfo. Fields are provided to record the next physician's appointment and time, physician's name, reason for the appointment, and notes. The "relationship" field type to enter allery, immunization, medical history, and medical insurance information. In addition, office visit costs and prescription costs are also displayed. The "linked" field type is used to edit each of the files. The number of "related records" is displayed next to the field to indicate there is related data in the file. The FamPersInfo database is primarily a "standalone" database that is used to maintain name information. Allergy information is maintained in the FamAllergies database. The "relationship" field type is used to link to it from the FamilyMedical database using the "name" field. The allergy information database tracks individual allergies, test, provider, reactions, medications and notes information. A link is provided to edit the FamMedications file. Immunization information is maintained in the FamImmuneRecord database. The "relationship" field type is used to link to it from the FamilyMedical database using the "name" field. The immunization information database tracks vaccinations, date of vaccination, followup date, provider, reactions and notes. Medical history information is maintained in the FamIndMed database. The "relationship" field type is used to link to it from the FamilyMedical database using the "name" field. The medical history database tracks problem, when it occurred, treatment, physician, cost, pharmacy name, prescription number, prescription information, appointment information, location treated, surgery information, and followup information. A link is provided to the prescription database to allow editing of that file. Medical insurance information is maintained in the FamMedInsurance database. The "relationship" field type is used to link to it from the FamilyMedical database using the "name" field. The medical insurance database tracks, insurance company, policy number, subscriber number, group number, plans, phone number, address, contact person, and notes. The FamMedications database is used to maintain a list of medications. There are several entries in this file. The FamPersInfo database is a "stand alone" database that is linked to from the FamilyMedical database. Its primary function is to record names; however, as a stand alone database, it may be used to record name, relation, social security number, driver license number, address, phone numbers, date of birth, race/sex, height in inches, weight in pounds, eye/hair color, health insurance information, doctor visit information, primary physician information, medical information, medications, and notes. The FamBPPulse database is intended to document blood pressure, heart and respiration rates, and activity. Date, time, activity/exercise, BP systolic, BP diastyloc, heart and respiration rates, average BP information, average heart and respiration rates, and notes may be documented. The FamExercise database is intended to capture exercise information. Date, time, exercise type, number done, start/end time, length of time, running length of time, average length of time and notes may be captured. 4-17-03 - removed password protection from FamPersInfo database. 7-6-03 - forms added to each of the databases.
07/07/2003 Evaluations [Business Tools]
Evaluations was written using HanDBase version 3 and its companion form program. Its purpose is to facilitate "on the go" documentation of employee performance. A large portion of the supervisor's responsibility should be the documentation of worker performance, especially the good along with the bad, the ugly and the so-so. The "calculated," "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are four databases. Evaluations is the primary database. It provides a place to enter names using the "DB Popup" field type that is linked to EvaluationNames. Fields are provided to document the date the record was created. Fields are provided to allow the editing of the displayed name and all names. The branch to the evaluation data uses the "relationship" field type to go to the EvalData database where the actual evaluation data is recorded. Data is displayed using the "relationship" field type from the EvalData database; the data is the number of related entries and the latest related entry date. EvaluationAreas is comprised of data the individual is evaluated on. Examples all ready in the database are appearance, atttendance, customer interaction, knowledge, knowledge of equipment and work quality. More entries may be added as needed. EvaluationNames is used to capture basic employee information. Data captured includes name, position title, date hired, date in position, special duties, special recognition, work phone number, cell phone number, fax phone number, email address(es), home phone number and notes. EvalData is where the evaluation information data is stored. Fields include name, area of evaluation, record expiration date, notes, date noted, date/time created and record number. The record expiration date is intended to be used as a guide to indicate when the record should no longer be considered and possibly deleted. The record number and latest related entry date in this file are displayed via the relationship field type in the Evaluation database. 7-6-03 - This version has forms added for each database.
08/24/2002 Emergency Supply Kit HDV3 [Miscellaneous]
EmegencySupplyKit was written using HanDBase version 3. It provides a simple method to record what is in an emergency supply kit. The "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are three databases. Its design allows the user to track several different kits. The contents of the kit may vary to an extent upon locality. However, rain is rain regardless of where you live, so keeping warm is always a necessity. The entries I have included in the EmerSupplyList database are not all inclusive of what should be in a kit. Be creative and be prepared. I am from an area that was prone to hurricanes passing by and we were always prepared for the "big one," which we fortuantely missed when Hurricane Andrew struck south Florida back in the 90s. Guys, don't forget the programable universal surfing device.
09/21/2002 Plant Stuff [Miscellaneous]
PlantStuff was written using HanDBase version 3. It provides a simple method to assist the hobby plant grower in maintaining a record of activities and plants. A readme.txt file is provided.
06/29/2003 CrashInfo [Miscellaneous]
CrashInfo was written using HanDBase version 3 and its accompanying forms program, version v3.0i. It is an extension of the applet written by Master David Haupert of DDH Software. It provides a method to record crash related information. This release includes forms for main and child databases. The "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are four databases. The number of related records is displayed next to the "related" field type. Links are provided to the child databases for editing of those databases. As a note, deleting files must be done from the parent record in order to maintain proper indexing. CrashInfo is the primary database. Information captured: date and time of occurance, case number, officer name/id, agency name, and location of crash. Name information is provided initially via the "relational" function or the "linked" function with the CashNames database. After taking care of the name business, charge information and notes may be entered, followed by witness information, accessible via the relational function or linked function with the CrashWitness database. After witness information, entry fields for road condition, road description, weather condition information are provided. The number of records in each of the "child" databases is displayed next to the related field. The ability to edit the "child databases" is accomplished using the "linked" field type. The database file is "CrashInfo.PDB" and the forms file is "CrashInfo_HDF.PDB." To uninstall the forms file, delete the "CrashInfo_HDF.PDB" file. CrashNames is related with the parent database using the "case #" field. It provides fields to capture driver name, driver vehicle number, driver date of birth, driver race/sex, city/state, zip code, injury description, insurance company, policy number, expiration date, agent, passenger information (using relation/linked properties), vehicle year, make, model (all in one field), tag number and state (in one field), vehicle damage, damage amount, at fault, cited, charge, phone numbers, work location and phone numbers. The database file is "CrashNames.PDB" and the forms file is "CrashNames_HDF.PDB." To uninstall the forms file, delete the "CrashNames_HDF.PDB" file. CrashPassenger is a child database of CrashNames. It is related via the case # field. It provides fields to capture passenger vehicle #, passenger name, race/sex/age (in one field), address, home px, work px, where seated, injury information, and notes. The database file is "CrashPassenger.PDB" and the forms file is "CrashPassenger_HDF.PDB." To uninstall the forms file, delete the "CrashPassenger_HDF.PDB" file. CrashWitness is a child database of CrashNames. It is related via the case # ield. It provides fields to capture witness name, race/sex/age (in one field), address, home phone, work phone, and notes. The database file is "CrashWitness.PDB" and the forms file is "CrashWitness_HDF.PDB." To uninstall the forms file, delete the "CrashWitness_HDF.PDB" file. CrashNames is related with the parent database using the "case #" field. It provides fields to capture driver name, driver vehicle number, driver date of birth, driver race/sex, city/state, zip code, injury description, insurance company, policy number, expiration date, agent, passenger information (using relation/linked properties), vehicle year, make, model (all in one field), tag number and state (in one field), vehicle damage, damage amount, at fault, cited, charge, phone numbers, work location and phone numbers. The database file is "CrashNames.PDB" and the forms file is "CrashNames_HDF.PDB." To uninstall the forms file, delete the "CrashNames_HDF.PDB" file. CrashPassenger is a child database of CrashNames. It is related via the case # field. It provides fields to capture passenger vehicle #, passenger name, race/sex/age (in one field), address, home px, work px, where seated, injury information, and notes. The database file is "CrashPassenger.PDB" and the forms file is "CrashPassenger_HDF.PDB." To uninstall the forms file, delete the "CrashPassenger_HDF.PDB" file. CrashWitness is a child database of CrashNames. It is related via the case # ield. It provides fields to capture witness name, race/sex/age (in one field), address, home phone, work phone, and notes. The database file is "CrashWitness.PDB" and the forms file is "CrashWitness_HDF.PDB." To uninstall the forms file, delete the "CrashWitness_HDF.PDB" file.
01/07/2003 MechanicsHV3 [Business Tools]
Mechanics was written using HanDBase version 3. It is an applet designed for the automobile mechanic that provides an environment that meets the majority of the day's activities. The "linked", "relationship," and "database popup" (DB popup), and popup field types are used throughout the application. A readme.txt file is supplied. The display category used is "business."
09/07/2002 HomeWorkHV3 [Miscellaneous]
Homework was written using HanDBase version 3. It is a "relational" applet that tracks homework and project assignments, contacts, and to do. The "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are nine databases. In most instances, the number of related records is displayed next to the "related" field type. Links are provided to the child databases for editing of those databases. As a note, deleting files must be done from the parent record in order to maintain proper indexing.
09/22/2002 DietIntake HV3 [Medical]
DietIntake was written using HanDBase version 3. It is a "relational" applet that documents food and medication intake. The "linked", "relational," "database popup" (DB popup), and "calculated" field types are used through out the application. There are ten databases. In most instances, the number of related records is displayed next to the "related" field type. Links are provided to the child databases for editing of those databases. As a note, deleting files must be done from the parent record in order to maintain proper indexing. In addition, more fields can be added to the "parent" database, DietIntake; however, with the high number of "child" databases this appelt has, additional fields in the "parent" database, DietIntake, speed will be noticeably slower due to the use of the "relational" field type.
09/19/2002 Police - HV3 [Law Enforcement]
Police was written using HanDBase version 3. This is the preliminary version of a paid project. Its purpose is to facilitate "on the go" documentation and is structured as a "starter" tracking system, allowing the user to add/delete "child" databases and fields as needed. The "calculated," "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are eleven databases.
10/06/2002 Hikes The Trip HDV3 [Sports]
HikesTheTrip is a HanDBase v3 appelt designed to document hikes. There are four databases. The "relational," "db-popup," "calculated," and "pop-up" field types are used throughout the applet. The "Time created" field is used in most of the databases as the "relational" factor. As with all relational databases, the addition and deletion of records must be done within the parent record in order to maintain proper indexing. Added permit information in the "HikeLocations" database.
07/13/2003 Police - Release 2 [Law Enforcement]
Police was written using HanDBase version 3 and its companion form program. This is the preliminary version of a paid project. Its purpose is to facilitate "on the go" documentation and is structured as a "starter" tracking system, allowing the user to add/delete "child" databases and fields as needed. The "calculated," "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are eleven databases. This release has forms added to the applet and provides for editing of the PoliceNotes "child" databases throughout the applet. Data is included strictly for testing purposes. The primary database is "Police." It is used as a launching point to the "child" databases. The relationship used is "date." The relationship field type is used to enter/view information related to BOLOs, citations, contacts, field interviews, notes, service calls, subpoenas, time worked, to do, and vehicle unit. The "linked" field type is used to edit the "child" databases. Normal addition/deletions to the child databases should be routinely done through the "parent" database in order to maintain proper indexing. The "child" databases use "time created" as their primary relationship with the exception of "PoliceToDo," which uses "date." The databases are: Police, PoliceBOLO, PoliceCitations, PoliceContacts, PoliceFldInterview, PoliceNotes, PoliceServiceCalls, PoliceSubpoenas, PoliceTimeWorked, PoliceTodaysUnit, and PoliceToDo.
07/26/2003 Homework Release 2 [Miscellaneous]
HomeworkRelease2 was written using HanDBase version 3 and its accompanying forms utility. It is a "relational" applet that tracks homework and project assignments, contacts, and to do. The "linked", "relationship," and "database popup" (DB popup) field types are used throughout the application. There are nine databases. In most instances, the number of related records is displayed next to the "related" field type. Links are provided to the child databases for editing of those databases. As a note, deleting files must be done from the parent record in order to maintain proper indexing. The data contained is for testing purposes only. This release has been updated to includes forms and a general cleanup of the applet. There are two files in this archive. The one titled "HomeworkColor.zip" is for color based devices. The one titled "HomeworkMonochrome.zip" is for monochrome based devices. The primary database is "HomeWork." The following information is captured, date, classes (a db-popup field type to either import a value or create a new value). Edit displayed class (relational that allows the editing of the currently displayed "Classes" or the creation of a new value). Classes by date (relational). Class schedule, "a db-popup" field type to import a class into the parent record. Display Class (relational) to view/edit the displayed class, a contact list entry, editing of the contact via "Displayed Contact" (relational). "To Do" and Today's To Do, and notes. Links are provided to edit the various child databases. "ClassList" - a one field child database that provides a list of valid class names. From the parent record, this is obtained via the "db-popup" field type. "Classes" - a child database that captures information concerning the class. Information includes: date, class, homework (relational), project (relational), and notes. The homework and project fields are relational and tied to the class record displayed. "ProjectAsnt" is a child database of "Classes" that captures project information. Information captured includes date, class, project assignment, date due, number of days (calculated), completed (check box to mark for completion), and notes. "HomeworkAssnt" is a cihdl database of "Classes" that captures homework information. Information includes date, class, homework assignment, date due, number of days (calculated), completed (check box to mark for completion), and notes. "ClassSchedule" is a child database that captures: class name, days, date, time(s), teacher, building/room # and notes. The currently displayed teacher may be viewed using the "relational" field type and the teacher list edited using the "linked" field type. "ClassTeachers" is a child database that captures teacher name, classes instructed, office hours, office/home/other phone numbers, email address(s) and notes. "ClassContacts" is a child database that captures name of contact, address, phone #, email address, notes, next contact date and date created. "ClassToDo" is a child database that captures action, date to do, time to do, a check box to indicate "done," time done, date done, note, and cost factors.
08/24/2003 Pizza Driver Forms Release [Business Tools]
Pizza Driver was written using HanDBase v3 and it companion forms utility. It is intended to capture and report upon information captured throughout the routine day of a food delivery person. Forms for all of the databases are provided with the exception of DominosTips - operation is rather slow when a form is used. Data is provided for test purposes only and in most instances should be deleted. Auxilary trackers for checkbook/ savings, et cetera and vehicle tracking/gas mileage is provided. A "readme" file is included.
09/06/2003 Pizza Driver Release B9 9-06-03 [Business Tools]
PizzaDriver was written using HanDBase V3 and its companion form program. This is a followup to previous releases. It consists of 53 databases that are either related or linked together to provide an environment capable of tracking much of the informtion a food delivery person comes across in a typical day. Use of relational, popup, db-popup, linked, calculated and note field types are used throughout the applet. This release sees the general cleanup of the forms. In addition, two plugins are added, TextFormat.zip by DDH's Robert Machorro and Treodialer.Zip (by DDH). The Treodialer plugin is used in several of the databases and TextFormat is used in the DominosContacts database. All data is for verification purposes only - it is not to be considered accurate. The forms were edit to display "properly" on a Handsprint/Sprint Treo 300. Color has for the most part been removed due to color/hue inconsistancies.
09/07/2003 Weather Tracking [Technical]
Weather Tracking is the preliminary version of a paid project. Weather Tracking was written with HandBase V3.0i and its companion forms utility. The applet consists of one parent database and five child databases. The relational, db-popup and calculated field types are used throughout the applet. Data provided in the various databases is for test purposes only. A "readme.txt" file is included.
|
{
"url": "http://www.ddhsoftware.com/gallery.html?show=number&record=1469&UID=20120428200838199.87.252.118",
"source_domain": "www.ddhsoftware.com",
"snapshot_id": "crawl=CC-MAIN-2017-17",
"warc_metadata": {
"Content-Length": "40222",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:LHUIQNYXQU4QATUEZ75G6FWARYWERXYE",
"WARC-Concurrent-To": "<urn:uuid:b1f4bd4a-d255-4fcd-b5f4-a11ef135b92e>",
"WARC-Date": "2017-04-30T02:04:00Z",
"WARC-IP-Address": "72.52.202.242",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:SN7ZMMGIMWJ7L5NFDIA24242LOBCGJ5X",
"WARC-Record-ID": "<urn:uuid:46e43dc0-c8c2-42a0-b2d4-88e373cc5c63>",
"WARC-Target-URI": "http://www.ddhsoftware.com/gallery.html?show=number&record=1469&UID=20120428200838199.87.252.118",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:fefd0e5e-5a62-434c-973f-15a7e3c876e4>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-145-167-34.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2017-17\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web for April 2017\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
45,
46,
47,
48,
49,
50,
51,
69,
70,
109,
119,
124,
131,
132,
146,
485,
497,
510,
581,
618,
688,
732,
743,
778,
851,
942,
967,
968,
998,
999,
1031,
1677,
1678,
1713,
2058,
2059,
2103,
2286,
2287,
2315,
4041,
4042,
4081,
7930,
7931,
7971,
10075,
10076,
10129,
11001,
11002,
11041,
11232,
11233,
11270,
15772,
15773,
15814,
16187,
16188,
16227,
16776,
16777,
16813,
17631,
17632,
17674,
18100,
18101,
18141,
18624,
18625,
18673,
20146,
20147,
20193,
23335,
23336,
23391,
23917,
23918,
23978,
24898,
24899,
24939
],
"line_end_idx": [
45,
46,
47,
48,
49,
50,
51,
69,
70,
109,
119,
124,
131,
132,
146,
485,
497,
510,
581,
618,
688,
732,
743,
778,
851,
942,
967,
968,
998,
999,
1031,
1677,
1678,
1713,
2058,
2059,
2103,
2286,
2287,
2315,
4041,
4042,
4081,
7930,
7931,
7971,
10075,
10076,
10129,
11001,
11002,
11041,
11232,
11233,
11270,
15772,
15773,
15814,
16187,
16188,
16227,
16776,
16777,
16813,
17631,
17632,
17674,
18100,
18101,
18141,
18624,
18625,
18673,
20146,
20147,
20193,
23335,
23336,
23391,
23917,
23918,
23978,
24898,
24899,
24939,
25335
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 25335,
"ccnet_original_nlines": 85,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2789328992366791,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.013338560238480568,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2465672791004181,
"rps_doc_frac_unique_words": 0.20429253578186035,
"rps_doc_mean_word_length": 5.3651299476623535,
"rps_doc_num_sentences": 311,
"rps_doc_symbol_to_word_ratio": 0.002157710026949644,
"rps_doc_unigram_entropy": 5.42892599105835,
"rps_doc_word_count": 3774,
"rps_doc_frac_chars_dupe_10grams": 0.29143619537353516,
"rps_doc_frac_chars_dupe_5grams": 0.4067562222480774,
"rps_doc_frac_chars_dupe_6grams": 0.3618628978729248,
"rps_doc_frac_chars_dupe_7grams": 0.3392433822154999,
"rps_doc_frac_chars_dupe_8grams": 0.32368630170822144,
"rps_doc_frac_chars_dupe_9grams": 0.30284473299980164,
"rps_doc_frac_chars_top_2gram": 0.012445669621229172,
"rps_doc_frac_chars_top_3gram": 0.005926509853452444,
"rps_doc_frac_chars_top_4gram": 0.017038719728589058,
"rps_doc_books_importance": -2069.412353515625,
"rps_doc_books_importance_length_correction": -2069.412353515625,
"rps_doc_openwebtext_importance": -1519.5096435546875,
"rps_doc_openwebtext_importance_length_correction": -1519.5096435546875,
"rps_doc_wikipedia_importance": -824.4983520507812,
"rps_doc_wikipedia_importance_length_correction": -824.4983520507812
},
"fasttext": {
"dclm": 0.060340821743011475,
"english": 0.9105052351951599,
"fineweb_edu_approx": 2.928252696990967,
"eai_general_math": 0.2659491300582886,
"eai_open_web_math": 0.20264363288879395,
"eai_web_code": 0.24436259269714355
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.74",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "658.40285",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "2",
"label": "Understand"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "6",
"label": "Content Listing"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
378,689,911,808,385,000 |
user2866264 user2866264 - 11 months ago 77
SQL Question
How to compare dates in datetime fields in Postgresql?
I have been facing a strange scenario when comparing between dates in postgresql(version 9.2.4 in windows). I have a column in my table say update_date with type 'timestamp without timezone'. Client can search over this field with only date (i.e: 2013-05-03) or date with time (i.e: 2013-05-03 12:20:00). This column has the value as timestamp for all rows currently and have the same date part(2013-05-03) but difference in time part.
When I'm comparing over this column, I'm getting different results. Like the followings:
select * from table where update_date >= '2013-05-03' AND update_date <= '2013-05-03' -> No results
select * from table where update_date >= '2013-05-03' AND update_date < '2013-05-03' -> No results
select * from table where update_date >= '2013-05-03' AND update_date <= '2013-05-04' -> results found
select * from table where update_date >= '2013-05-03' -> results found
My question is how can I make the first query possible to get results, I mean why the 3rd query is working but not the first one?
Can anybody help me with this? Thanks in advance.
Answer Source
@Nicolai is correct about casting and why the condition is false for any data. i guess you prefer the first form because you want to avoid date manipulation on the input string, correct? you don't need to be afraid:
SELECT *
FROM table
WHERE update_date >= '2013-05-03'::date
AND update_date < ('2013-05-03'::date + '1 day'::interval);
|
{
"url": "https://codedump.io/share/is0fZD5ejZuV/1/how-to-compare-dates-in-datetime-fields-in-postgresql",
"source_domain": "codedump.io",
"snapshot_id": "crawl=CC-MAIN-2017-43",
"warc_metadata": {
"Content-Length": "41354",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PPLBWB6WNK246Y6OK2VZV3NJXULMF3FG",
"WARC-Concurrent-To": "<urn:uuid:c66c17f9-9f00-4a8c-9b14-d3e23aa9f8a1>",
"WARC-Date": "2017-10-21T07:03:09Z",
"WARC-IP-Address": "50.112.74.85",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:BHAUOCGQQUHHZARRVB6F366KRUHROBG4",
"WARC-Record-ID": "<urn:uuid:5fba4b63-8eeb-46aa-98a6-0a189936e4df>",
"WARC-Target-URI": "https://codedump.io/share/is0fZD5ejZuV/1/how-to-compare-dates-in-datetime-fields-in-postgresql",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:11c342d6-011f-46c3-af97-d3ccd7ed2617>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-225-179-112.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-43\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for October 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
43,
56,
57,
112,
113,
549,
550,
639,
640,
740,
741,
840,
841,
944,
945,
1016,
1017,
1018,
1148,
1149,
1199,
1200,
1214,
1215,
1431,
1432,
1441,
1452,
1492
],
"line_end_idx": [
43,
56,
57,
112,
113,
549,
550,
639,
640,
740,
741,
840,
841,
944,
945,
1016,
1017,
1018,
1148,
1149,
1199,
1200,
1214,
1215,
1431,
1432,
1441,
1452,
1492,
1551
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1551,
"ccnet_original_nlines": 29,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.2779291570186615,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.03814714029431343,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.3950953781604767,
"rps_doc_frac_unique_words": 0.5327510833740234,
"rps_doc_mean_word_length": 5.056768417358398,
"rps_doc_num_sentences": 16,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.5131306648254395,
"rps_doc_word_count": 229,
"rps_doc_frac_chars_dupe_10grams": 0.16148531436920166,
"rps_doc_frac_chars_dupe_5grams": 0.22020724415779114,
"rps_doc_frac_chars_dupe_6grams": 0.19430051743984222,
"rps_doc_frac_chars_dupe_7grams": 0.16148531436920166,
"rps_doc_frac_chars_dupe_8grams": 0.16148531436920166,
"rps_doc_frac_chars_dupe_9grams": 0.16148531436920166,
"rps_doc_frac_chars_top_2gram": 0.09326425194740295,
"rps_doc_frac_chars_top_3gram": 0.06476683914661407,
"rps_doc_frac_chars_top_4gram": 0.0863557904958725,
"rps_doc_books_importance": -149.06419372558594,
"rps_doc_books_importance_length_correction": -136.92881774902344,
"rps_doc_openwebtext_importance": -53.9155387878418,
"rps_doc_openwebtext_importance_length_correction": -53.9155387878418,
"rps_doc_wikipedia_importance": -44.5521354675293,
"rps_doc_wikipedia_importance_length_correction": -30.964052200317383
},
"fasttext": {
"dclm": 0.4607544541358948,
"english": 0.7606329917907715,
"fineweb_edu_approx": 1.0391682386398315,
"eai_general_math": 0.26707929372787476,
"eai_open_web_math": 0.04465276002883911,
"eai_web_code": 0.7738778591156006
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.746",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,563,165,762,220,972,000 |
Sanity
Sanity and Slack integration with GROQ-powered webhooks
The newly released GROQ-powered webhooks unlock some interesting new possibilities. You can send customized HTTP requests when content is created, updated, or deleted. Use the query language GROQ to define which documents should trigger a webhook and what its payload should be.
Before the release of GROQ-powered webhooks you could also integrate Sanity with Slack, but then you needed some kind of logic in between. With GROQ, it's easier than ever!
Set up incoming webhook for Slack
While working on a recent project I wanted to post some information to Slack, to keep track of its status. Step one is setting up the incoming webhook.
1. Create a new Slack app in the workspace where you want to post messages.
Grafisk brukergrensesnitt, tekst, applikasjon
2. From the Features page, activate Incoming Webhooks.
Grafisk brukergrensesnitt, tekst, applikasjon
3. Click Add New Webhook to Workspace
Grafisk brukergrensesnitt, tekst, applikasjon
4. Pick a channel that the app will post to, then click Allow.
Grafisk brukergrensesnitt, tekst, applikasjon
5. Copy your Incoming Webhook URL and use it to post messages to Slack.
Grafisk brukergrensesnitt, tekst, applikasjon
Create a simple Slack webhook in Sanity
Log in to sanity.io, select your project and create your webhook on the API tab.
Grafisk brukergrensesnitt, tekst, applikasjon, e-post
Paste the webhook URL from Slack, then select what actions (create/update/delete) to trigger on.
My first webhook is very simple. It will trigger when a new document of type user is created, and it will post a message with the user's name and its referenced team.
Grafisk brukergrensesnitt, tekst, applikasjon
When a new user joins, this is posted to Slack.
Grafisk brukergrensesnitt, tekst, applikasjon, e-post
Create another Slack webhook in Sanity
I want to trigger another webhook when a user's score has changed. Using the before() and after() delta functions I can make the webhook trigger only when the points have increased, and not when there is any other change.
Grafisk brukergrensesnitt, program
When a user solves a task, and gets a higher score, this is posted to Slack.
Tekst
Other usages
Other use cases include, but are not limited to:
A bug
At the time of writing this blog post, there is a bug with the GROQ-powered webhooks. Read about the bug and a proposed workaround, here. Hopefully it will be fixed soon. 🤞
With the free plan, you can create up to four webhooks.
That's it!
|
{
"url": "https://www.gulla.net/no/blog/sanity-and-slack-integration-with-groq-powered-webhooks/",
"source_domain": "www.gulla.net",
"snapshot_id": "crawl=CC-MAIN-2021-49",
"warc_metadata": {
"Content-Length": "11539",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:IZLHDLIEFBWKRJYBBHAAPDKBGILCTCES",
"WARC-Concurrent-To": "<urn:uuid:066e0da0-758f-422b-bd60-cf4626d7887e>",
"WARC-Date": "2021-12-09T00:59:22Z",
"WARC-IP-Address": "51.120.98.192",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:WFS4ZTIKK3YG3WOW4EK2DNAIEK5OHKJ4",
"WARC-Record-ID": "<urn:uuid:b973aafd-238b-44e6-8687-17f99b3c443e>",
"WARC-Target-URI": "https://www.gulla.net/no/blog/sanity-and-slack-integration-with-groq-powered-webhooks/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:f99c31e3-9484-4ba0-9e22-f97a052aa9c5>"
},
"warc_info": "isPartOf: CC-MAIN-2021-49\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for November/December 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-6\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
7,
8,
64,
65,
344,
345,
518,
519,
553,
554,
706,
707,
783,
829,
884,
930,
968,
1014,
1077,
1123,
1195,
1241,
1242,
1282,
1283,
1364,
1365,
1419,
1420,
1517,
1518,
1685,
1731,
1779,
1833,
1834,
1873,
1874,
2096,
2131,
2208,
2214,
2215,
2228,
2229,
2278,
2279,
2285,
2286,
2459,
2460,
2516,
2517
],
"line_end_idx": [
7,
8,
64,
65,
344,
345,
518,
519,
553,
554,
706,
707,
783,
829,
884,
930,
968,
1014,
1077,
1123,
1195,
1241,
1242,
1282,
1283,
1364,
1365,
1419,
1420,
1517,
1518,
1685,
1731,
1779,
1833,
1834,
1873,
1874,
2096,
2131,
2208,
2214,
2215,
2228,
2229,
2278,
2279,
2285,
2286,
2459,
2460,
2516,
2517,
2527
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2527,
"ccnet_original_nlines": 53,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3525896370410919,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.027888450771570206,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.17928287386894226,
"rps_doc_frac_unique_words": 0.44197529554367065,
"rps_doc_mean_word_length": 4.982716083526611,
"rps_doc_num_sentences": 30,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.7440924644470215,
"rps_doc_word_count": 405,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.08671952039003372,
"rps_doc_frac_chars_dupe_6grams": 0.04658076912164688,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.10703667253255844,
"rps_doc_frac_chars_top_3gram": 0.11496531218290329,
"rps_doc_frac_chars_top_4gram": 0.15857283771038055,
"rps_doc_books_importance": -175.37136840820312,
"rps_doc_books_importance_length_correction": -175.37136840820312,
"rps_doc_openwebtext_importance": -134.08761596679688,
"rps_doc_openwebtext_importance_length_correction": -134.08761596679688,
"rps_doc_wikipedia_importance": -112.43830108642578,
"rps_doc_wikipedia_importance_length_correction": -112.43830108642578
},
"fasttext": {
"dclm": 0.020197389647364616,
"english": 0.7857745289802551,
"fineweb_edu_approx": 1.2254796028137207,
"eai_general_math": 0.27585363388061523,
"eai_open_web_math": 0.19972044229507446,
"eai_web_code": 0.2411656379699707
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.82",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "4",
"label": "Missing Images or Figures"
},
"secondary": {
"code": "0",
"label": "No missing content"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-8,927,444,048,743,234,000 |
🔎 How to download & run the codes?
All the source codes of the aggregation methods are available here . To run the codes, you can clone the repository directly or simply load the R script source file from the repository using devtools package in Rstudio as follow:
1. Install devtools package using command:
install.packages("devtools")
2. Loading the source codes from GitHub repository using source_url function by:
devtools::source_url("https://raw.githubusercontent.com/hassothea/AggregationMethods/main/KernelAggReg.R")
✎ Note: All codes contained in this Rmarkdown are built with recent version of (version \(>\) 4.1, available here) and Rstudio (version > 2022.02.2+485, available here). Note also that the code chucks are hidden by default.
To see the codes, you can:
1 Consensual aggregation & important packages
1.1 Consensual aggregation
This Rmarkdown provides the implementation of consensual aggregation method by Has (2021). Let \(\mathcal{D}_n=\{(x_1,y_1),...,(x_n,y_n)\}\) be a training data of size \(n\), where the input-output couples \((x_i,y_i)\in\mathbb{R}^d\times\mathbb{R}\) for all \(i=1,...,n\). \(\mathcal{D}_{n}\) is first randomly partitioned into \(\mathcal{D}_{k}\) and \(\mathcal{D}_{\ell}\) of size \(k\) and \(\ell\) respectively such that \(k+\ell=n\). We construct \(M\) regression estimators (machines) \(r_1,...,r_M\) using only \(\mathcal{D}_{k}\). Let \({\bf r}(x)=(r_1(x),...,r_M(x))^T\in\mathbb{R}^M\) be the vector of predictions of \(x\in\mathbb{R}^d\), the kernel-based consensual aggregation method evaluated at point \(x\) is defined by
\[\begin{equation} g_n({\bf r}(x))=\frac{\sum_{i=1}^{\ell}y_iK_h({\bf r}(x)-{\bf r}(x_i))}{\sum_{j=1}^{\ell}K_h({\bf r}(x)-{\bf r}(x_j))} \end{equation}\] where \(K:\mathbb{R}^M\to\mathbb{R}_+\) is a non-increasing kernel function with \(K_h(x)=K(x/h)\) for some smoothing parameter \(h>0\) to be tuned, with the convention \(0/0=0\). Even though the formula of \(g_n\) is defined using only data points in \(\mathcal{D}_{\ell}\), it does depend on the whole training data \(\mathcal{D}_{n}\) as the basic machines \((r_i)_{i=1}^M\) are built using \(\mathcal{D}_{k}\).
1.2 Important packages
We prepare all the necessary tools for this Rmarkdown. pacman package allows us to load (if exists) or install (if does not exist) any available packages from The Comprehensive R Archive Network (CRAN) of .
# Check if package "pacman" is already installed
lookup_packages <- installed.packages()[,1]
if(!("pacman" %in% lookup_packages))
install.packages("pacman")
# To be installed or loaded
pacman::p_load(magrittr)
pacman::p_load(tidyverse)
## package for "generateMachines"
pacman::p_load(tree)
pacman::p_load(glmnet)
pacman::p_load(randomForest)
pacman::p_load(FNN)
pacman::p_load(xgboost)
pacman::p_load(keras)
pacman::p_load(pracma)
pacman::p_load(latex2exp)
pacman::p_load(plotly)
rm(lookup_packages)
2 Basic Machine generator
This section provides functions to generate basic machines (regressors) to be aggregated.
2.1 Function : setBasicParameter
This function allows us to set the values of some key parameters of the basic machines.
• Argument:
• lambda : the penalty parameter \(\lambda\) used in penalized linear models: ridge or lasso.
• k : the parameter \(k\) of \(k\)NN (knn) regression model and the default value is \(k=10\).
• ntree : the number of trees in random forest (rf). By default, ntree = 300.
• mtry : the number of random features chosen in each split of random forest procedure. By default, mtry = NULL and the default value of mtry of randomForest function from randomForest library is used.
• eta_xgb : the learning rate \(\eta>0\) in gradient step of extreme gradient boosting method (xgb) of xgboost library.
• nrounds_xgb : the parameter nrounds indicating the max number of boosting iterations. By default, nrounds_xgb = 100.
• early_stop_xgb : the early stopping round criterion of xgboost function. By, default, early_stop_xgb = NULL and the early stopping function is not triggered.
• max_depth_xgb : maximum depth of trees constructed in xgboost.
• Value:
This function returns a list of all the parameters given in its arguments, to be fed to the basicMachineParam argument of function generateMachines defined in the next section.
Remark.2: lambda, k, ntree can be a single value or a vector. In other words, each type of models can be constructed several times according to the values of the hyperparameters (a single value or vector).
setBasicParameter <- function(lambda = NULL,
k = 10,
ntree = 300,
mtry = NULL,
eta_xgb = 1,
nrounds_xgb = 100,
early_stop_xgb = NULL,
max_depth_xgb = 3){
return(list(
lambda = lambda,
k = k,
ntree = ntree,
mtry = mtry,
eta_xgb = eta_xgb,
nrounds_xgb = nrounds_xgb,
early_stop_xgb = early_stop_xgb,
max_depth_xgb = max_depth_xgb)
)
}
2.2 Function : generateMachines
This function generates all the basic machines to be aggregated.
• Argument:
• train_input : a matrix or data frame of the training input data.
• train_response : a vector of training response variable corresponding to the train_input.
• scale_input : logical value specifying whether to scale the input data (to be between \(0\) and \(1\)) or not. By default, scale_input = FALSE.
• machines : types of basic machines to be constructed. It is a subset of {“lasso”, “ridge”, “knn”, “tree”, “rf”, “xgb”}. By default, machines = NULL and all the six types of basic machines are built.
• splits : real number between \(0\) and \(1\) specifying the proportion of training data used to train the basic machines (\(\mathcal{D}_k\)). The remaining proportion of (\(1-\) splits) is used for the aggregation (\(\mathcal{D}_{\ell}\)). By default, splits = 0.5.
• basicMachineParam : the option used to setup the values of parameters of each machines. One should feed the function setBasicParameter() defined above to this argument.
• Value:
This function returns a list of the following objects.
• predict2 : the predictions of the remaining part (\(\mathcal{D}_{\ell}\)) of the training data used for the aggregation.
• models : all the constructed basic machines (it contains only the values of prapeter \(k\) for knn).
• id2 : a logical vector of size equals to the number of lines of the training data indicating the location of the points used to build the basic machines (FALSE) and the remaining ones (TRUE).
• scale_max, scale_min : if the argument scale_input = TRUE, the maximun and minimun values of all columns are contained in these vectors.
✎ Note: You may need to modify the function accordingly if you want to build different types of basic machines.
generateMachines <- function(train_input,
train_response,
scale_input = FALSE,
machines = NULL,
splits = 0.5,
basicMachineParam = setBasicParameter()){
lambda = basicMachineParam$lambda
k <- basicMachineParam$k
ntree <- basicMachineParam$ntree
mtry <- basicMachineParam$mtry
eta_xgb <- basicMachineParam$eta_xgb
nrounds_xgb <- basicMachineParam$nrounds_xgb
early_stop_xgb <- basicMachineParam$early_stop_xgb
max_depth_xgb <- basicMachineParam$max_depth_xgb
# Packages
pacman::p_load(tree)
pacman::p_load(glmnet)
pacman::p_load(randomForest)
pacman::p_load(FNN)
pacman::p_load(xgboost)
# pacman::p_load(keras)
# Preparing data
input_names <- colnames(train_input)
input_size <- dim(train_input)
df_input <- train_input_scale <- train_input
if(scale_input){
maxs <- map_dbl(.x = df_input, .f = max)
mins <- map_dbl(.x = df_input, .f = min)
train_input_scale <- scale(train_input, center = mins, scale = maxs - mins)
}
if(is.matrix(train_input_scale)){
df_input <- as_tibble(train_input_scale)
matrix_input <- train_input_scale
} else{
df_input <- train_input_scale
matrix_input <- as.matrix(train_input_scale)
}
# Machines
lasso_machine <- function(x, lambda0){
if(is.null(lambda)){
cv <- cv.glmnet(matrix_train_x1, train_y1, alpha = 1, lambda = 10^(seq(-3,2,length.out = 50)))
mod <- glmnet(matrix_train_x1, train_y1, alpha = 1, lambda = cv$lambda.min)
} else{
mod <- glmnet(matrix_train_x1, train_y1, alpha = 1, lambda = lambda0)
}
res <- predict.glmnet(mod, newx = x)
return(list(pred = res,
model = mod))
}
ridge_machine <- function(x, lambda0){
if(is.null(lambda)){
cv <- cv.glmnet(matrix_train_x1, train_y1, alpha = 0, lambda = 10^(seq(-3,2,length.out = 50)))
mod <- glmnet(matrix_train_x1, train_y1, alpha = 0, lambda = cv$lambda.min)
} else{
mod <- glmnet(matrix_train_x1, train_y1, alpha = 0, lambda = lambda0)
}
res <- predict.glmnet(mod, newx = x)
return(list(pred = res,
model = mod))
}
tree_machine <- function(x, pa = NULL) {
mod <- tree(as.formula(paste("train_y1~",
paste(input_names, sep = "", collapse = "+"),
collapse = "",
sep = "")),
data = df_train_x1)
res <- as.vector(predict(mod, x))
return(list(pred = res,
model = mod))
}
knn_machine <- function(x, k0) {
mod <- knn.reg(train = matrix_train_x1, test = x, y = train_y1, k = k0)
res = mod$pred
return(list(pred = res,
model = k0))
}
RF_machine <- function(x, ntree0) {
if(is.null(mtry)){
mod <- randomForest(x = df_train_x1, y = train_y1, ntree = ntree0)
}else{
mod <- randomForest(x = df_train_x1, y = train_y1, ntree = ntree0, mtry = mtry)
}
res <- as.vector(predict(mod, x))
return(list(pred = res,
model = mod))
}
xgb_machine = function(x, nrounds_xgb0){
mod <- xgboost(data = matrix_train_x1,
label = train_y1,
eta = eta_xgb,
nrounds = nrounds_xgb0,
objective = "reg:squarederror",
early_stopping_rounds = early_stop_xgb,
max_depth = max_depth_xgb,
verbose = 0)
res <- predict(mod, x)
return(list(pred = res,
model = mod))
}
# All machines
all_machines <- list(lasso = lasso_machine,
ridge = ridge_machine,
knn = knn_machine,
tree = tree_machine,
rf = RF_machine,
xgb = xgb_machine)
# All parameters
all_parameters <- list(lasso = lambda,
ridge = lambda,
knn = k,
tree = 1,
rf = ntree,
xgb = nrounds_xgb)
if(is.null(machines)){
mach <- c("lasso", "ridge", "knn", "tree", "rf", "xgb")
}else{
mach <- machines
}
# Extracting data
M <- length(mach)
size_D1 <- floor(splits*input_size[1])
id_D1 <- logical(input_size[1])
id_D1[sample(input_size[1], size_D1)] <- TRUE
df_train_x1 <- df_input[id_D1,]
matrix_train_x1 <- matrix_input[id_D1,]
train_y1 <- train_response[id_D1]
df_train_x2 <- df_input[!id_D1,]
matrix_train_x2 <- matrix_input[!id_D1,]
# Function to extract df and model from 'map' function
extr_df <- function(x, id){
return(tibble("r_{{id}}":= as.vector(pred_m[[x]]$pred)))
}
extr_mod <- function(x, id){
return(pred_m[[x]]$model)
}
pred_D2 <- c()
all_mod <- c()
cat("\n* Building basic machines ...\n")
cat("\t~ Progress:")
for(m in 1:M){
if(mach[m] %in% c("tree", "rf")){
x0_test <- df_train_x2
} else {
x0_test <- matrix_train_x2
}
if(is.null(all_parameters[[mach[m]]])){
para_ <- 1
}else{
para_ <- all_parameters[[mach[m]]]
}
pred_m <- map(para_,
.f = ~ all_machines[[mach[m]]](x0_test, .x))
tem0 <- imap_dfc(.x = 1:length(para_),
.f = extr_df)
tem1 <- imap(.x = 1:length(para_),
.f = extr_mod)
names(tem0) <- names(tem1) <- paste0(mach[m], 1:length(para_))
pred_D2 <- bind_cols(pred_D2, as_tibble(tem0))
all_mod[[mach[m]]] <- tem1
cat(" ... ", round(m/M, 2)*100L,"%", sep = "")
}
if(scale_input){
return(list(predict2 = pred_D2,
models = all_mod,
id2 = !id_D1,
train_data = list(train_input = train_input_scale,
train_response = train_response),
scale_max = maxs,
scale_min = mins))
} else{
return(list(predict2 = pred_D2,
models = all_mod,
id2 = !id_D1,
train_data = list(train_input = train_input_scale,
train_response = train_response)))
}
}
Example.1: In this example, the method is implemented on Boston data of MASS library. The basic machines “rf”, “knn” and “xgb” are built on the first part of the training data (\(\mathcal{D}_{k}\)), and the Root Mean Square Errors (RMSE) evaluated on the second part of the training data (\(\mathcal{D}_{\ell}\)) used for aggregation) are reported.
pacman::p_load(MASS)
df <- Boston
basic_machines <- generateMachines(train_input = df[,1:13],
train_response = df[,14],
scale_input = TRUE,
machines = c("rf", "knn", "xgb"),
basicMachineParam = setBasicParameter(lambda = 1:10/10,
ntree = 10:20 * 25,
k = c(2:10)))
##
## * Building basic machines ...
## ~ Progress: ... 33% ... 67% ... 100%
basic_machines$predict2 %>%
sweep(1, df[basic_machines$id2, "medv"]) %>%
.^2 %>%
colMeans %>%
t %>%
sqrt %>%
as_tibble
3 Optimization algorithm
This part provides functions to approximate the smoothing parameter \(h>0\) of the aggregation. Two important optimization methods are implemented: gradient descent algorithm (grad) and grid search (grid).
3.1 Gradient descent algorithm
3.1.1 Function : setGradParameter
This function allows us to set the values of parameters needed to process the gradient descent algorithm to approximate the hyperparameter of the aggregation method.
• Argument:
• val_init : initial value of gradient descent iteration. By default, val_init = NULL and the algorithm will select the best value (with smallest cost function) among n_tries values of parameters.
• n_tries : the number of parameters used to evaluate the cost function (only when val_init = NULL), then the best one among them will be chosen as initial value for gradient descent algorithm.
• rate : the learning rate in gradent descent algorithm. By default, rate = NULL (or “auto”) and the value coef_auto = 0.005 will be used. It can also be a functional rate, which is a string element of {“logarithm”, “sqrtroot”, “linear”, “polynomial”, “exponential”}. Each rate is defined according to coef_ type arguments bellow.
• min_val : the mininum value of parameter to be considered as the initial value in gradient step. By default, min_val = 1e-4.
• max_val : the maxinum value of parameter to be considered as the initial value in gradient step. By default, max_val = 0.1.
• max_iter : maximum itertaion of gradient descent algorithm. By default, max_iter = 300.
• print_step : a logical value controlling whether to print the result of each gradient step or not in order to keep track of the algorithm. By default, print_step = TRUE.
• print_result : a logical value controlling whether to print the result of each gradient step or not in order to keep track of the algorithm. By default, print_result = TRUE.
• figure : a logical value controlling whether to plot a graphic of the result or not. By default, figure = TRUE.
• coef_auto : the constant learning rate when rate = NULL. By default, coef_auto = 0.005.
• coef_log : the coefficinet multiplying to the logarithmic increment of the learning rate, i.e., the rate is rate \(=\) coef_log\(\times \log(1+t)\) where \(t\) is the numer number of iteration. By default, coef_log = 1.
• coef_sqrt : the coefficinet multiplying to the square root increment of the learning rate, i.e., the rate is rate \(=\) coef_sqrt\(\times \sqrt{t}\). By default, coef_sqrt = 1.
• coef_lm : the coefficinet multiplying to the linear increment of the learning rate, i.e., the rate is rate \(=\) coef_lm\(\times t\). By default, coef_lm = 1.
• deg_poly : the degree of the polynomial increment of the learning rate, i.e., the rate is rate \(=t^{\texttt{coef_poly}}\). By default, deg_poly = 2.
• base_exp : the base of the exponential increment of the learning rate, i.e., the rate is rate \(=\) base_exp\(^t\). By default, base_exp = 1.5.
• threshold : the threshold to stop the algorithm what the relative change is smaller than this value. By default, threshold = 1e-10.
• Value:
This function returns a list of all the parameters given in its arguments.
setGradParameter <- function(val_init = NULL,
n_tries = 10,
rate = NULL,
min_val = 1e-4,
max_val = 0.1,
max_iter = 300,
print_step = TRUE,
print_result = TRUE,
figure = TRUE,
coef_auto = 0.005,
coef_log = 1,
coef_sqrt = 1,
coef_lm = 1,
deg_poly = 2,
base_exp = 1.5,
threshold = 1e-10) {
return(
list(val_init = val_init,
n_tries = n_tries,
rate = rate,
min_val = min_val,
max_val = max_val,
max_iter = max_iter,
print_step = print_step,
print_result = print_result,
figure = figure,
coef_auto = coef_auto,
coef_log = coef_log,
coef_sqrt = coef_sqrt,
coef_lm = coef_lm,
deg_poly = deg_poly,
base_exp = base_exp,
threshold = threshold
)
)
}
3.1.2 Function : gradOptimizer
This function performs gradient descent algorithm to approximate the minimizer of any given functions (convex or locally convex around its optimizer).
• Argument:
• obj_fun : the objective function for which its minimizer is to be estimated. It should be a univarate function of real positive variables.
• setParameter : the control of gradient descent parameters which should be the function setGradParameter() defined above.
• Value:
This function returns a list of the following objects:
• opt_param : the observed value of the minimizer.
• opt_error : the value of the optimal risk.
• all_grad : the vector of all the gradients collected during the walk of the algorithm.
• all_param : the vector of all parameters collected during the walk of the algorithm.
• run_time : the running time of the algorithm.
gradOptimizer <- function(obj_fun,
setParameter = setGradParameter()) {
start.time <- Sys.time()
# Optimization step:
# ==================
spec_print <- function(x) return(ifelse(x > 1e-6,
format(x, digit = 6, nsmall = 6),
format(x, scientific = TRUE, digit = 6, nsmall = 6)))
collect_val <- c()
gradients <- c()
if (is.null(setParameter$val_init)){
val_params <- seq(setParameter$min_val,
setParameter$max_val,
length.out = setParameter$n_tries)
tem <- map_dbl(.x = val_params, .f = obj_fun)
val <- val0 <- val_params[which.min(tem)]
grad_ <- pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3))
} else{
val <- val0 <- setParameter$val_init
grad_ <- pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3))
}
if(setParameter$print_step){
cat("\n* Gradient descent algorithm ...")
cat("\n Step\t| Parameter\t| Gradient\t| Threshold \n")
cat(" ", rep("-", 51), sep = "")
cat("\n 0 \t| ", spec_print(val0),
"\t| ", spec_print(grad_),
" \t| ", setParameter$threshold, "\n")
cat(" ", rep("-",51), sep = "")
}
if (is.numeric(setParameter$rate)){
lambda0 <- setParameter$rate / abs(grad_)
rate_GD <- "auto"
} else{
r0 <- setParameter$coef_auto / abs(grad_)
# Rate functions
rate_func <- list(auto = r0,
logarithm = function(i) setParameter$coef_log * log(2 + i) * r0,
sqrtroot = function(i) setParameter$coef_sqrt * sqrt(i) * r0,
linear = function(i) setParameter$coef_lm * (i) * r0,
polynomial = function(i) i ^ setParameter$deg_poly * r0,
exponential = function(i) setParameter$base_exp ^ i * r0)
rate_GD <- match.arg(setParameter$rate,
c("auto",
"logarithm",
"sqrtroot",
"linear",
"polynomial",
"exponential"))
lambda0 <- rate_func[[rate_GD]]
}
i <- 0
if (is.numeric(setParameter$rate) | rate_GD == "auto") {
while (i < setParameter$max_iter) {
if(is.na(grad_)){
val0 <- runif(1, val0*0.99, val0*1.01)
grad_ = pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3)
)
}
val <- val0 - lambda0 * grad_
if (val < 0){
val <- val0/2
lambda0 <- lambda0/2
}
if(i > 5){
if(sign(grad_) * sign(grad0) < 0){
lambda0 = lambda0 / 2
}
}
relative <- abs((val - val0) / val0)
test_threshold <- max(relative, abs(grad_))
if (test_threshold > setParameter$threshold){
val0 <- val
grad0 <- grad_
} else{
break
}
grad_ = pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3)
)
i <- i + 1
if(setParameter$print_step){
cat("\n ", i, "\t| ", spec_print(val),
"\t| ", spec_print(grad_),
"\t| ", test_threshold, "\r")
}
collect_val <- c(collect_val, val)
gradients <- c(gradients, grad_)
}
}
else{
while (i < setParameter$max_iter) {
if(is.na(grad_)){
val0 <- runif(1, val0*0.9, val0*1.1)
grad_ = pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3)
)
}
val <- val0 - lambda0(i) * grad_
if (val < 0){
val <- val0/2
r0 <- r0 / 2
}
if(i > 5){
if(sign(grad_)*sign(grad0) < 0)
r0 <- r0 / 2
}
relative <- abs((val - val0) / val0)
test_threshold <- max(relative, abs(grad_))
if (test_threshold > setParameter$threshold){
val0 <- val
grad0 <- grad_
}
else{
break
}
grad_ <- pracma::grad(
f = obj_fun,
x0 = val0,
heps = .Machine$double.eps ^ (1 / 3)
)
i <- i + 1
if(setParameter$print_step){
cat("\n ", i, "\t| ", spec_print(val),
"\t| ", spec_print(grad_),
"\t| ", test_threshold, "\r")
}
collect_val <- c(collect_val, val)
gradients <- c(gradients, grad_)
}
}
opt_ep <- val
opt_risk <- obj_fun(opt_ep)
if(setParameter$print_step){
cat(rep("-", 55), sep = "")
if(grad_ == 0){
cat("\n Stopped| ", spec_print(val),
"\t| ", 0,
"\t\t| ", test_threshold)
}else{
cat("\n Stopped| ", spec_print(val),
"\t| ", spec_print(grad_),
"\t| ", test_threshold)
}
}
if(setParameter$print_result){
cat("\n ~ Observed parameter:", opt_ep, " in",i, "iterations.")
}
if (setParameter$figure) {
siz <- length(collect_val)
tibble(x = 1:siz,
y = collect_val,
gradient = gradients) %>%
ggplot(aes(x = x, y = y)) +
geom_line(mapping = aes(color = gradient), size = 1) +
geom_point(aes(x = length(x), y = opt_ep), color = "red") +
geom_hline(yintercept = opt_ep, color = "red", linetype = "longdash") +
labs(title = "Gradient steps",
x = "Iteration",
y = "Parameter")-> p
print(p)
}
end.time = Sys.time()
return(list(
opt_param = opt_ep,
opt_error = opt_risk,
all_grad = gradients,
all_param = collect_val,
run_time = difftime(end.time,
start.time,
units = "secs")[[1]]
))
}
Example.2: Approximate \[x^*=\text{arg}\min_{x\in\mathbb{R}}f(x), \text{where }f(x)=(x-1)^2(1+\sin^2(2.5(x-1)))\] Note that argument val_init is crucial since \(f\) is not convex.
object_func <- function(x) (x-1)^2*(1+sin(2.5*(x-1))^2)
tibble::tibble(x = seq(-4,6, length.out = 200),
y = object_func(seq(-4,6, length.out = 200))) %>%
ggplot(aes(x = x, y = y)) +
geom_line(color = "skyblue", size = 0.75) +
labs(title = latex2exp::TeX("Cost function $f(x)=(x-1)^2(1+\\sin^2(2.5(x-1)))$")) -> p
print(p)
gd <- gradOptimizer(obj_fun = object_func,
setParameter = setGradParameter(val_init = 2.4,
rate = 1,
print_step = FALSE,
figure = TRUE))
##
## ~ Observed parameter: 1 in 59 iterations.
3.2 Grid search algorithm
3.2.1 Function : setGridParameter
This function allows to set the values of the grid search algorithm.
• Argument:
• min_val : the minimum value of parameter grid.
• max_val : the maximum value of parameter grid.
• n_val : the number of points in the grid.
• parameters : the vector of paramters in case the non-uniform grid is considered.
• print_result : a logical value specifying whether or not to print the observed result.
• figure : a logical value specifying whether or not to plot the graphic of error.
• Value:
This function returns a list of all the parameters given in its arguments.
setGridParameter <- function(min_val = 1e-4,
max_val = 0.1,
n_val = 300,
parameters = NULL,
print_result = TRUE,
figure = TRUE){
return(list(min_val = min_val,
max_val = max_val,
n_val = n_val,
parameters = parameters,
print_result = print_result,
figure = figure))
}
3.2.2 Function : gridOptimizer
• Argument:
• obj_fun : the objective function for which its minimizer is to be estimated. It should be a univarate function of real positive variables.
• setParameter : the control of grid search algorithm parameters which should be the function setGridParameter() defined above.
• Value:
This function returns a list of the following objects:
• opt_param : the observed value of the minimizer.
• opt_error : the value of optimal risk.
• all_risk : the vector of all the errors evaluated at all the values of considered parameters.
• run.time : the running time of the algorithm.
gridOptimizer <- function(obj_func,
setParameter = setGridParameter()){
t0 <- Sys.time()
if(is.null(setParameter$parameters)){
param <- seq(setParameter$min_val,
setParameter$max_val,
length.out = setParameter$n_val)
} else{
param <- setParameter$parameters
}
risk <- param %>%
map_dbl(.f = obj_func)
id_opt <- which.min(risk)
opt_ep <- param[id_opt]
opt_risk <- risk[id_opt]
if(setParameter$print_result){
cat("\n* Grid search algorithm...", "\n ~ Observed parameter :", opt_ep)
}
if(setParameter$figure){
tibble(x = param,
y = risk) %>%
ggplot(aes(x = x, y = y)) +
geom_line(color = "skyblue", size = 0.75) +
geom_point(aes(x = opt_ep, y = opt_risk), color = "red") +
geom_vline(xintercept = opt_ep, color = "red", linetype = "longdash") +
labs(title = "Error as function of parameter",
x = "Parameter",
y = "Error")-> p
print(p)
}
t1 <- Sys.time()
return(list(
opt_param = opt_ep,
opt_error = opt_risk,
all_risk = risk,
run.time = difftime(t1,
t0,
units = "secs")[[1]])
)
}
Example.2: Again with grid search.
grid <- gridOptimizer(obj_fun = object_func,
setParameter = setGridParameter(min_val = -3,
max_val = 5,
n_val = 500,
figure = TRUE))
##
## * Grid search algorithm...
## ~ Observed parameter : 1.008016
3.3 \(\kappa\)-cross validation lost function
Constructing aggregation method is equivalent to approximating the optimal value of smoothing parameter \(h>0\) introduced in section 1.1 by minimizing some lost function. In this study, we propose \(\kappa\)-fold cross validation lost function defined by
\[\begin{equation} \label{eq:kappa} \varphi^{\kappa}(h)=\frac{1}{\kappa}\sum_{k=1}^{\kappa}\sum_{(x_j,y_j)\in F_k}(g_n({\bf r}(x_j))-y_j)^2 \end{equation}\] where
• for any \(k=1,...,\kappa\), \(F_k\) denotes the \(k\)th validation fold.
• \(g_n({\bf r}(x_j))\) is the prediction of \(x_j\) of \(F_k\), computed using the data points from the remaining part \({\cal D}_{\ell}-F_k\) by, \[g_n({\bf r}(x_j))=\frac{\sum_{(x_i,y_i)\in{\cal D}_{\ell}-F_k}y_iK_h({\bf r}(x_j)- {\bf r}(x_i))}{\sum_{(x_i,y_i)\in{\cal D}_{\ell}-F_k}K_h({\bf r}(x_j)- {\bf r}(x_i))}\]
3.4 Function: dist_matrix
This function computes different distances between data points of each training folds (\(\mathcal{D}_{\ell}-F_k\)) and the corresponding validation fold \(F_k\) for any \(k=1,\dots,\kappa\). The distance matrices \(D_k=(d[{\bf r}(x_i),{\bf r}(x_j)])_{i,j}\) for \(k=1,\dots,\kappa\), where the distance \(d\) is defined according to different types kernel functions.
• Argument:
• basicMachines : the basic machine object, which is an output of generateMachines function.
• n_cv : the number \(\kappa\) of cross-validation folds. By default, n_cv = 5.
• kernel : the kernel function used for the aggregation, which is an element of {“gaussian”, “epanechnikov”, “biweight”, “triweight”, “triangular”, “naive”, “c.expo”, “expo”}. By default, kernel = "gaussian".
• id_shuffle : an integer vector of length equals to the size of the remaining part of the training data (\({\cal D}_{\ell}\)). Its elements are from {\(1,...,\kappa\)}, indicating the fold membership of the data points. By default, id_shuffle = NULL, and the data points will be shuffled randomly.
• Value:
This functions returns a list of the following objects:
• dist : a list of data frame (tibble) containing sublists corresponding to kernel functions used for the aggregation. Each sublist contains n_cv numbers of distance matrices \(D_k=(d[{\bf r}(x_i),{\bf r}(x_j)])_{i,j}\), for \(k=1,\dots,\kappa\), containing distances between the data points in valiation fold (by row) and the \(1-\kappa\) remaining folds of training data. The type of distance matrices depends on the kernel used:
• If kernel = naive, the distance matrices contain the maximum distance between data points, i.e., \[D_k=(\|{\bf r}(x_i)-{\bf r}(x_j)\|_{\max})_{i,j}\text{ for }k=1,\dots,\kappa.\]
• If kernel = triangular, the distance matrices contain the \(L_1\) distance between data points, i.e., dist_matrix \[D_k=(\|{\bf r}(x_i)-{\bf r}(x_j)\|_1)_{i,j}\text{ for }k=1,\dots,\kappa.\]
• Otherwise, the distance matrices contain the squared \(L_2\) distance between data points, i.e., \[D_k=(\|{\bf r}(x_i)-{\bf r}(x_j)\|_ 2^2)_{i,j}\text{ for }k=1,\dots,\kappa.\]
• ffleffle : the shuffled indices in cross-validation.
• n_cv : the number \(\kappa\) of cross-validation folds.
dist_matrix <- function(basicMachines,
n_cv = 5,
kernel = "gaussian",
id_shuffle = NULL){
n <- nrow(basicMachines$predict2)
n_each_fold <- floor(n/n_cv)
# shuffled indices
if(is.null(id_shuffle)){
shuffle <- 1:(n_cv-1) %>%
rep(n_each_fold) %>%
c(., rep(n_cv, n - n_each_fold * (n_cv - 1))) %>%
sample
}else{
shuffle <- id_shuffle
}
# the prediction matrix D_l
df_ <- as.matrix(basicMachines$predict2)
if(! (kernel %in% c("naive", "triangular"))){
pair_dist <- function(M, N){
n_N <- dim(N)
n_M <- dim(M)
res_ <- 1:nrow(N) %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(rowSums((M - matrix(rep(N[id,], n_M[1]), ncol = n_M[2], byrow = TRUE))^2)))))
return(res_)
}
}
if(kernel == "triangular"){
pair_dist <- function(M, N){
n_N <- dim(N)
n_M <- dim(M)
res_ <- 1:nrow(N) %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(rowSums(abs(M - matrix(rep(N[id,], n_M[1]), ncol = n_M[2], byrow = TRUE)))))))
return(res_)
}
}
if(kernel == "naive"){
pair_dist <- function(M, N){
n_N <- dim(N)
n_M <- dim(M)
res_ <- 1:nrow(N) %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(apply(abs(M - matrix(rep(N[id,], n_M[1]), ncol = n_M[2], byrow = TRUE)), 1, max)))))
return(res_)
}
}
L <- 1:n_cv %>%
map(.f = (\(x) pair_dist(df_[shuffle != x,],
df_[shuffle == x,])))
return(list(dist = L,
id_shuffle = shuffle,
n_cv = n_cv))
}
Example.3: The method dist_matrix is implemented on the obtained basic machines built in Example.1 with the corresponding Gaussian kernel function.
dis <- dist_matrix(basicMachines = basic_machines,
n_cv = 3,
kernel = "gaussian")
Example.4: From the distance matrix, we can compute the error corresponding to Gaussian kernel function, then use both of the optimization methods to approximate the smoothing paramter in this case.
# Gaussian kernel
gaussian_kern <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(exp(-(x*D)))
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Kappa cross-validation error
cost_fun <- function(.ep = .05,
.dist_matrix,
.kernel_func = NULL,
.train_response2){
return(.kernel_func(.ep = .ep,
.dist_matrix = .dist_matrix,
.train_response2 = .train_response2))
}
# cross_validation
err_cv <- function(x,
.dist_matrix = dis,
.kernel_func = gaussian_kern,
.train_response2 = df[basic_machines$id2, 14]) {
res <- cost_fun(.ep = x,
.dist_matrix = .dist_matrix,
.kernel_func = .kernel_func,
.train_response2 = .train_response2)
return(res)
}
# Optimization
opt_param_gd <- gradOptimizer(obj_fun = err_cv,
setParameter = setGradParameter(min_val = 0.0001,
max_val = 1,
rate = 0.007,
n_tries = 10,
print_step = FALSE,
print_result = TRUE,
figure = TRUE))
##
## ~ Observed parameter: 0.009389028 in 240 iterations.
# Optimization
opt_param_grid <- gridOptimizer(obj_fun = err_cv,
setParameter = setGridParameter(min_val = 0.0001,
max_val = 0.1,
n_val = 500,
figure = TRUE))
##
## * Grid search algorithm...
## ~ Observed parameter : 0.009309218
cat('* Observed parameter:\n\t - Gradient descent\t:',
opt_param_gd$opt_param,
'\t with error:', err_cv(opt_param_gd$opt_param),
'\n\t - Grid search\t\t:',opt_param_grid$opt_param,
'\t with error:', err_cv(opt_param_grid$opt_param))
## * Observed parameter:
## - Gradient descent : 0.009389028 with error: 2379.61
## - Grid search : 0.009309218 with error: 2379.624
3.5 Fitting parameter
This function gathers the constructed machines and perform an optimization algorithm to approximate the smoothing parameter for the aggregation.
• Argument:
• train_design : a matrix or data frame of the training input data or the predictions given by some predictors.
• If the input data is given, the option build_machine must be TRUE and all the chosen machines will be constructed using a proportion of the training input (splits).
• If the predictions are given, the option build_machine must be FALSE which indicates that no basic machine is constructed and the paramter is tuned using this predicted features directly.
• train_response : a vector of corresponding response variable of the train_design.
• scale_input : a logical value specifying whether or not to scale the input data before building the basic regression predictors. By default, scale_input = FALSE.
• scale_machine : a logical value specifying whether or not to scale the predicted features given by all the basic regression predictors, for aggregation. By default, scale_machine = FALSE.
• build_machine: a logical value specifying whether or not the basic machines should be constructed. It should be TRUE if the train_design is the input data, else it should be FALSE is the train_design is the features of predictions. By default, build_machine = TRUE.
• machines : a vector of basic machines to be constructed. It must be a subset of {“lasso”, “ridge”, “knn”, “tree”, “rf”, “xgb”}. By default, machines = NULL and all the six types of basic machines are built.
• splits : the proportion of training data used to build the basic machines. By default, splits = .5.
• n_cv : the number of cross-validation folds used to tune the smoothing parameter.
• sig, alp : the support constant \(\sigma>0\) and the exponent \(\alpha>0\) of compactly exponential kernel: \(K(x)=e^{-\|x\|^{\alpha}}\mathbb{1}_{\{\|x\|\leq\sigma\}}\) for any \(x\in\mathbb{R}^d\). By default, sig = 3 and alpha = 2.
• kernels : the kernel function or vector of kernel functions used for the aggregation.
• optimizeMethod : the optimization methods used to learn the smoothing parameter. By default, optimizeMethod (“grad”) which stands for gradient descent algorithm, and if “optimizeMethod = grid”, then the grid search algorithm is used. Note that this should be of the same size as the kernels argument, otherwise “grid” method will be used for all the kernels.
• setBasicMachineParam : an option used to set the values of the parameters of the basic machines. setBasicParameter function should be fed to this argument.
• setGradParam : an option used to set the values of the parameters of the gradient descent algorithm. setGradParameter function should be fed to it.
• setGridParam : an option used to set the values of the parameters of the grid search algorithm. setGridParameter function should be fed to it.
• Value:
This function returns a list of the following objects:
• opt_parameters : the observed optimal parameter.
• add_parameters : other aditional parameters such as scaling options, parameters of kernel functions and the optimization methods used.
• basic_machines : the list of basic machine object.
• .scale : the maximum and minimum scaling values of input data.
fit_parameter <- function(train_design,
train_response,
scale_input = FALSE,
scale_machine = FALSE,
build_machine = TRUE,
machines = NULL,
splits = 0.5,
n_cv = 5,
sig = 3,
alp = 2,
kernels = "gaussian",
optimizeMethod = "grad",
setBasicMachineParam = setBasicParameter(),
setGradParam = setGradParameter(),
setGridParam = setGridParameter()){
kernels_lookup <- c("gaussian", "epanechnikov", "biweight", "triweight", "triangular", "naive", "c_exp", "expo")
kernel_real <- kernels %>%
sapply(FUN = function(x) return(match.arg(x, kernels_lookup)))
if(build_machine){
mach2 <- generateMachines(train_input = train_design,
train_response = train_response,
scale_input = scale_input,
machines = machines,
splits = splits,
basicMachineParam = setBasicMachineParam)
} else{
mach2 <- list(predict2 = train_design,
models = colnames(train_design),
id2 = rep(TRUE, nrow(train_design)),
train_data = list(train_response = train_response))
}
maxs_ <- mins_ <- NULL
if(scale_machine){
maxs_ <- map_dbl(.x = mach2$predict2, .f = max)
mins_ <- map_dbl(.x = mach2$predict2, .f = min)
mach2$predict2 <- scale(mach2$predict2,
center = mins_,
scale = maxs_ - mins_)
}
# distance matrix to compute loss function
if_euclid <- FALSE
id_euclid <- NULL
n_ker <- length(kernels)
dist_all <- list()
id_shuf <- NULL
for (k_ in 1:n_ker) {
ker <- kernel_real[k_]
if(ker == "naive"){
dist_all[["naive"]] <- dist_matrix(basicMachines = mach2,
n_cv = n_cv,
kernel = "naive",
id_shuffle = id_shuf)
} else{
if(ker == "triangular"){
dist_all[["triangular"]] <- dist_matrix(basicMachines = mach2,
n_cv = n_cv,
kernel = "triangular",
id_shuffle = id_shuf)
} else{
if(if_euclid){
dist_all[[ker]] <- dist_all[[id_euclid]]
} else{
dist_all[[ker]] <- dist_matrix(basicMachines = mach2,
n_cv = n_cv,
kernel = ker,
id_shuffle = id_shuf)
id_euclid <- ker
if_euclid <- TRUE
}
}
}
id_shuf <- dist_all[[1]]$id_shuffle
}
# Kernel functions
# ================
# expo
expo_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2,
.alpha = alp){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(exp(- (x*D)^.alpha))
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# C_expo
c.expo_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2,
.sigma = sig,
.alpha = alp){
kern_fun <- function(x, id, D){
tem0 <- x*D
tem0[tem0 < .sigma] <- 0
tem1 <- as.matrix(exp(- tem0^.alpha))
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem1/colSums(tem1)
y_hat[is.na(y_hat)] <- 0
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Gaussian
gaussian_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(exp(- (x*D)/2))
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Epanechnikov
epanechnikov_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(1- x*D)
tem0[tem0 < 0] = 0
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Biweight
biweight_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(1- x*D)
tem0[tem0 < 0] = 0
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0^2/colSums(tem0^2)
y_hat[is.na(y_hat)] <- 0
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Triweight
triweight_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(1- x*D)
tem0[tem0 < 0] = 0
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0^3/colSums(tem0^3)
y_hat[is.na(y_hat)] <- 0
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Triangular
triangular_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- as.matrix(1- x*D)
tem0[tem0 < 0] <- 0
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
y_hat[is.na(y_hat)] = 0
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# Naive
naive_kernel <- function(.ep = .05,
.dist_matrix,
.train_response2){
kern_fun <- function(x, id, D){
tem0 <- (as.matrix(x*D) < 1)
y_hat <- .train_response2[.dist_matrix$id_shuffle != id] %*% tem0/colSums(tem0)
y_hat[is.na(y_hat)] = 0
return(sum((y_hat - .train_response2[.dist_matrix$id_shuffle == id])^2))
}
temp <- map2(.x = 1:.dist_matrix$n_cv,
.y = .dist_matrix$dist,
.f = ~ kern_fun(x = .ep, id = .x, D = .y))
return(Reduce("+", temp))
}
# error function
error_cv <- function(x,
.dist_matrix = NULL,
.kernel_func = NULL,
.train_response2 = NULL){
res <- .kernel_func(.ep = x,
.dist_matrix = .dist_matrix,
.train_response2 = .train_response2)
return(res/n_cv)
}
# list of kernel functions
list_funs <- list(gaussian = gaussian_kernel,
epanechnikov = epanechnikov_kernel,
biweight = biweight_kernel,
triweight = triweight_kernel,
triangular = triangular_kernel,
naive = naive_kernel,
expo = expo_kernel,
c.expo = c.expo_kernel)
# error for all kernel functions
error_func <- kernel_real %>%
map(.f = ~ (\(x) error_cv(x,
.dist_matrix = dist_all[[.x]],
.kernel_func = list_funs[[.x]],
.train_response2 = train_response[mach2$id2])))
names(error_func) <- kernels
# list of prameter setup
list_param <- list(grad = setGradParam,
GD = setGradParam,
grid = setGridParam)
# list of optimizer
list_optimizer <- list(grad = gradOptimizer,
GD = gradOptimizer,
grid = gridOptimizer)
optMethods <- optimizeMethod
if(length(kernels) != length(optMethods)){
warning("* kernels and optimization methods differ in sides! Grid search will be used!")
optMethods = rep("grid", length(kernels))
}
# Optimization
parameters <- map2(.x = kernels,
.y = optMethods,
.f = ~ list_optimizer[[.y]](obj_fun = error_func[[.x]],
setParameter = list_param[[.y]]))
names(parameters) <- paste0(kernel_real, "_", optMethods)
return(list(opt_parameters = parameters,
add_parameters = list(scale_input = scale_input,
scale_machine = scale_machine,
sig = sig,
alp = alp,
opt_methods = optimizeMethod),
basic_machines = mach2,
.scale = list(min = mins_,
max = maxs_)))
}
Example.5: We approximate the smoothing parameter of Boston data.
df <- MASS::Boston
train <- logical(nrow(df))
train[sample(length(train), floor(0.75*nrow(df)))] <- TRUE
param <- fit_parameter(train_design = df[train, 1:13],
train_response = df[train, 14],
machines = c("knn", "rf", "xgb"),
splits = .65,
n_cv = 3,
kernels = c("gaussian", "gaussian", "biweight", "triangular"),
optimizeMethod = c("grad", "grid", "grid", "grid"),
setBasicMachineParam = setBasicParameter(k = 2:5,
ntree = c(1,3,5)*100,
nrounds_xgb = c(1,3,5)*100),
setGradParam = setGradParameter(rate = 0.001))
##
## * Building basic machines ...
## ~ Progress: ... 33% ... 67% ... 100%
## * Gradient descent algorithm ...
## Step | Parameter | Gradient | Threshold
## ---------------------------------------------------
## 0 | 0.033400 | 64.605213 | 1e-10
## ---------------------------------------------------
## 1 | 0.032400 | -4.13601e-01 | 64.60521
## 2 | 0.0324064 | 0.0201676 | 0.4136014
## 3 | 0.0324061 | -9.77896e-04 | 0.0201676
## 4 | 0.0324061 | 4.74145e-05 | 0.0009778963
## 5 | 0.0324061 | -2.28108e-06 | 4.741446e-05
## 6 | 0.0324061 | 1.07952e-07 | 2.281076e-06
## 7 | 0.0324061 | -9.38714e-09 | 1.079521e-07
## 8 | 0.0324061 | -1.87743e-08 | 9.387143e-09
## 9 | 0.0324061 | 9.38714e-09 | 1.877429e-08
## 10 | 0.0324061 | 0e+00 | 9.387143e-09
-------------------------------------------------------
## Stopped| 0.0324061 | 0 | 0
## ~ Observed parameter: 0.0324061 in 10 iterations.
##
## * Grid search algorithm...
## ~ Observed parameter : 0.03250903
##
## * Grid search algorithm...
## ~ Observed parameter : 0.002104682
##
## * Grid search algorithm...
## ~ Observed parameter : 0.01780803
param$opt_parameters %>%
map_dfc(.f = ~ .x$opt_param) %>%
print
## # A tibble: 1 × 4
## gaussian_grad gaussian_grid biweight_grid triangular_grid
## <dbl> <dbl> <dbl> <dbl>
## 1 0.0324 0.0325 0.00210 0.0178
4 Prediction
The smoothing parameter obtained from the previous section can be used to make the final predictions.
4.1 Kernel functions
Several types of kernel functions used for the aggregation are defined in this section.
• Argument:
• epsilon : the value of the parameter used.
• .y2 : the vector of response variable of the second part \(\mathcal{D}_{\ell}\) of the training data, which is used for the aggregation.
• .distance : the distance matrix object obtained from dist_matrix function.
• .kern : the string specifying the kernel function. By default, .kern = "gaussian".
• .sig, .alp : the parameters of exponential kernel function.
• .meth : the string of optimization methods to be linked to the name of the kernel functions if one kernel is used more than once.
• Value:
This function returns the predictions of the aggregation method evaluated with the given parameter.
kernel_pred <- function(epsilon,
.y2,
.distance,
.kern = "gaussian",
.sig = sqrt(.5),
.alp = 2,
.meth = NA){
dis <- as.matrix(.distance)
# Kernel functions
# ================
expo_kernel <- function(.ep,
.alpha = .alp){
tem0 <- exp(- (.ep*dis)^.alpha)
y_hat <- .y2 %*% tem0/colSums(tem0)
return(t(y_hat))
}
c.expo_kernel <- function(.ep,
.sigma = .sig,
.alpha = .alp){
tem0 <- .ep*dis
tem0[tem0 < .sigma] <- 0
tem1 <- exp(- tem0^.alpha)
y_hat <- .y2 %*% tem1/colSums(tem1)
y_hat[is.na(y_hat)] <- 0
return(t(y_hat))
}
gaussian_kernel <- function(.ep){
tem0 <- exp(- (.ep*dis)/2)
y_hat <- .y2 %*% tem0/colSums(tem0)
return(t(y_hat))
}
# Epanechnikov
epanechnikov_kernel <- function(.ep){
tem0 <- 1- .ep*dis
tem0[tem0 < 0] = 0
y_hat <- .y2 %*% tem0/colSums(tem0)
return(t(y_hat))
}
# Biweight
biweight_kernel <- function(.ep){
tem0 <- 1- .ep*dis
tem0[tem0 < 0] = 0
y_hat <- .y2 %*% tem0^2/colSums(tem0^2)
y_hat[is.na(y_hat)] <- 0
return(t(y_hat))
}
# Triweight
triweight_kernel <- function(.ep){
tem0 <- 1- .ep*dis
tem0[tem0 < 0] = 0
y_hat <- .y2 %*% tem0^3/colSums(tem0^3)
y_hat[is.na(y_hat)] <- 0
return(t(y_hat))
}
# Triangular
triangular_kernel <- function(.ep){
tem0 <- 1- .ep*dis
tem0[tem0 < 0] <- 0
y_hat <- .y2 %*% tem0/colSums(tem0)
y_hat[is.na(y_hat)] = 0
return(t(y_hat))
}
# Naive
naive_kernel <- function(.ep){
tem0 <- (.ep*dis < 1)
y_hat <- .y2 %*% tem0/colSums(tem0)
y_hat[is.na(y_hat)] = 0
return(t(y_hat))
}
# Prediction
kernel_list <- list(gaussian = gaussian_kernel,
epanechnikov = epanechnikov_kernel,
biweight = biweight_kernel,
triweight = triweight_kernel,
triangular = triangular_kernel,
naive = naive_kernel,
expo = expo_kernel,
c.expo = c.expo_kernel)
res <- tibble(as.vector(kernel_list[[.kern]](.ep = epsilon)))
names(res) <- ifelse(is.na(.meth),
.kern,
paste0(.kern, '_', .meth))
return(res)
}
4.2 Functions: predict_agg
• Argument:
• fitted_models : the object obtained from fit_parameter function.
• new_data : the new testing data to be predicted.
• test_response : the testing response variable, it is optional. If it is given, the mean square error on the testing data is also computed. By default, test_response = NULL.
• Value:
This function returns a list of the following objects:
• fitted_aggregate : the predictions by the aggregation methods.
• fitted_machine : the predictions given by all the basic machines.
• mse : the mean square error computed only if the test_reponse argument is note NULL.
# Prediction
predict_agg <- function(fitted_models,
new_data,
test_response = NULL){
opt_param <- fitted_models$opt_parameters
add_param <- fitted_models$add_parameters
basic_mach <- fitted_models$basic_machines
kern0 <- names(opt_param)
kernel0 <- stringr::str_split(kern0, "_") %>%
imap_dfc(.f = ~ tibble("{.y}" := .x))
kerns <- kernel0[1,] %>%
as.character
opt_meths <- kernel0[2,] %>%
as.character
new_data_ <- new_data
# if basic machines are built
if(is.list(basic_mach$models)){
mat_input <- as.matrix(basic_mach$train_data$train_input)
if(add_param$scale_input){
new_data_ <- scale(new_data,
center = basic_mach$scale_min,
scale = basic_mach$scale_max - basic_mach$scale_min)
}
if(is.matrix(new_data_)){
mat_test <- new_data_
df_test <- as_tibble(new_data_)
} else {
mat_test <- as.matrix(new_data_)
df_test <- new_data_
}
# Prediction test by basic machines
built_models <- basic_mach$models
pred_test <- function(meth){
if(meth == "knn"){
pre <- 1:length(built_models[[meth]]) %>%
map_dfc(.f = (\(k) tibble('{{k}}' := FNN::knn.reg(train = mat_input[!basic_mach$id2,],
test = mat_test,
y = basic_mach$train_data$train_response[!basic_mach$id2],
k = built_models[[meth]][[k]])$pred)))
}
if(meth %in% c("tree", "rf")){
pre <- 1:length(built_models[[meth]]) %>%
map_dfc(.f = (\(k) tibble('{{k}}' := as.vector(predict(built_models[[meth]][[k]], df_test)))))
}
if(meth %in% c("lasso", "ridge")){
pre <- 1:length(built_models[[meth]]) %>%
map_dfc(.f = (\(k) tibble('{{k}}' := as.vector(predict.glmnet(built_models[[meth]][[k]], mat_test)))))
}
if(meth == "xgb"){
pre <- 1:length(built_models[[meth]]) %>%
map_dfc(.f = (\(k) tibble('{{k}}' := as.vector(predict(built_models[[meth]][[k]], mat_test)))))
}
colnames(pre) <- names(built_models[[meth]])
return(pre)
}
pred_test_all <- names(built_models) %>%
map_dfc(.f = pred_test)
} else{
pred_test_all <- new_data_
}
pred_test0 <- pred_test_all
if(add_param$scale_machine){
pred_test_all <- scale(pred_test_all,
center = fitted_models$.scale$min,
scale = fitted_models$.scale$max - fitted_models$.scale$min)
}
# Prediction train2
pred_train_all <- basic_mach$predict2
colnames(pred_test_all) <- colnames(pred_train_all)
d_train <- dim(pred_train_all)
d_test <- dim(pred_test_all)
pred_test_mat <- as.matrix(pred_test_all)
pred_train_mat <- as.matrix(pred_train_all)
# Distance matrix
dist_mat <- function(kernel = "gaussian"){
if(!(kernel %in% c("naive", "triangular"))){
res_ <- 1:d_test[1] %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(rowSums((pred_train_mat - matrix(rep(pred_test_mat[id,],
d_train[1]),
ncol = d_train[2],
byrow = TRUE))^2)))))
}
if(kernel == "triangular"){
res_ <- 1:d_test[1] %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(rowSums(abs(pred_train_mat - matrix(rep(pred_test_mat[id,],
d_train[1]),
ncol = d_train[2],
byrow = TRUE)))))))
}
if(kernel == "naive"){
res_ <- 1:d_test[1] %>%
map_dfc(.f = (\(id) tibble('{{id}}' := as.vector(apply(abs(pred_train_mat - matrix(rep(pred_test_mat[id,], d_train[1]),
ncol = d_train[2],
byrow = TRUE)), 1, max)))))
}
return(res_)
}
dists <- 1:length(kerns) %>%
map(.f = ~ dist_mat(kerns[.x]))
tab_nam <- table(kerns)
nam <- names(tab_nam[tab_nam > 1])
vec <- rep(NA, length(kerns))
for(id in nam){
id_ <- kerns == id
if(!is.null(id_)){
vec[id_] = add_param$opt_methods[id_]
}
}
prediction <- 1:length(kerns) %>%
map_dfc(.f = ~ kernel_pred(epsilon = opt_param[[kern0[.x]]]$opt_param,
.y2 = basic_mach$train_data$train_response[basic_mach$id2],
.distance = dists[[.x]],
.kern = kerns[.x],
.sig = add_param$sig,
.alp = add_param$alp,
.meth = vec[.x]))
if(is.null(test_response)){
return(list(fitted_aggregate = prediction,
fitted_machine = pred_test_all))
} else{
error <- cbind(pred_test_all, prediction) %>%
dplyr::mutate(y_test = test_response) %>%
dplyr::summarise_all(.funs = ~ (. - y_test)) %>%
dplyr::select(-y_test) %>%
dplyr::summarise_all(.funs = ~ mean(.^2))
return(list(fitted_aggregate = prediction,
fitted_machine = pred_test0,
mse = error))
}
}
Example.6 Aggregation on Boston dataset.
pred <- predict_agg(param,
new_data = df[!train, -14],
test_response = df[!train, 14])
sqrt(pred$mse)
5 Function : kernelAggReg
This function puts together all the functions above and provides the desire result of the kernel-based consensual aggregation method.
kernelAggReg <- function(train_design,
train_response,
test_design,
test_response = NULL,
scale_input = FALSE,
scale_machine = FALSE,
build_machine = TRUE,
machines = NULL,
splits = 0.5,
n_cv = 5,
sig = 3,
alp = 2,
kernels = "gaussian",
optimizeMethod = "grad",
setBasicMachineParam = setBasicParameter(),
setGradParam = setGradParameter(),
setGridParam = setGridParameter()){
# build machines + tune parameter
fit_mod <- fit_parameter(train_design = train_design,
train_response = train_response,
scale_input = scale_input,
scale_machine = scale_machine,
build_machine = build_machine,
machines = machines,
splits = splits,
n_cv = n_cv,
sig = sig,
alp = alp,
kernels = kernels,
optimizeMethod = optimizeMethod,
setBasicMachineParam = setBasicMachineParam,
setGradParam = setGradParam,
setGridParam = setGridParam)
# prediction
pred <- predict_agg(fitted_models = fit_mod,
new_data = test_design,
test_response = test_response)
return(list(fitted_aggregate = pred$fitted_aggregate,
fitted_machine = pred$fitted_machine,
pred_train2 = fit_mod$basic_machines$predict2,
opt_parameter = fit_mod$opt_parameters,
mse = pred$mse,
kernels = kernels,
ind_D2 = fit_mod$basic_machines$id2))
}
Example.7 A complete aggregation is implemented on Abalone dataset. Three types of basic machines, and three different kernel functions are used.
pacman::p_load(readr)
colname <- c("Type", "LongestShell", "Diameter", "Height", "WholeWeight", "ShuckedWeight", "VisceraWeight", "ShellWeight", "Rings")
df <- readr::read_delim("https://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data", col_names = colname, delim = ",", show_col_types = FALSE)
train <- logical(nrow(df))
train[sample(length(train), floor(0.75*nrow(df)))] <- TRUE
agg <- kernelAggReg(train_design = df[train, 2:8],
train_response = df$Rings[train],
test_design = df[!train, 2:8],
test_response = df$Rings[!train],
machines = c("knn", "rf", "xgb"),
splits = .5,
n_cv = 3,
kernels = c("gaussian","triangular"),
optimizeMethod = c("grad", "grid"),
setBasicMachineParam = setBasicParameter(k = 2:10,
ntree = 1:5*100,
nrounds_xgb = 1:5*100),
setGradParam = setGradParameter(rate = 0.07,
print_step = TRUE),
setGridParam = setGridParameter(n_val = 100))
##
## * Building basic machines ...
## ~ Progress: ... 33% ... 67% ... 100%
## * Gradient descent algorithm ...
## Step | Parameter | Gradient | Threshold
## ---------------------------------------------------
## 0 | 0.100000 | -6.42721e+02 | 1e-10
## ---------------------------------------------------
## 1 | 0.170000 | 44.878464 | 642.7214
## 2 | 0.165112 | 17.640025 | 44.87846
## 3 | 0.163191 | 6.480987 | 17.64002
## 4 | 0.162485 | 2.313328 | 6.480987
## 5 | 0.162233 | 0.816705 | 2.313328
## 6 | 0.162144 | 0.287190 | 0.8167048
## 7 | 0.162113 | 0.100847 | 0.2871902
## 8 | 0.162102 | 0.0353948 | 0.1008471
## 9 | 0.162098 | 0.0124206 | 0.03539479
## 10 | 0.162097 | 0.00435826 | 0.01242058
## 11 | 0.162096 | 0.0015292 | 0.004358263
## 12 | 0.162096 | 0.000536757 | 0.001529203
## 13 | 0.162096 | 0.000188231 | 0.0005367569
## 14 | 0.162096 | 6.6123e-05 | 0.000188231
## 15 | 0.162096 | 2.3205e-05 | 6.612304e-05
## 16 | 0.162096 | 8.11049e-06 | 2.320502e-05
## 17 | 0.162096 | 2.92879e-06 | 8.110492e-06
## 18 | 0.162096 | 9.01166e-07 | 2.928789e-06
## 19 | 0.162096 | 3.00389e-07 | 9.011658e-07
## 20 | 0.162096 | 1.12646e-07 | 3.003886e-07
## 21 | 0.162096 | 3.75486e-08 | 1.126457e-07
## 22 | 0.162096 | 3.75486e-08 | 3.754857e-08
## 23 | 0.162096 | 7.50971e-08 | 3.754857e-08
## 24 | 0.162096 | -7.50971e-08 | 7.509715e-08
## 25 | 0.162096 | 7.50971e-08 | 7.509715e-08
## 26 | 0.162096 | 0e+00 | 7.509715e-08
-------------------------------------------------------
## Stopped| 0.162096 | 0 | 0
## ~ Observed parameter: 0.162096 in 26 iterations.
|
{
"url": "https://hassothea.github.io/KernelAggReg.html",
"source_domain": "hassothea.github.io",
"snapshot_id": "CC-MAIN-2023-06",
"warc_metadata": {
"Content-Length": "1049387",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:2EFNV3WJC65KC2JTCF2RYKKJAB5BQONS",
"WARC-Concurrent-To": "<urn:uuid:185edfa2-7bce-4251-bbb4-a16c16da2389>",
"WARC-Date": "2023-01-27T13:37:47Z",
"WARC-IP-Address": "185.199.108.153",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:2C37CDOKDC5IJEVJEARC25JCOISFRZYB",
"WARC-Record-ID": "<urn:uuid:e2d93cc9-455b-4367-9cd8-b0351fccbdd6>",
"WARC-Target-URI": "https://hassothea.github.io/KernelAggReg.html",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:2f73f2af-83ce-4388-9f0a-4464ae92787c>"
},
"warc_info": "isPartOf: CC-MAIN-2023-06\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for January/February 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-163\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
35,
36,
266,
267,
312,
313,
346,
347,
430,
431,
542,
543,
544,
768,
769,
796,
797,
798,
844,
845,
872,
873,
1609,
1610,
2180,
2181,
2204,
2205,
2412,
2413,
2463,
2464,
2508,
2545,
2574,
2575,
2576,
2604,
2629,
2655,
2656,
2690,
2711,
2734,
2763,
2783,
2807,
2829,
2852,
2878,
2901,
2921,
2922,
2948,
2949,
3039,
3040,
3073,
3074,
3162,
3163,
3177,
3178,
3276,
3375,
3457,
3663,
3787,
3910,
4074,
4143,
4154,
4155,
4336,
4337,
4338,
4544,
4545,
4546,
4591,
4630,
4674,
4718,
4762,
4812,
4865,
4915,
4930,
4951,
4962,
4982,
5000,
5024,
5056,
5093,
5128,
5132,
5134,
5135,
5167,
5168,
5233,
5234,
5248,
5249,
5320,
5416,
5566,
5771,
6043,
6218,
6229,
6230,
6289,
6290,
6417,
6524,
6722,
6865,
6866,
6978,
6979,
6980,
7023,
7068,
7118,
7165,
7209,
7280,
7316,
7344,
7380,
7413,
7453,
7500,
7553,
7604,
7607,
7620,
7643,
7668,
7699,
7721,
7747,
7773,
7776,
7795,
7834,
7867,
7914,
7933,
7978,
8023,
8103,
8107,
8143,
8188,
8226,
8236,
8270,
8319,
8323,
8326,
8339,
8380,
8405,
8506,
8588,
8600,
8676,
8682,
8723,
8751,
8781,
8785,
8826,
8851,
8952,
9034,
9046,
9122,
9128,
9169,
9197,
9227,
9231,
9274,
9321,
9401,
9450,
9496,
9532,
9570,
9598,
9628,
9632,
9667,
9743,
9762,
9790,
9819,
9823,
9861,
9884,
9957,
9968,
10054,
10060,
10098,
10126,
10156,
10160,
10203,
10247,
10285,
10319,
10362,
10413,
10472,
10518,
10550,
10577,
10605,
10635,
10639,
10642,
10659,
10706,
10753,
10796,
10841,
10881,
10923,
10942,
10984,
11026,
11061,
11097,
11134,
11178,
11203,
11263,
11272,
11293,
11297,
11317,
11337,
11378,
11412,
11460,
11463,
11497,
11539,
11575,
11610,
11653,
11656,
11713,
11743,
11804,
11808,
11839,
11869,
11873,
11876,
11893,
11910,
11953,
11976,
11993,
12031,
12060,
12073,
12106,
12112,
12156,
12173,
12184,
12225,
12231,
12258,
12322,
12366,
12401,
12441,
12473,
12540,
12591,
12622,
12673,
12677,
12696,
12732,
12766,
12796,
12864,
12932,
12966,
13001,
13011,
13047,
13081,
13111,
13179,
13248,
13252,
13254,
13255,
13604,
13605,
13606,
13627,
13640,
13700,
13743,
13780,
13831,
13905,
13973,
14035,
14039,
14072,
14113,
14141,
14188,
14198,
14213,
14221,
14232,
14244,
14245,
14270,
14271,
14477,
14478,
14509,
14510,
14544,
14545,
14711,
14712,
14726,
14727,
14928,
15126,
15461,
15592,
15722,
15816,
15992,
16172,
16290,
16384,
16610,
16793,
16958,
17114,
17264,
17402,
17413,
17414,
17493,
17494,
17541,
17585,
17628,
17673,
17717,
17763,
17812,
17862,
17907,
17955,
17998,
18042,
18084,
18127,
18172,
18222,
18232,
18262,
18287,
18306,
18331,
18356,
18383,
18414,
18449,
18472,
18501,
18528,
18557,
18582,
18609,
18636,
18664,
18670,
18674,
18676,
18677,
18708,
18709,
18860,
18861,
18875,
18876,
19021,
19148,
19159,
19160,
19219,
19220,
19275,
19324,
19417,
19508,
19560,
19595,
19658,
19685,
19708,
19731,
19784,
19861,
19957,
19978,
19997,
20036,
20081,
20126,
20183,
20233,
20279,
20306,
20326,
20344,
20388,
20398,
20439,
20466,
20486,
20504,
20548,
20552,
20583,
20629,
20693,
20730,
20771,
20807,
20854,
20890,
20894,
20932,
20978,
21000,
21010,
21056,
21077,
21111,
21199,
21283,
21359,
21438,
21518,
21563,
21599,
21639,
21678,
21715,
21756,
21798,
21834,
21838,
21847,
21906,
21946,
21970,
22018,
22048,
22072,
22094,
22141,
22150,
22158,
22194,
22214,
22236,
22265,
22273,
22290,
22333,
22365,
22375,
22383,
22426,
22476,
22528,
22548,
22571,
22585,
22599,
22607,
22635,
22657,
22677,
22722,
22730,
22747,
22782,
22831,
22871,
22913,
22921,
22962,
23001,
23007,
23011,
23019,
23059,
23083,
23129,
23159,
23183,
23205,
23252,
23261,
23269,
23308,
23328,
23350,
23371,
23379,
23396,
23436,
23459,
23467,
23510,
23560,
23612,
23632,
23655,
23663,
23675,
23689,
23697,
23726,
23748,
23768,
23813,
23821,
23838,
23873,
23922,
23962,
24004,
24012,
24053,
24092,
24098,
24102,
24118,
24148,
24179,
24211,
24231,
24275,
24295,
24329,
24340,
24384,
24420,
24452,
24459,
24463,
24496,
24564,
24568,
24597,
24628,
24650,
24678,
24715,
24749,
24810,
24876,
24954,
24991,
25019,
25051,
25064,
25068,
25092,
25107,
25131,
25157,
25183,
25212,
25247,
25284,
25329,
25334,
25336,
25337,
25517,
25518,
25519,
25575,
25624,
25689,
25719,
25766,
25855,
25864,
25865,
25908,
25974,
26032,
26100,
26164,
26168,
26215,
26216,
26242,
26243,
26277,
26278,
26347,
26348,
26362,
26363,
26416,
26469,
26517,
26604,
26697,
26784,
26795,
26796,
26875,
26876,
26922,
26967,
27010,
27058,
27108,
27153,
27186,
27219,
27248,
27287,
27330,
27362,
27364,
27365,
27396,
27397,
27411,
27412,
27557,
27689,
27700,
27701,
27760,
27761,
27816,
27861,
27961,
28013,
28049,
28110,
28129,
28169,
28209,
28248,
28298,
28308,
28345,
28349,
28369,
28396,
28424,
28450,
28477,
28510,
28587,
28591,
28618,
28641,
28666,
28700,
28750,
28815,
28893,
28947,
28975,
29003,
29016,
29020,
29039,
29054,
29078,
29104,
29125,
29154,
29183,
29229,
29233,
29235,
29236,
29271,
29272,
29273,
29318,
29385,
29451,
29517,
29586,
29590,
29621,
29657,
29658,
29704,
29705,
29961,
29962,
30125,
30126,
30203,
30526,
30527,
30553,
30554,
30921,
30922,
30936,
30937,
31034,
31118,
31331,
31634,
31645,
31646,
31706,
31707,
32143,
32330,
32529,
32714,
32773,
32835,
32874,
32908,
32953,
32997,
33033,
33064,
33085,
33112,
33142,
33167,
33221,
33232,
33241,
33267,
33271,
33301,
33344,
33392,
33425,
33445,
33465,
33493,
33628,
33647,
33653,
33657,
33687,
33720,
33740,
33760,
33788,
33924,
33943,
33949,
33953,
33978,
34011,
34031,
34051,
34079,
34221,
34240,
34246,
34250,
34268,
34319,
34373,
34398,
34434,
34462,
34464,
34465,
34613,
34614,
34615,
34666,
34688,
34721,
34722,
34921,
34922,
34923,
34941,
34978,
35020,
35067,
35101,
35136,
35220,
35297,
35301,
35343,
35387,
35449,
35477,
35479,
35480,
35511,
35543,
35579,
35622,
35663,
35696,
35746,
35805,
35807,
35808,
35827,
35850,
35891,
35942,
36012,
36039,
36082,
36125,
36176,
36190,
36192,
36193,
36208,
36256,
36336,
36411,
36487,
36563,
36645,
36728,
36806,
36810,
36868,
36869,
36884,
36934,
37016,
37095,
37172,
37252,
37256,
37287,
37326,
37327,
37383,
37411,
37465,
37521,
37577,
37602,
37664,
37726,
37727,
37749,
37750,
37895,
37896,
37910,
37911,
38027,
38200,
38396,
38484,
38652,
38846,
39118,
39331,
39437,
39525,
39765,
39857,
40222,
40384,
40538,
40687,
40698,
40699,
40758,
40759,
40814,
40955,
41012,
41081,
41122,
41164,
41211,
41260,
41308,
41352,
41393,
41429,
41464,
41499,
41547,
41598,
41668,
41729,
41791,
41906,
41935,
42002,
42023,
42082,
42146,
42204,
42256,
42304,
42377,
42387,
42430,
42481,
42536,
42624,
42628,
42653,
42674,
42726,
42778,
42823,
42868,
42919,
42923,
42968,
42989,
43009,
43036,
43057,
43075,
43099,
43126,
43150,
43214,
43268,
43327,
43390,
43402,
43433,
43504,
43565,
43636,
43706,
43720,
43743,
43794,
43810,
43874,
43928,
43983,
44046,
44073,
44101,
44111,
44119,
44125,
44165,
44169,
44170,
44192,
44213,
44222,
44259,
44299,
44343,
44384,
44418,
44461,
44545,
44622,
44626,
44667,
44707,
44765,
44793,
44797,
44808,
44847,
44891,
44939,
44983,
45028,
45062,
45078,
45107,
45149,
45233,
45262,
45339,
45343,
45384,
45424,
45482,
45510,
45512,
45515,
45528,
45569,
45613,
45662,
45696,
45734,
45818,
45895,
45899,
45940,
45980,
46038,
46066,
46068,
46069,
46084,
46129,
46177,
46230,
46264,
46294,
46317,
46401,
46478,
46482,
46524,
46564,
46622,
46650,
46652,
46653,
46664,
46705,
46749,
46798,
46832,
46862,
46885,
46973,
47002,
47079,
47083,
47125,
47169,
47231,
47259,
47261,
47262,
47274,
47316,
47361,
47411,
47445,
47475,
47498,
47586,
47615,
47692,
47696,
47738,
47782,
47844,
47872,
47874,
47875,
47888,
47931,
47977,
48028,
48062,
48092,
48116,
48200,
48228,
48305,
48309,
48351,
48395,
48457,
48485,
48489,
48490,
48500,
48538,
48584,
48635,
48671,
48706,
48792,
48822,
48901,
48907,
48951,
48993,
49053,
49083,
49087,
49090,
49109,
49136,
49180,
49224,
49273,
49306,
49359,
49420,
49441,
49445,
49448,
49477,
49525,
49581,
49629,
49679,
49731,
49773,
49813,
49857,
49860,
49895,
49927,
49961,
50022,
50084,
50162,
50193,
50220,
50262,
50302,
50344,
50366,
50413,
50458,
50505,
50536,
50581,
50674,
50720,
50724,
50725,
50742,
50777,
50815,
50892,
50975,
51035,
51078,
51141,
51208,
51255,
51302,
51369,
51407,
51448,
51491,
51493,
51494,
51560,
51561,
51562,
51581,
51608,
51667,
51668,
51723,
51778,
51835,
51872,
51905,
51991,
52066,
52139,
52225,
52318,
52388,
52392,
52425,
52466,
52502,
52556,
52612,
52666,
52722,
52783,
52841,
52903,
52964,
53029,
53090,
53155,
53220,
53281,
53338,
53394,
53439,
53494,
53495,
53499,
53530,
53568,
53569,
53573,
53604,
53643,
53644,
53648,
53679,
53717,
53718,
53743,
53778,
53786,
53807,
53870,
53933,
53996,
53997,
54010,
54011,
54113,
54114,
54135,
54136,
54224,
54225,
54239,
54240,
54289,
54432,
54513,
54602,
54668,
54804,
54815,
54816,
54920,
54921,
54954,
54984,
55020,
55064,
55106,
55140,
55177,
55207,
55229,
55250,
55281,
55323,
55359,
55399,
55420,
55424,
55457,
55500,
55544,
55564,
55593,
55624,
55664,
55693,
55714,
55718,
55754,
55785,
55825,
55846,
55850,
55851,
55868,
55908,
55931,
55954,
55994,
56015,
56019,
56032,
56068,
56091,
56114,
56158,
56187,
56208,
56212,
56213,
56227,
56264,
56287,
56310,
56354,
56383,
56404,
56408,
56409,
56424,
56462,
56485,
56509,
56549,
56577,
56598,
56601,
56611,
56644,
56672,
56714,
56744,
56767,
56771,
56786,
56836,
56894,
56944,
56996,
57050,
57094,
57136,
57182,
57246,
57284,
57315,
57365,
57379,
57381,
57382,
57409,
57410,
57424,
57425,
57496,
57551,
57730,
57741,
57742,
57801,
57802,
57871,
57943,
58034,
58047,
58086,
58120,
58167,
58211,
58255,
58300,
58328,
58376,
58419,
58446,
58463,
58494,
58511,
58535,
58567,
58601,
58663,
58694,
58730,
58787,
58865,
58871,
58901,
58929,
58967,
58980,
59019,
59046,
59052,
59057,
59097,
59135,
59168,
59193,
59243,
59341,
59419,
59538,
59637,
59645,
59682,
59732,
59837,
59845,
59886,
59936,
60049,
60057,
60082,
60132,
60238,
60246,
60297,
60315,
60321,
60366,
60396,
60406,
60437,
60441,
60471,
60502,
60547,
60611,
60701,
60705,
60727,
60767,
60821,
60854,
60885,
60929,
60975,
60995,
61040,
61089,
61119,
61234,
61342,
61452,
61564,
61570,
61602,
61632,
61750,
61861,
61974,
62087,
62093,
62120,
62150,
62279,
62390,
62509,
62515,
62532,
62536,
62567,
62605,
62631,
62668,
62700,
62718,
62741,
62764,
62808,
62814,
62818,
62855,
62930,
63021,
63077,
63128,
63182,
63235,
63284,
63314,
63361,
63405,
63415,
63465,
63513,
63568,
63601,
63649,
63696,
63741,
63771,
63775,
63777,
63778,
63819,
63820,
63821,
63848,
63888,
63932,
63947,
63948,
63974,
63975,
64109,
64110,
64150,
64192,
64231,
64279,
64326,
64375,
64423,
64467,
64508,
64544,
64579,
64614,
64662,
64713,
64783,
64844,
64906,
64942,
64999,
65059,
65113,
65171,
65229,
65278,
65323,
65363,
65401,
65439,
65485,
65545,
65617,
65673,
65729,
65744,
65791,
65837,
65890,
65946,
65998,
66059,
66113,
66143,
66176,
66228,
66230,
66231,
66377,
66378,
66379,
66401,
66533,
66697,
66698,
66725,
66784,
66785,
66836,
66890,
66941,
66995,
67049,
67082,
67112,
67170,
67226,
67297,
67375,
67460,
67525,
67597,
67663,
67667,
67700,
67741,
67777,
67831,
67887,
67945,
68001,
68058,
68115,
68172,
68229,
68286,
68344,
68402,
68460,
68519,
68578,
68638,
68698,
68759,
68819,
68880,
68941,
69002,
69063,
69124,
69185,
69246,
69307,
69368,
69433,
69494,
69551,
69607,
69648
],
"line_end_idx": [
35,
36,
266,
267,
312,
313,
346,
347,
430,
431,
542,
543,
544,
768,
769,
796,
797,
798,
844,
845,
872,
873,
1609,
1610,
2180,
2181,
2204,
2205,
2412,
2413,
2463,
2464,
2508,
2545,
2574,
2575,
2576,
2604,
2629,
2655,
2656,
2690,
2711,
2734,
2763,
2783,
2807,
2829,
2852,
2878,
2901,
2921,
2922,
2948,
2949,
3039,
3040,
3073,
3074,
3162,
3163,
3177,
3178,
3276,
3375,
3457,
3663,
3787,
3910,
4074,
4143,
4154,
4155,
4336,
4337,
4338,
4544,
4545,
4546,
4591,
4630,
4674,
4718,
4762,
4812,
4865,
4915,
4930,
4951,
4962,
4982,
5000,
5024,
5056,
5093,
5128,
5132,
5134,
5135,
5167,
5168,
5233,
5234,
5248,
5249,
5320,
5416,
5566,
5771,
6043,
6218,
6229,
6230,
6289,
6290,
6417,
6524,
6722,
6865,
6866,
6978,
6979,
6980,
7023,
7068,
7118,
7165,
7209,
7280,
7316,
7344,
7380,
7413,
7453,
7500,
7553,
7604,
7607,
7620,
7643,
7668,
7699,
7721,
7747,
7773,
7776,
7795,
7834,
7867,
7914,
7933,
7978,
8023,
8103,
8107,
8143,
8188,
8226,
8236,
8270,
8319,
8323,
8326,
8339,
8380,
8405,
8506,
8588,
8600,
8676,
8682,
8723,
8751,
8781,
8785,
8826,
8851,
8952,
9034,
9046,
9122,
9128,
9169,
9197,
9227,
9231,
9274,
9321,
9401,
9450,
9496,
9532,
9570,
9598,
9628,
9632,
9667,
9743,
9762,
9790,
9819,
9823,
9861,
9884,
9957,
9968,
10054,
10060,
10098,
10126,
10156,
10160,
10203,
10247,
10285,
10319,
10362,
10413,
10472,
10518,
10550,
10577,
10605,
10635,
10639,
10642,
10659,
10706,
10753,
10796,
10841,
10881,
10923,
10942,
10984,
11026,
11061,
11097,
11134,
11178,
11203,
11263,
11272,
11293,
11297,
11317,
11337,
11378,
11412,
11460,
11463,
11497,
11539,
11575,
11610,
11653,
11656,
11713,
11743,
11804,
11808,
11839,
11869,
11873,
11876,
11893,
11910,
11953,
11976,
11993,
12031,
12060,
12073,
12106,
12112,
12156,
12173,
12184,
12225,
12231,
12258,
12322,
12366,
12401,
12441,
12473,
12540,
12591,
12622,
12673,
12677,
12696,
12732,
12766,
12796,
12864,
12932,
12966,
13001,
13011,
13047,
13081,
13111,
13179,
13248,
13252,
13254,
13255,
13604,
13605,
13606,
13627,
13640,
13700,
13743,
13780,
13831,
13905,
13973,
14035,
14039,
14072,
14113,
14141,
14188,
14198,
14213,
14221,
14232,
14244,
14245,
14270,
14271,
14477,
14478,
14509,
14510,
14544,
14545,
14711,
14712,
14726,
14727,
14928,
15126,
15461,
15592,
15722,
15816,
15992,
16172,
16290,
16384,
16610,
16793,
16958,
17114,
17264,
17402,
17413,
17414,
17493,
17494,
17541,
17585,
17628,
17673,
17717,
17763,
17812,
17862,
17907,
17955,
17998,
18042,
18084,
18127,
18172,
18222,
18232,
18262,
18287,
18306,
18331,
18356,
18383,
18414,
18449,
18472,
18501,
18528,
18557,
18582,
18609,
18636,
18664,
18670,
18674,
18676,
18677,
18708,
18709,
18860,
18861,
18875,
18876,
19021,
19148,
19159,
19160,
19219,
19220,
19275,
19324,
19417,
19508,
19560,
19595,
19658,
19685,
19708,
19731,
19784,
19861,
19957,
19978,
19997,
20036,
20081,
20126,
20183,
20233,
20279,
20306,
20326,
20344,
20388,
20398,
20439,
20466,
20486,
20504,
20548,
20552,
20583,
20629,
20693,
20730,
20771,
20807,
20854,
20890,
20894,
20932,
20978,
21000,
21010,
21056,
21077,
21111,
21199,
21283,
21359,
21438,
21518,
21563,
21599,
21639,
21678,
21715,
21756,
21798,
21834,
21838,
21847,
21906,
21946,
21970,
22018,
22048,
22072,
22094,
22141,
22150,
22158,
22194,
22214,
22236,
22265,
22273,
22290,
22333,
22365,
22375,
22383,
22426,
22476,
22528,
22548,
22571,
22585,
22599,
22607,
22635,
22657,
22677,
22722,
22730,
22747,
22782,
22831,
22871,
22913,
22921,
22962,
23001,
23007,
23011,
23019,
23059,
23083,
23129,
23159,
23183,
23205,
23252,
23261,
23269,
23308,
23328,
23350,
23371,
23379,
23396,
23436,
23459,
23467,
23510,
23560,
23612,
23632,
23655,
23663,
23675,
23689,
23697,
23726,
23748,
23768,
23813,
23821,
23838,
23873,
23922,
23962,
24004,
24012,
24053,
24092,
24098,
24102,
24118,
24148,
24179,
24211,
24231,
24275,
24295,
24329,
24340,
24384,
24420,
24452,
24459,
24463,
24496,
24564,
24568,
24597,
24628,
24650,
24678,
24715,
24749,
24810,
24876,
24954,
24991,
25019,
25051,
25064,
25068,
25092,
25107,
25131,
25157,
25183,
25212,
25247,
25284,
25329,
25334,
25336,
25337,
25517,
25518,
25519,
25575,
25624,
25689,
25719,
25766,
25855,
25864,
25865,
25908,
25974,
26032,
26100,
26164,
26168,
26215,
26216,
26242,
26243,
26277,
26278,
26347,
26348,
26362,
26363,
26416,
26469,
26517,
26604,
26697,
26784,
26795,
26796,
26875,
26876,
26922,
26967,
27010,
27058,
27108,
27153,
27186,
27219,
27248,
27287,
27330,
27362,
27364,
27365,
27396,
27397,
27411,
27412,
27557,
27689,
27700,
27701,
27760,
27761,
27816,
27861,
27961,
28013,
28049,
28110,
28129,
28169,
28209,
28248,
28298,
28308,
28345,
28349,
28369,
28396,
28424,
28450,
28477,
28510,
28587,
28591,
28618,
28641,
28666,
28700,
28750,
28815,
28893,
28947,
28975,
29003,
29016,
29020,
29039,
29054,
29078,
29104,
29125,
29154,
29183,
29229,
29233,
29235,
29236,
29271,
29272,
29273,
29318,
29385,
29451,
29517,
29586,
29590,
29621,
29657,
29658,
29704,
29705,
29961,
29962,
30125,
30126,
30203,
30526,
30527,
30553,
30554,
30921,
30922,
30936,
30937,
31034,
31118,
31331,
31634,
31645,
31646,
31706,
31707,
32143,
32330,
32529,
32714,
32773,
32835,
32874,
32908,
32953,
32997,
33033,
33064,
33085,
33112,
33142,
33167,
33221,
33232,
33241,
33267,
33271,
33301,
33344,
33392,
33425,
33445,
33465,
33493,
33628,
33647,
33653,
33657,
33687,
33720,
33740,
33760,
33788,
33924,
33943,
33949,
33953,
33978,
34011,
34031,
34051,
34079,
34221,
34240,
34246,
34250,
34268,
34319,
34373,
34398,
34434,
34462,
34464,
34465,
34613,
34614,
34615,
34666,
34688,
34721,
34722,
34921,
34922,
34923,
34941,
34978,
35020,
35067,
35101,
35136,
35220,
35297,
35301,
35343,
35387,
35449,
35477,
35479,
35480,
35511,
35543,
35579,
35622,
35663,
35696,
35746,
35805,
35807,
35808,
35827,
35850,
35891,
35942,
36012,
36039,
36082,
36125,
36176,
36190,
36192,
36193,
36208,
36256,
36336,
36411,
36487,
36563,
36645,
36728,
36806,
36810,
36868,
36869,
36884,
36934,
37016,
37095,
37172,
37252,
37256,
37287,
37326,
37327,
37383,
37411,
37465,
37521,
37577,
37602,
37664,
37726,
37727,
37749,
37750,
37895,
37896,
37910,
37911,
38027,
38200,
38396,
38484,
38652,
38846,
39118,
39331,
39437,
39525,
39765,
39857,
40222,
40384,
40538,
40687,
40698,
40699,
40758,
40759,
40814,
40955,
41012,
41081,
41122,
41164,
41211,
41260,
41308,
41352,
41393,
41429,
41464,
41499,
41547,
41598,
41668,
41729,
41791,
41906,
41935,
42002,
42023,
42082,
42146,
42204,
42256,
42304,
42377,
42387,
42430,
42481,
42536,
42624,
42628,
42653,
42674,
42726,
42778,
42823,
42868,
42919,
42923,
42968,
42989,
43009,
43036,
43057,
43075,
43099,
43126,
43150,
43214,
43268,
43327,
43390,
43402,
43433,
43504,
43565,
43636,
43706,
43720,
43743,
43794,
43810,
43874,
43928,
43983,
44046,
44073,
44101,
44111,
44119,
44125,
44165,
44169,
44170,
44192,
44213,
44222,
44259,
44299,
44343,
44384,
44418,
44461,
44545,
44622,
44626,
44667,
44707,
44765,
44793,
44797,
44808,
44847,
44891,
44939,
44983,
45028,
45062,
45078,
45107,
45149,
45233,
45262,
45339,
45343,
45384,
45424,
45482,
45510,
45512,
45515,
45528,
45569,
45613,
45662,
45696,
45734,
45818,
45895,
45899,
45940,
45980,
46038,
46066,
46068,
46069,
46084,
46129,
46177,
46230,
46264,
46294,
46317,
46401,
46478,
46482,
46524,
46564,
46622,
46650,
46652,
46653,
46664,
46705,
46749,
46798,
46832,
46862,
46885,
46973,
47002,
47079,
47083,
47125,
47169,
47231,
47259,
47261,
47262,
47274,
47316,
47361,
47411,
47445,
47475,
47498,
47586,
47615,
47692,
47696,
47738,
47782,
47844,
47872,
47874,
47875,
47888,
47931,
47977,
48028,
48062,
48092,
48116,
48200,
48228,
48305,
48309,
48351,
48395,
48457,
48485,
48489,
48490,
48500,
48538,
48584,
48635,
48671,
48706,
48792,
48822,
48901,
48907,
48951,
48993,
49053,
49083,
49087,
49090,
49109,
49136,
49180,
49224,
49273,
49306,
49359,
49420,
49441,
49445,
49448,
49477,
49525,
49581,
49629,
49679,
49731,
49773,
49813,
49857,
49860,
49895,
49927,
49961,
50022,
50084,
50162,
50193,
50220,
50262,
50302,
50344,
50366,
50413,
50458,
50505,
50536,
50581,
50674,
50720,
50724,
50725,
50742,
50777,
50815,
50892,
50975,
51035,
51078,
51141,
51208,
51255,
51302,
51369,
51407,
51448,
51491,
51493,
51494,
51560,
51561,
51562,
51581,
51608,
51667,
51668,
51723,
51778,
51835,
51872,
51905,
51991,
52066,
52139,
52225,
52318,
52388,
52392,
52425,
52466,
52502,
52556,
52612,
52666,
52722,
52783,
52841,
52903,
52964,
53029,
53090,
53155,
53220,
53281,
53338,
53394,
53439,
53494,
53495,
53499,
53530,
53568,
53569,
53573,
53604,
53643,
53644,
53648,
53679,
53717,
53718,
53743,
53778,
53786,
53807,
53870,
53933,
53996,
53997,
54010,
54011,
54113,
54114,
54135,
54136,
54224,
54225,
54239,
54240,
54289,
54432,
54513,
54602,
54668,
54804,
54815,
54816,
54920,
54921,
54954,
54984,
55020,
55064,
55106,
55140,
55177,
55207,
55229,
55250,
55281,
55323,
55359,
55399,
55420,
55424,
55457,
55500,
55544,
55564,
55593,
55624,
55664,
55693,
55714,
55718,
55754,
55785,
55825,
55846,
55850,
55851,
55868,
55908,
55931,
55954,
55994,
56015,
56019,
56032,
56068,
56091,
56114,
56158,
56187,
56208,
56212,
56213,
56227,
56264,
56287,
56310,
56354,
56383,
56404,
56408,
56409,
56424,
56462,
56485,
56509,
56549,
56577,
56598,
56601,
56611,
56644,
56672,
56714,
56744,
56767,
56771,
56786,
56836,
56894,
56944,
56996,
57050,
57094,
57136,
57182,
57246,
57284,
57315,
57365,
57379,
57381,
57382,
57409,
57410,
57424,
57425,
57496,
57551,
57730,
57741,
57742,
57801,
57802,
57871,
57943,
58034,
58047,
58086,
58120,
58167,
58211,
58255,
58300,
58328,
58376,
58419,
58446,
58463,
58494,
58511,
58535,
58567,
58601,
58663,
58694,
58730,
58787,
58865,
58871,
58901,
58929,
58967,
58980,
59019,
59046,
59052,
59057,
59097,
59135,
59168,
59193,
59243,
59341,
59419,
59538,
59637,
59645,
59682,
59732,
59837,
59845,
59886,
59936,
60049,
60057,
60082,
60132,
60238,
60246,
60297,
60315,
60321,
60366,
60396,
60406,
60437,
60441,
60471,
60502,
60547,
60611,
60701,
60705,
60727,
60767,
60821,
60854,
60885,
60929,
60975,
60995,
61040,
61089,
61119,
61234,
61342,
61452,
61564,
61570,
61602,
61632,
61750,
61861,
61974,
62087,
62093,
62120,
62150,
62279,
62390,
62509,
62515,
62532,
62536,
62567,
62605,
62631,
62668,
62700,
62718,
62741,
62764,
62808,
62814,
62818,
62855,
62930,
63021,
63077,
63128,
63182,
63235,
63284,
63314,
63361,
63405,
63415,
63465,
63513,
63568,
63601,
63649,
63696,
63741,
63771,
63775,
63777,
63778,
63819,
63820,
63821,
63848,
63888,
63932,
63947,
63948,
63974,
63975,
64109,
64110,
64150,
64192,
64231,
64279,
64326,
64375,
64423,
64467,
64508,
64544,
64579,
64614,
64662,
64713,
64783,
64844,
64906,
64942,
64999,
65059,
65113,
65171,
65229,
65278,
65323,
65363,
65401,
65439,
65485,
65545,
65617,
65673,
65729,
65744,
65791,
65837,
65890,
65946,
65998,
66059,
66113,
66143,
66176,
66228,
66230,
66231,
66377,
66378,
66379,
66401,
66533,
66697,
66698,
66725,
66784,
66785,
66836,
66890,
66941,
66995,
67049,
67082,
67112,
67170,
67226,
67297,
67375,
67460,
67525,
67597,
67663,
67667,
67700,
67741,
67777,
67831,
67887,
67945,
68001,
68058,
68115,
68172,
68229,
68286,
68344,
68402,
68460,
68519,
68578,
68638,
68698,
68759,
68819,
68880,
68941,
69002,
69063,
69124,
69185,
69246,
69307,
69368,
69433,
69494,
69551,
69607,
69648,
69701
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 69701,
"ccnet_original_nlines": 1612,
"rps_doc_curly_bracket": 0.007833460345864296,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.13508108258247375,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.014070950448513031,
"rps_doc_frac_lines_end_with_ellipsis": 0.006199629977345467,
"rps_doc_frac_no_alph_words": 0.5064060091972351,
"rps_doc_frac_unique_words": 0.24761904776096344,
"rps_doc_mean_word_length": 6.491428375244141,
"rps_doc_num_sentences": 881,
"rps_doc_symbol_to_word_ratio": 0.018810629844665527,
"rps_doc_unigram_entropy": 6.320792198181152,
"rps_doc_word_count": 5775,
"rps_doc_frac_chars_dupe_10grams": 0.1652795672416687,
"rps_doc_frac_chars_dupe_5grams": 0.29902902245521545,
"rps_doc_frac_chars_dupe_6grams": 0.2534944415092468,
"rps_doc_frac_chars_dupe_7grams": 0.21665599942207336,
"rps_doc_frac_chars_dupe_8grams": 0.1876867264509201,
"rps_doc_frac_chars_dupe_9grams": 0.1766698658466339,
"rps_doc_frac_chars_top_2gram": 0.0074690598994493484,
"rps_doc_frac_chars_top_3gram": 0.007042250130325556,
"rps_doc_frac_chars_top_4gram": 0.00432138005271554,
"rps_doc_books_importance": -5658.173828125,
"rps_doc_books_importance_length_correction": -5658.173828125,
"rps_doc_openwebtext_importance": -3106.069091796875,
"rps_doc_openwebtext_importance_length_correction": -3106.069091796875,
"rps_doc_wikipedia_importance": -1700.031005859375,
"rps_doc_wikipedia_importance_length_correction": -1700.031005859375
},
"fasttext": {
"dclm": 0.9223718643188477,
"english": 0.4564892649650574,
"fineweb_edu_approx": 3.5089120864868164,
"eai_general_math": 0.9995771050453186,
"eai_open_web_math": 0.3965854048728943,
"eai_web_code": 0.9999779462814331
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "519.5",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Probabilities; or, Mathematical statistics"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "2",
"label": "Text Extraction Errors"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "4",
"label": "Advanced Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "5",
"label": "Exceptionally Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,121,912,236,762,577,000 |
1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!
Homework Help: Keyword search in a hashmap(using retainsAll) in java
1. Dec 2, 2016 #1
1. The problem statement, all variables and given/known data
Essentially, I am expected to have a method that can do a keyword search through my hashmap and return respective results. My hashmap is as follows:
HashMap<String, Person> phonebook
The string as a key is generally the name of the entry. A person object has 3 fields(Name, address, and phone number). In this case the person's name is also equal to the key. Essentially, when the user inputs a keyword it is expected to return results(in order) of all names and addresses that contain the keyword in alphabetical order.
(Hopefully I explained this properly)
2. Relevant equations
3. The attempt at a solution
So far I have this:
Code (Java):
public void giveInfo(String keyword) {
ArrayList<Person> searcher = new ArrayList<Person>();
for (Map.Entry<String, Person> entry : phoneBook.entrySet()) {
if (entry.getKey().contains(keyword) || entry.getValue().getAddress().contains(keyword)) {
entry.getValue().retainAll(searcher);
}
Collections.sort(searcher);
}
for (Person results : searcher) {
System.out.println(results);
}
}
Things I know before hand:
I believe I need to implement the comparator and override my compareTo method so that it can effectively sort the arraylist.
I'm not sure exactly why retainAll isn't working but I believe I need to override hashcode and equals maybe??? I think if the condition is true in the foreach loop then it should add the object from entry in to the arraylist but i'm not sure.
Thanks.
If I need to show all of my source code let me know
2. jcsd
3. Dec 7, 2016 #2
Thanks for the thread! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post? The more details the better.
4. Dec 7, 2016 #3
If it matters all I changed was instead of having the arraylist of person retainall the elements from entry.getValue() (I'm assuming this shouldn't work because it's just an object, not a list structure) i had simply added them into the arraylist if the condition was fulfilled.
Then I implemented comparator in the person object and everything compiled fine.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook
Have something to add?
Draft saved Draft deleted
|
{
"url": "https://www.physicsforums.com/threads/keyword-search-in-a-hashmap-using-retainsall-in-java.895617/",
"source_domain": "www.physicsforums.com",
"snapshot_id": "crawl=CC-MAIN-2018-30",
"warc_metadata": {
"Content-Length": "60594",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PDEH4T3BJRHIAPZSODALXNGXWXITU25X",
"WARC-Concurrent-To": "<urn:uuid:fb2515d6-040f-413b-9a61-de3b7ffcba88>",
"WARC-Date": "2018-07-22T14:44:15Z",
"WARC-IP-Address": "74.86.200.109",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:IXXSII54TA5QZWOFEXJQEARGFVXTTI3U",
"WARC-Record-ID": "<urn:uuid:3f621c47-38dd-4d36-81d8-3e04d0913190>",
"WARC-Target-URI": "https://www.physicsforums.com/threads/keyword-search-in-a-hashmap-using-retainsall-in-java.895617/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:37f9b2e3-c24f-4724-b41a-f505b555e08e>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-79-230-204.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2018-30\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for July 2018\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
88,
107,
122,
149,
257,
258,
327,
328,
348,
413,
566,
604,
946,
947,
989,
990,
1016,
1017,
1018,
1051,
1075,
1092,
1093,
1136,
1202,
1212,
1287,
1394,
1452,
1470,
1514,
1528,
1574,
1619,
1633,
1643,
1674,
1803,
1804,
2051,
2052,
2064,
2065,
2121,
2127,
2137,
2157,
2405,
2411,
2431,
2714,
2715,
2800,
2806,
2888,
2889,
2912
],
"line_end_idx": [
88,
107,
122,
149,
257,
258,
327,
328,
348,
413,
566,
604,
946,
947,
989,
990,
1016,
1017,
1018,
1051,
1075,
1092,
1093,
1136,
1202,
1212,
1287,
1394,
1452,
1470,
1514,
1528,
1574,
1619,
1633,
1643,
1674,
1803,
1804,
2051,
2052,
2064,
2065,
2121,
2127,
2137,
2157,
2405,
2411,
2431,
2714,
2715,
2800,
2806,
2888,
2889,
2912,
2937
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 2937,
"ccnet_original_nlines": 57,
"rps_doc_curly_bracket": 0.002723870100453496,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3362369239330292,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.02613239921629429,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.24564459919929504,
"rps_doc_frac_unique_words": 0.5552884340286255,
"rps_doc_mean_word_length": 5.012019157409668,
"rps_doc_num_sentences": 43,
"rps_doc_symbol_to_word_ratio": 0.005226479843258858,
"rps_doc_unigram_entropy": 5.073225498199463,
"rps_doc_word_count": 416,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.014388489536941051,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.023021580651402473,
"rps_doc_frac_chars_top_3gram": 0.010071939788758755,
"rps_doc_frac_chars_top_4gram": 0.012470019981265068,
"rps_doc_books_importance": -238.84837341308594,
"rps_doc_books_importance_length_correction": -238.84837341308594,
"rps_doc_openwebtext_importance": -141.7711639404297,
"rps_doc_openwebtext_importance_length_correction": -141.7711639404297,
"rps_doc_wikipedia_importance": -118.49595642089844,
"rps_doc_wikipedia_importance_length_correction": -118.49595642089844
},
"fasttext": {
"dclm": 0.29435110092163086,
"english": 0.8461596965789795,
"fineweb_edu_approx": 1.2620277404785156,
"eai_general_math": 0.0020750199910253286,
"eai_open_web_math": 0.29158395528793335,
"eai_web_code": 0.9981638789176941
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "2",
"label": "Partially Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,634,331,612,556,470,000 |
alert - warning
This page has not been translated into Português, Brasil. Visit the Português, Brasil page for resources in that language.
OpenFEMA API Documentation
As part of the OpenFEMA initiative, FEMA is providing read-only API based access to datasets (Entities). The data is exposed using a RESTful interface that uses query string parameters to manage the query. Use of the service is free and does not require a subscription or API key.
This document provides information on how to use the API including command examples. The examples shown are HTTP requests. Other methods such as CURL or accessing with a programming language can also be used. See the Developer Resources page for additional information.
A full list of Entities/endpoints supported by the API can be found at Data Sets.
Major and minor version features (including the addition or deprecation of datasets) can be found on the Changelog page.
Basics
The base path for the API endpoints is https://www.fema.gov/api/open.
To use the API, you will need to build a query string path in the following format:
[base path]/[version]/[entity]
• version: To support future enhancements we are using a versioning system for the APIs. To use the APIs you must indicate which version you need. The API version format is v1, v2, v3, etc.
• entity: This corresponds to the name of the entity set you are requesting. The entity names can be found in the list of released datasets.
Example: https://www.fema.gov/api/open/v2/DisasterDeclarationsSummaries
alert - info
Query strings including the data set/endpoint name are case sensitive.
Query strings including the data set/endpoint name are case sensitive.
A successful response will include a both a metadata object (described below) and an array of entity objects (records). By default, only 1,000 records are returned. See the URI commands below for information on how to page through all found records. Working examples can be found on the Developer Resources page.
URI Quick Reference
CommandDescriptionDefault
$filenameTo specify the download filename.
$filterTo filter or limit the results returned.All records up to $top returned
$formatTo specify the format of the returned data.JSON
$inlinecountOption to specify if a total entity count should be returned with the query.none (the count is not returned)
$metadataControls the presence of the metadata object in data set returns.on (metadata is returned)
$orderbySort the returned data.
$selectTo specify the fields to return.All fields returned
$skipNumber of records to skip from the dataset.0
$topLimit the number of records returned.1,000 (maximum is 10,000)
URI Commands Reference
A Uniform Resource Identifier (URI) is a string of characters identifying an abstract or physical resource on the web. This can be a URL to a website; it can also be identify a specific resource as well as a location. The following URI commands can be used to alter your request of OpenFEMA endpoint data – filtering the result, specifying a return type, or including additional metadata.
Search
Performs a search of the entity using specified query string parameters.
Query String Parameters
$filename
Allows for the specification of a download filename. The data downloaded will be limited to fields specified using $select (all fields if none specified), will contain records limited by $filter, and will be sorted according to the $orderby parameter. Note, all of the $filter, $orderby, and $select parameters will work with $filename. The filename should not be surrounded by quotation marks even if the filename contains spaces. If no $format parameter is specified, JSON will be the result.
Example
$filter
Used to "filter" the results returned. The API provides a number of operations that can be used to build your request. The API provides as subset of the available options in the OData specification. Please note that dates should be represented in an ISO-8601 format.
alert - info
The query parser is very strict. Ensure your spacing, quoting, and capitalization are correct.
Spaces are required between logical operators.
Strings must be single quoted.
URL encoding (e.g., %20, %24, %27, etc.) may be used.
Any string containing a quote (e.g., bob's burgers) must have the quote doubled to have an effect (e.g., bob''s burgers).
Logical Operators:
OperatorDescriptionExample
eqEqual/DisasterDeclarationsSummaries?$filter=state eq 'VA'
neNot equal/DisasterDeclarationsSummaries?$filter=state ne 'VA'
gtGreater than/DisasterDeclarationsSummaries?$filter=declarationDate gt '1969-04-18T04:00:00.000z'
geGreater than or equal/DisasterDeclarationsSummaries?$filter=disasterNumber ge 4000
ltLess than/DisasterDeclarationsSummaries?$filter=declarationDate lt '2013-01-01'
leLess than or equal/DisasterDeclarationsSummaries?$filter=disasterNumber le 100
andLogical and/DisasterDeclarationsSummaries?$filter=declarationDate ge '2010-01-01T04:00:00.000z' and state eq 'VA'
orLogical or/DisasterDeclarationsSummaries?$filter=state eq 'VA' or state eq 'NY'
notLogical negation/DisasterDeclarationsSummaries?$filter=not substringof(declarationTitle,'OO')
Grouping Operators:
This represents logical operator grouping, not data aggregation.
OperatorDescriptionExample
( )Precedence grouping/DisasterDeclarationsSummaries?$filter=(state eq 'VA' and designatedArea eq 'Alleghany (County)') or disasterNumber eq 1570
String Functions:
To enable filtering on partial strings.
FunctionExample
bool substringof(string searchString, string searchInString)/DisasterDeclarationsSummaries?$filter=substringof('OO',declarationTitle)
bool endswith(string string, string suffixString)/DisasterDeclarationsSummaries?$filter=endswith(declarationTitle ,'ING')
bool startswith(string string, string prefixString)/DisasterDeclarationsSummaries?$filter=startswith(declarationTitle ,'FLO')
Special Functions:
To permit searching within objects, including geospatial operations.
unctionExample
containsOnly applies to searchable objects and arrays. Use the string functions for identifying fields that contain a string being sought.
Object example:
/IpawsArchivedAlerts?$filter=contains(info/eventCode/value,%20%27ADR%27)&$top=1
Array examples (note the appropriate brackets and quotes):
/IpawsArchivedAlerts?$filter=contains(code, ["IPAWSv1.0"])&$top=1
/DataSets?$filter=contains(keyword,[%22HousingAssistance%22])
geo.intersectsPermits querying against a geospatial enabled dataset. The entity/field/object to be searched is passed along with a bounding polygon or a point. The syntax for the polygon must be in the format of the examples. Note, there is no space between "geography" and the geometry type. Replace the coordinates with your own polygon coordinates in WKT (Well Known Text) format. Examples:
https://www.fema.gov/api/open/v1/IpawsArchivedAlerts?$filter=geo.intersects(searchGeometry, geography'POLYGON((-171.791110603 71.3577635769,-66.96466 71.3577635769,-66.96466 18.91619,-171.791110603 18.91619,-171.791110603 71.3577635769))')&$top=100
/FemaRegions?$filter=geo.intersects(regionGeometry,geography%27POINT(-71.054649%2042.354478)%27)
$format
Controls the format of the returned data.
Supported values include:
• json - Returns data in the JavaScript Object Notation format (default)
• jsona - Returns data as a JavaScript Object Notation array format (no top-level object)
• geojson - Returns data as a JavaScript Object Notation format encoded with geographic data structures. NOTE: This format will only work if the dataset supports geospatial data
• csv - Returns data in a Comma-Separated Value format * Metadata is not returned when using CSV format
Example
Query options that controls if a total count of all entities matching the request MUST be returned as part of the result. Note, if the $inlinecount parameter is not supplied, no count will be returned; it will appear as “0”.
alert - info
If retrieving large amounts of data or using complex $filter criteria through a "paging" technique, avoid specifying "allpages" in each call. This will result in faster queries.
Valid values are:
• allpages - Returns the count
• none - Does not return the count (default)
Example
$metadata
Controls the presence of the data set metadata object with a returned data set. Note, only applies if the format is JSON. If the format is CSV, no metadata is returned.
Supported values include:
• on or true– Returns the metadata object for data returned in a JSON format (default)
• off or false – Suppresses the metadata object for data returned in a JSON format
Example
$orderby
Allows for the sorting of data on the server. By providing a comma separated list of fields and a sort direction you can control the order that data is returned. Available sort directions are “asc” and “desc” for ascending or descending respectively. If no direction is provided, ascending is the default.
Example
$select
Used to specify which fields you would like returned in your dataset. Providing a comma separated list of case sensitive field names will return just those fields. If no value is specified, all of the fields are returned.
Example
Number of records to skip from the dataset. Used in conjunction with $top to allow you to page through the dataset. See the Developer Resources page for working examples of iterating through a result set to capture all the data matching the specified criteria. If no value is specified, $skip defaults to 0 and starts at the beginning of the results set.
Example
$top
Limits the number of records returned. Currently the default value is 1,000 records. The maximum value is 10,000 records. See the Developer Resources page for working examples of iterating through a result set to capture all the data matching the specified criteria.
Example
Get By ID
Retrieves a specific record identified by its ID field (id).
Query string format is:
/api/open/[version]/[entity]/[_id]
• version: To support future enhancements we are using a versioning system for the APIs. To use the APIs you must indicate which version you need. The API version format is v1, v2, v3, etc.
• entity: This corresponds to the name of the entity set you are requesting. The entity names can be found in the list of released datasets.
• _id - This is a _id value of a previously identified record in an entity.
Example:
Query String Parameters
$format
Controls the format of the returned data.
Supported values include
• json - Returns data in the JavaScript Object Notation format (default)
• csv - Returns data in a Comma-Separated Value format
Example
Metadata
A successful response will include a metadata object along with the array of entity objects. Most of the metadata corresponds to the URI commands and parameters specified above. The metadata object can be suppressed by using the $metadata parameter.
MetadataDescription
skipNumber of records skipped as specified by the $skip parameter. If the $skip parameter was not used, this value will be 0.
topMax number of records returned as specified by the $top parameter. If the $top parameter was not used, this value will be 1,000. The maximum that can be specified is 10,000.
countCount of all possible records found matching any provided criteria. If the $inlinecount parameter was not used, or “none” was specified, this value will be 0. If the count returned is greater than the maximum value specified by $top, you will need to implement a paging strategy to return all the records that match the criteria specified.
filterFilter values applied as specified by the $filter parameter.
formatFormat of the data as specified by the $format parameter. If none specified, the format will default to JSON.
metadataIndicates if the metadata object suppression parameter has been specified.
orderbySort order for the data as specified by the $orderby parameter.
selectFields specified for return as specified by the $select parameter.
entitynameName of the entity or endpoint for which data was queried.
versionThe API endpoint version used to return the data.
urlThe fully composed URL used to return the data.
rundateThe date and time when the API call was executed.
DeprecationInformation(optional) An object containing the following 4 metadata items. Only appears when the dataset has been deprecated.
depDate(optional) Only appears when the data set has been deprecated. Indicates that the data set has been deprecated and will be removed by this date.
depApiMessage(optional) Only appears when the data set has been deprecated. Provides additional information about the deprecation of the data set.
depNewURL(optional) Only appears when the data set has been deprecated. Provides a link to an API endpoint that will supersede this dataset (if one exists).
depWebMessage (optional) Only appears when the data set has been deprecated. Provides additional information about the deprecation of the data set as it appears on the dataset webpage.
Special Dataset Fields
As a matter of policy, the OpenFEMA API does not enrich data from source systems. However, up to four fields are added by OpenFEMA either for internal purposes or to aid users in refreshing data. While the fields are briefly described in each dataset data dictionary, confusion about these fields has necessitated a more thorough description.
Datasets internally are classified as RELOAD or UPDATE. RELOAD datasets follow a drop and reload process while UPDATE datasets add new records or update existing records that have changes. Existing records without a change are left unmodified in OpenFEMA. Reloads and updates occur according to the dataset refresh frequency/schedule. Those that are fully reloaded will not contain a hash or lastRefresh value.
id
This is not a unique identifier from the source system. It is an OpenFEMA generated unique identifier assigned to the record that does not persist between dataset refreshes. It can be used as a unique id within the immediate set of downloaded records. However, following the next data refresh, there is no guarantee that the id will remain the same for the for the same record.
Why not use source system identifiers? Some datasets are aggregated, thereby negating the use of a source system id. Some combine data from multiple sources and no one identifier can be used. Some datasets have no available unique identifier. Some source systems consider their identifiers as “sensitive” and are not made available to OpenFEMA.
If you require some kind of source system unique identifier, query the OpenFEMA DataSetFields metadata API and review the primaryKey element to identify those fields contributing to a record's uniqueness. All the fields that have this flag set to true must be used to uniquely identify the record. If none of the dataset fields has the primaryKey value set, the record has no source system identifier available within this dataset. For example, the following query against the Disaster Declarations Summaries dataset will indicate that the declarationNumber in combination with the placeCode will uniquely identify a record: https://www.fema.gov/api/open/v1/DataSetFields?$filter=openFemaDataSet%20eq%20%27DisasterDeclarationsSummaries%27%20and%20datasetVersion%20eq%202%20and%20primaryKey%20eq%20true
hash
An SHA1 hash of the field values of the record. If anything in a record changes—even capitalization, spacing, or punctuation—the SHA1 value will change. OpenFEMA uses this internally to identify changes to records to aid in updates. We have exposed this to the users because someone might find it useful. It should not be used as a record identifier.
lastRefresh
The lastRefresh value in any of the datasets indicates the last date/time the record was added or changed in the OpenFEMA data store from the FEMA source system. It is possible to use this information to query recent data rather than performing a full dataset download. Note that this value does not indicate when the source system data was updated, only when the OpenFEMA record was updated. In addition, datasets that do not contain this field are refreshed by performing a full reload on all the data; there is no way to tell when an individual record was added or updated.
For the DataSets dataset, the lastRefresh value indicates the same – the last date/time the record was added or changed. In this dataset, each record contains the metadata attributes for an individual dataset. Therefore, the lastRefresh value reflects the last date/time the record (i.e., an individual dataset’s metadata) was updated or changed.
Whether you are refreshing the entire dataset or just trying to add or update changed records since the last update, your refresh interval should not be more frequent than the dataset refresh interval. Further, it would be prudent to check the dataset update status prior to executing your own refresh. There may be situations when the OpenFEMA data store is unable to refresh from the source data. See OpenFEMA Guide to Working with Large Data Sets | Appendix B - Checking for Data Updates for a more thorough discussion of using this field to perform updates. See API Tutorial Part 5 Getting Dataset Updates (OpenFEMA GitHub | API Tutorials) for working code examples.
Whether you are refreshing the entire dataset or just trying to add/update changed records since the last update, your refresh interval should not be more frequent than the dataset refresh interval. Further, it would be prudent to check the dataset update status prior to executing your own refresh. There may be situations when the OpenFEMA data store is unable to refresh from the source data.
lastDataSetRefresh
The lastDataSetRefresh value is only found in the DataSets dataset and indicates the last date/time the individual dataset that the record represents was refreshed/reloaded in the OpenFEMA data store from the FEMA source system. Note that this value does not indicate if any records within the individual dataset have been added or changed, only that the dataset refresh/reload process completed. It is possible to use this information to query only recently refreshed datasets rather than performing frequent blind downloads.
See Also
|
{
"url": "https://www.fema.gov/pt-br/about/openfema/api",
"source_domain": "www.fema.gov",
"snapshot_id": "CC-MAIN-2023-40",
"warc_metadata": {
"Content-Length": "146221",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:XY2YOPT4IFFHMHIIVLF3E3XSRQD7KCGH",
"WARC-Concurrent-To": "<urn:uuid:27c52f70-5d99-47be-b948-ebbbe0035e38>",
"WARC-Date": "2023-09-24T11:30:44Z",
"WARC-IP-Address": "23.13.155.201",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:7JQONR5XR43EJ6NVQAEXJKTOMUJUWTUJ",
"WARC-Record-ID": "<urn:uuid:d5335557-a84c-45c3-84e2-89443d6d7e0e>",
"WARC-Target-URI": "https://www.fema.gov/pt-br/about/openfema/api",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:7e4895b0-e351-49ea-bc63-91f8aaff8324>"
},
"warc_info": "isPartOf: CC-MAIN-2023-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September/October 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-159\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
16,
17,
140,
141,
168,
169,
450,
451,
721,
722,
804,
805,
926,
927,
934,
935,
1005,
1006,
1090,
1091,
1122,
1123,
1316,
1459,
1460,
1532,
1533,
1546,
1547,
1618,
1619,
1690,
1691,
2004,
2005,
2025,
2026,
2052,
2096,
2175,
2230,
2351,
2451,
2484,
2543,
2593,
2660,
2661,
2684,
2685,
3074,
3075,
3082,
3083,
3156,
3157,
3181,
3182,
3192,
3193,
3688,
3689,
3697,
3698,
3706,
3707,
3974,
3975,
3988,
3989,
4084,
4085,
4132,
4133,
4164,
4165,
4219,
4220,
4342,
4343,
4362,
4363,
4390,
4450,
4514,
4613,
4698,
4780,
4861,
4978,
5060,
5157,
5158,
5178,
5179,
5244,
5245,
5272,
5418,
5419,
5437,
5438,
5478,
5479,
5495,
5629,
5751,
5877,
5878,
5897,
5898,
5967,
5968,
5983,
6122,
6138,
6218,
6219,
6278,
6344,
6345,
6407,
6801,
7050,
7051,
7148,
7149,
7157,
7158,
7200,
7201,
7227,
7228,
7303,
7395,
7575,
7681,
7682,
7690,
7691,
7917,
7918,
7931,
7932,
8110,
8111,
8129,
8130,
8163,
8210,
8211,
8219,
8220,
8230,
8231,
8400,
8401,
8427,
8428,
8517,
8602,
8603,
8611,
8612,
8621,
8622,
8928,
8929,
8937,
8938,
8946,
8947,
9169,
9170,
9178,
9179,
9534,
9535,
9543,
9544,
9549,
9550,
9817,
9818,
9826,
9827,
9837,
9838,
9899,
9900,
9924,
9925,
9960,
9961,
10154,
10297,
10375,
10376,
10385,
10386,
10410,
10411,
10419,
10420,
10462,
10463,
10488,
10489,
10564,
10621,
10622,
10630,
10631,
10640,
10641,
10891,
10892,
10912,
11038,
11215,
11560,
11627,
11743,
11826,
11897,
11970,
12039,
12096,
12147,
12204,
12341,
12493,
12640,
12797,
12982,
12983,
13006,
13007,
13350,
13351,
13762,
13763,
13766,
13767,
14145,
14146,
14491,
14492,
15294,
15295,
15300,
15301,
15652,
15653,
15665,
15666,
16243,
16244,
16591,
16592,
17263,
17264,
17660,
17661,
17680,
17681,
18209,
18210,
18211
],
"line_end_idx": [
16,
17,
140,
141,
168,
169,
450,
451,
721,
722,
804,
805,
926,
927,
934,
935,
1005,
1006,
1090,
1091,
1122,
1123,
1316,
1459,
1460,
1532,
1533,
1546,
1547,
1618,
1619,
1690,
1691,
2004,
2005,
2025,
2026,
2052,
2096,
2175,
2230,
2351,
2451,
2484,
2543,
2593,
2660,
2661,
2684,
2685,
3074,
3075,
3082,
3083,
3156,
3157,
3181,
3182,
3192,
3193,
3688,
3689,
3697,
3698,
3706,
3707,
3974,
3975,
3988,
3989,
4084,
4085,
4132,
4133,
4164,
4165,
4219,
4220,
4342,
4343,
4362,
4363,
4390,
4450,
4514,
4613,
4698,
4780,
4861,
4978,
5060,
5157,
5158,
5178,
5179,
5244,
5245,
5272,
5418,
5419,
5437,
5438,
5478,
5479,
5495,
5629,
5751,
5877,
5878,
5897,
5898,
5967,
5968,
5983,
6122,
6138,
6218,
6219,
6278,
6344,
6345,
6407,
6801,
7050,
7051,
7148,
7149,
7157,
7158,
7200,
7201,
7227,
7228,
7303,
7395,
7575,
7681,
7682,
7690,
7691,
7917,
7918,
7931,
7932,
8110,
8111,
8129,
8130,
8163,
8210,
8211,
8219,
8220,
8230,
8231,
8400,
8401,
8427,
8428,
8517,
8602,
8603,
8611,
8612,
8621,
8622,
8928,
8929,
8937,
8938,
8946,
8947,
9169,
9170,
9178,
9179,
9534,
9535,
9543,
9544,
9549,
9550,
9817,
9818,
9826,
9827,
9837,
9838,
9899,
9900,
9924,
9925,
9960,
9961,
10154,
10297,
10375,
10376,
10385,
10386,
10410,
10411,
10419,
10420,
10462,
10463,
10488,
10489,
10564,
10621,
10622,
10630,
10631,
10640,
10641,
10891,
10892,
10912,
11038,
11215,
11560,
11627,
11743,
11826,
11897,
11970,
12039,
12096,
12147,
12204,
12341,
12493,
12640,
12797,
12982,
12983,
13006,
13007,
13350,
13351,
13762,
13763,
13766,
13767,
14145,
14146,
14491,
14492,
15294,
15295,
15300,
15301,
15652,
15653,
15665,
15666,
16243,
16244,
16591,
16592,
17263,
17264,
17660,
17661,
17680,
17681,
18209,
18210,
18211,
18219
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 18219,
"ccnet_original_nlines": 269,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.33912035822868347,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.02083333022892475,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2074652761220932,
"rps_doc_frac_unique_words": 0.2507621943950653,
"rps_doc_mean_word_length": 5.615091323852539,
"rps_doc_num_sentences": 222,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.529516696929932,
"rps_doc_word_count": 2624,
"rps_doc_frac_chars_dupe_10grams": 0.15420116484165192,
"rps_doc_frac_chars_dupe_5grams": 0.2146056741476059,
"rps_doc_frac_chars_dupe_6grams": 0.20055654644966125,
"rps_doc_frac_chars_dupe_7grams": 0.1822315752506256,
"rps_doc_frac_chars_dupe_8grams": 0.1727297455072403,
"rps_doc_frac_chars_dupe_9grams": 0.1681145578622818,
"rps_doc_frac_chars_top_2gram": 0.00848377961665392,
"rps_doc_frac_chars_top_3gram": 0.005429619923233986,
"rps_doc_frac_chars_top_4gram": 0.006515540182590485,
"rps_doc_books_importance": -1222.3992919921875,
"rps_doc_books_importance_length_correction": -1222.3992919921875,
"rps_doc_openwebtext_importance": -849.0887451171875,
"rps_doc_openwebtext_importance_length_correction": -849.0887451171875,
"rps_doc_wikipedia_importance": -640.0469970703125,
"rps_doc_wikipedia_importance_length_correction": -640.0469970703125
},
"fasttext": {
"dclm": 0.08943092823028564,
"english": 0.7820081114768982,
"fineweb_edu_approx": 2.404726266860962,
"eai_general_math": 0.34856367111206055,
"eai_open_web_math": 0.0960959792137146,
"eai_web_code": 0.9778933525085449
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "363.32",
"labels": {
"level_1": "Social sciences",
"level_2": "Social service and Societies",
"level_3": "Political activists"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
5,811,684,974,442,098,000 |
Commits
Peter Brune committed b009755 Merge
Merged in madams/gamg-destroy (pull request #112)
fixed bug with not cleaning AGG subtype when setting to another type (classical).
Comments (0)
Files changed (3)
src/ksp/pc/impls/gamg/agg.c
PetscFunctionBegin;
ierr = PetscFree(pc_gamg->subctx);CHKERRQ(ierr);
+ ierr = PetscObjectComposeFunction((PetscObject)pc,"PCSetCoordinates_C",NULL);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
src/ksp/pc/impls/gamg/classical.c
PetscFunctionBegin;
/* no data for classical AMG */
pc_gamg->data = NULL;
- pc_gamg->data_cell_cols = 1;
- pc_gamg->data_cell_rows = 1;
+ pc_gamg->data_cell_cols = 0;
+ pc_gamg->data_cell_rows = 0;
pc_gamg->data_sz = 0;
PetscFunctionReturn(0);
}
src/ksp/pc/impls/gamg/gamg.c
Mat Cmat,Pold=*a_P_inout;
MPI_Comm comm;
PetscMPIInt rank,size,new_size,nactive=*a_nactive_proc;
- PetscInt ncrs_eq,ncrs_prim,f_bs;
+ PetscInt ncrs_eq,ncrs,f_bs;
PetscFunctionBegin;
ierr = PetscObjectGetComm((PetscObject)Amat_fine,&comm);CHKERRQ(ierr);
/* RAP */
ierr = MatPtAP(Amat_fine, Pold, MAT_INITIAL_MATRIX, 2.0, &Cmat);CHKERRQ(ierr);
- /* set 'ncrs_prim' (nodes), 'ncrs_eq' (equations)*/
- ncrs_prim = pc_gamg->data_sz/pc_gamg->data_cell_cols/pc_gamg->data_cell_rows;
- if (pc_gamg->data_sz % (pc_gamg->data_cell_cols*pc_gamg->data_cell_rows)) SETERRQ3(PETSC_COMM_SELF,PETSC_ERR_PLIB,"pc_gamg->data_sz %D not divisible by (pc_gamg->data_cell_cols %D *pc_gamg->data_cell_rows %D)",pc_gamg->data_sz,pc_gamg->data_cell_cols,pc_gamg->data_cell_rows);
+ /* set 'ncrs' (nodes), 'ncrs_eq' (equations)*/
ierr = MatGetLocalSize(Cmat, &ncrs_eq, NULL);CHKERRQ(ierr);
+ if (pc_gamg->data_cell_rows>0) {
+ ncrs = pc_gamg->data_sz/pc_gamg->data_cell_cols/pc_gamg->data_cell_rows;
+ }
+ else {
+ PetscInt bs;
+ ierr = MatGetBlockSize(Cmat, &bs);CHKERRQ(ierr);
+ ncrs = ncrs_eq/bs;
+ }
/* get number of PEs to make active 'new_size', reduce, can be any integer 1-P */
{
if (!repart && new_size==nactive) *a_Amat_crs = Cmat; /* output - no repartitioning or reduction - could bail here */
else {
- const PetscInt *idx,ndata_rows=pc_gamg->data_cell_rows,ndata_cols=pc_gamg->data_cell_cols,node_data_sz=ndata_rows*ndata_cols;
- PetscInt *counts,*newproc_idx,ii,jj,kk,strideNew,*tidx,ncrs_prim_new,ncrs_eq_new,nloc_old;
- IS is_eq_newproc,is_eq_num,is_eq_num_prim,isscat,new_eq_indices;
- VecScatter vecscat;
- PetscScalar *array;
- Vec src_crd, dest_crd;
+ PetscInt *counts,*newproc_idx,ii,jj,kk,strideNew,*tidx,ncrs_new,ncrs_eq_new,nloc_old;
+ IS is_eq_newproc,is_eq_num,is_eq_num_prim,new_eq_indices;
nloc_old = ncrs_eq/cr_bs;
if (ncrs_eq % cr_bs) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_PLIB,"ncrs_eq %D not divisible by cr_bs %D",ncrs_eq,cr_bs);
PetscInt *d_nnz, *o_nnz, M, N;
static PetscInt llev = 0;
- ierr = PetscMalloc1(ncrs_prim, &d_nnz);CHKERRQ(ierr);
- ierr = PetscMalloc1(ncrs_prim, &o_nnz);CHKERRQ(ierr);
+ ierr = PetscMalloc1(ncrs, &d_nnz);CHKERRQ(ierr);
+ ierr = PetscMalloc1(ncrs, &o_nnz);CHKERRQ(ierr);
ierr = MatGetOwnershipRange(Cmat, &Istart_crs, &Iend_crs);CHKERRQ(ierr);
ierr = MatGetSize(Cmat, &M, &N);CHKERRQ(ierr);
for (Ii = Istart_crs, jj = 0; Ii < Iend_crs; Ii += cr_bs, jj++) {
d_nnz[jj] = ncols/cr_bs;
o_nnz[jj] = ncols/cr_bs;
ierr = MatRestoreRow(Cmat,Ii,&ncols,0,0);CHKERRQ(ierr);
- if (d_nnz[jj] > ncrs_prim) d_nnz[jj] = ncrs_prim;
- if (o_nnz[jj] > (M/cr_bs-ncrs_prim)) o_nnz[jj] = M/cr_bs-ncrs_prim;
+ if (d_nnz[jj] > ncrs) d_nnz[jj] = ncrs;
+ if (o_nnz[jj] > (M/cr_bs-ncrs)) o_nnz[jj] = M/cr_bs-ncrs;
}
ierr = MatCreate(comm, &tMat);CHKERRQ(ierr);
- ierr = MatSetSizes(tMat, ncrs_prim, ncrs_prim,PETSC_DETERMINE, PETSC_DETERMINE);CHKERRQ(ierr);
+ ierr = MatSetSizes(tMat, ncrs, ncrs,PETSC_DETERMINE, PETSC_DETERMINE);CHKERRQ(ierr);
ierr = MatSetType(tMat,MATAIJ);CHKERRQ(ierr);
ierr = MatSeqAIJSetPreallocation(tMat,0,d_nnz);CHKERRQ(ierr);
ierr = MatMPIAIJSetPreallocation(tMat,0,d_nnz,0,o_nnz);CHKERRQ(ierr);
ierr = ISPartitioningCount(is_eq_newproc, size, counts);CHKERRQ(ierr);
ncrs_eq_new = counts[rank];
ierr = ISDestroy(&is_eq_newproc);CHKERRQ(ierr);
- ncrs_prim_new = ncrs_eq_new/cr_bs; /* eqs */
+ ncrs_new = ncrs_eq_new/cr_bs; /* eqs */
ierr = PetscFree(counts);CHKERRQ(ierr);
#if defined PETSC_GAMG_USE_LOG
ierr = PetscLogEventEnd(petsc_gamg_setup_events[SET12],0,0,0,0);CHKERRQ(ierr);
#endif
+ /* data movement scope -- this could be moved to subclasses so that we don't try to cram all auxilary data into some complex abstracted thing */
+ {
+ Vec src_crd, dest_crd;
+ const PetscInt *idx,ndata_rows=pc_gamg->data_cell_rows,ndata_cols=pc_gamg->data_cell_cols,node_data_sz=ndata_rows*ndata_cols;
+ VecScatter vecscat;
+ PetscScalar *array;
+ IS isscat;
/* move data (for primal equations only) */
/* Create a vector to contain the newly ordered element information */
ierr = VecCreate(comm, &dest_crd);CHKERRQ(ierr);
- ierr = VecSetSizes(dest_crd, node_data_sz*ncrs_prim_new, PETSC_DECIDE);CHKERRQ(ierr);
+ ierr = VecSetSizes(dest_crd, node_data_sz*ncrs_new, PETSC_DECIDE);CHKERRQ(ierr);
ierr = VecSetType(dest_crd,VECSTANDARD);CHKERRQ(ierr); /* this is needed! */
/*
There are 'ndata_rows*ndata_cols' data items per node, (one can think of the vectors of having
a block size of ...). Note, ISs are expanded into equation space by 'cr_bs'.
*/
- ierr = PetscMalloc1((ncrs_prim*node_data_sz), &tidx);CHKERRQ(ierr);
+ ierr = PetscMalloc1((ncrs*node_data_sz), &tidx);CHKERRQ(ierr);
ierr = ISGetIndices(is_eq_num_prim, &idx);CHKERRQ(ierr);
- for (ii=0,jj=0; ii<ncrs_prim; ii++) {
+ for (ii=0,jj=0; ii<ncrs; ii++) {
PetscInt id = idx[ii*cr_bs]/cr_bs; /* get node back */
for (kk=0; kk<node_data_sz; kk++, jj++) tidx[jj] = id*node_data_sz + kk;
}
ierr = ISRestoreIndices(is_eq_num_prim, &idx);CHKERRQ(ierr);
- ierr = ISCreateGeneral(comm, node_data_sz*ncrs_prim, tidx, PETSC_COPY_VALUES, &isscat);CHKERRQ(ierr);
+ ierr = ISCreateGeneral(comm, node_data_sz*ncrs, tidx, PETSC_COPY_VALUES, &isscat);CHKERRQ(ierr);
ierr = PetscFree(tidx);CHKERRQ(ierr);
/*
Create a vector to contain the original vertex information for each element
*/
- ierr = VecCreateSeq(PETSC_COMM_SELF, node_data_sz*ncrs_prim, &src_crd);CHKERRQ(ierr);
+ ierr = VecCreateSeq(PETSC_COMM_SELF, node_data_sz*ncrs, &src_crd);CHKERRQ(ierr);
for (jj=0; jj<ndata_cols; jj++) {
- const PetscInt stride0=ncrs_prim*pc_gamg->data_cell_rows;
- for (ii=0; ii<ncrs_prim; ii++) {
+ const PetscInt stride0=ncrs*pc_gamg->data_cell_rows;
+ for (ii=0; ii<ncrs; ii++) {
for (kk=0; kk<ndata_rows; kk++) {
PetscInt ix = ii*ndata_rows + kk + jj*stride0, jx = ii*node_data_sz + kk*ndata_cols + jj;
PetscScalar tt = (PetscScalar)pc_gamg->data[ix];
Put the element vertex data into a new allocation of the gdata->ele
*/
ierr = PetscFree(pc_gamg->data);CHKERRQ(ierr);
- ierr = PetscMalloc1(node_data_sz*ncrs_prim_new, &pc_gamg->data);CHKERRQ(ierr);
+ ierr = PetscMalloc1(node_data_sz*ncrs_new, &pc_gamg->data);CHKERRQ(ierr);
- pc_gamg->data_sz = node_data_sz*ncrs_prim_new;
- strideNew = ncrs_prim_new*ndata_rows;
+ pc_gamg->data_sz = node_data_sz*ncrs_new;
+ strideNew = ncrs_new*ndata_rows;
ierr = VecGetArray(dest_crd, &array);CHKERRQ(ierr);
for (jj=0; jj<ndata_cols; jj++) {
- for (ii=0; ii<ncrs_prim_new; ii++) {
+ for (ii=0; ii<ncrs_new; ii++) {
for (kk=0; kk<ndata_rows; kk++) {
PetscInt ix = ii*ndata_rows + kk + jj*strideNew, jx = ii*node_data_sz + kk*ndata_cols + jj;
pc_gamg->data[ix] = PetscRealPart(array[jx]);
}
ierr = VecRestoreArray(dest_crd, &array);CHKERRQ(ierr);
ierr = VecDestroy(&dest_crd);CHKERRQ(ierr);
-
+ }
/* move A and P (columns) with new layout */
#if defined PETSC_GAMG_USE_LOG
ierr = PetscLogEventBegin(petsc_gamg_setup_events[SET13],0,0,0,0);CHKERRQ(ierr);
}
/* stop if one node -- could pull back for singular problems */
- if (M/pc_gamg->data_cell_cols < 2) {
+ if ( (pc_gamg->data_cell_cols && M/pc_gamg->data_cell_cols < 2) || (!pc_gamg->data_cell_cols && M < 2)) {
level++;
break;
}
ierr = PetscFunctionListFind(GAMGList,type,&r);CHKERRQ(ierr);
if (!r) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_UNKNOWN_TYPE,"Unknown GAMG type %s given",type);
if (pc_gamg->ops->destroy) {
+ /* there was something here - kill it */
ierr = (*pc_gamg->ops->destroy)(pc);CHKERRQ(ierr);
ierr = PetscMemzero(pc_gamg->ops,sizeof(struct _PCGAMGOps));CHKERRQ(ierr);
+ /* cleaning up common data in pc_gamg - this should disapear someday */
+ pc_gamg->data_cell_cols = 0;
+ pc_gamg->data_cell_rows = 0;
+ pc_gamg->orig_data_cell_cols = 0;
+ pc_gamg->orig_data_cell_rows = 0;
+ if (pc_gamg->data_sz) {
+ ierr = PetscFree(pc_gamg->data);CHKERRQ(ierr);
+ pc_gamg->data_sz = 0;
+ }
+ else if (pc_gamg->data) {
+ ierr = PetscFree(pc_gamg->data);CHKERRQ(ierr); /* can this happen ? */
+ }
}
ierr = PetscFree(pc_gamg->gamg_type_name);CHKERRQ(ierr);
ierr = PetscStrallocpy(type,&pc_gamg->gamg_type_name);CHKERRQ(ierr);
|
{
"url": "https://bitbucket.org/petsc/petsc/commits/b009755aca395d8d437ea1b448c5d63bef7d4ca2?at=jed/missing-prototype",
"source_domain": "bitbucket.org",
"snapshot_id": "crawl=CC-MAIN-2015-14",
"warc_metadata": {
"Content-Length": "165079",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:2BXYXHOJDFV5AOACO7D25MRKIMVZGACO",
"WARC-Concurrent-To": "<urn:uuid:ed7ed3cc-193e-45bd-9760-8928c0151dc1>",
"WARC-Date": "2015-03-30T16:39:53Z",
"WARC-IP-Address": "131.103.20.168",
"WARC-Identified-Payload-Type": null,
"WARC-Payload-Digest": "sha1:FTVOGAEIMOS5Q6PRDW7NE6GF5PFNK5Z3",
"WARC-Record-ID": "<urn:uuid:d604ada3-157b-424d-866b-897840a6e151>",
"WARC-Target-URI": "https://bitbucket.org/petsc/petsc/commits/b009755aca395d8d437ea1b448c5d63bef7d4ca2?at=jed/missing-prototype",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:c5ecb98b-13d1-4a32-a46d-cb83df0834f0>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-168-14-71.ec2.internal\r\nsoftware: Nutch 1.6 (CC)/CC WarcExport 1.0\r\nisPartOf: CC-MAIN-2015-14\r\noperator: CommonCrawl Admin\r\ndescription: Wide crawl of the web with URLs provided by Blekko for March 2015\r\npublisher: CommonCrawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
8,
9,
45,
46,
96,
97,
179,
180,
193,
194,
212,
213,
241,
242,
244,
267,
319,
414,
441,
444,
446,
447,
481,
482,
505,
540,
575,
607,
639,
671,
703,
728,
755,
758,
759,
788,
789,
830,
855,
918,
961,
999,
1001,
1024,
1098,
1111,
1193,
1195,
1250,
1331,
1611,
1661,
1724,
1760,
1838,
1843,
1853,
1872,
1926,
1950,
1955,
1957,
2042,
2047,
2049,
2170,
2180,
2311,
2413,
2495,
2524,
2552,
2591,
2688,
2763,
2765,
2796,
2917,
2966,
3003,
3005,
3068,
3131,
3189,
3247,
3329,
3385,
3460,
3496,
3532,
3604,
3665,
3744,
3795,
3864,
3875,
3877,
3931,
4035,
4129,
4184,
4255,
4334,
4417,
4450,
4510,
4560,
4605,
4607,
4652,
4684,
4768,
4776,
4926,
4933,
4972,
5103,
5132,
5160,
5176,
5178,
5227,
5303,
5357,
5448,
5534,
5616,
5624,
5725,
5809,
5818,
5891,
5959,
6021,
6064,
6102,
6164,
6244,
6251,
6317,
6424,
6526,
6569,
6577,
6659,
6668,
6759,
6845,
6884,
6949,
6989,
7049,
7084,
7127,
7231,
7291,
7366,
7374,
7426,
7510,
7589,
7591,
7643,
7693,
7740,
7785,
7787,
7844,
7883,
7927,
7966,
8009,
8112,
8169,
8176,
8237,
8286,
8288,
8295,
8345,
8377,
8463,
8470,
8472,
8541,
8583,
8694,
8710,
8724,
8731,
8796,
8895,
8927,
8973,
9029,
9109,
9186,
9220,
9254,
9293,
9332,
9361,
9415,
9444,
9451,
9482,
9560,
9567,
9572,
9632
],
"line_end_idx": [
8,
9,
45,
46,
96,
97,
179,
180,
193,
194,
212,
213,
241,
242,
244,
267,
319,
414,
441,
444,
446,
447,
481,
482,
505,
540,
575,
607,
639,
671,
703,
728,
755,
758,
759,
788,
789,
830,
855,
918,
961,
999,
1001,
1024,
1098,
1111,
1193,
1195,
1250,
1331,
1611,
1661,
1724,
1760,
1838,
1843,
1853,
1872,
1926,
1950,
1955,
1957,
2042,
2047,
2049,
2170,
2180,
2311,
2413,
2495,
2524,
2552,
2591,
2688,
2763,
2765,
2796,
2917,
2966,
3003,
3005,
3068,
3131,
3189,
3247,
3329,
3385,
3460,
3496,
3532,
3604,
3665,
3744,
3795,
3864,
3875,
3877,
3931,
4035,
4129,
4184,
4255,
4334,
4417,
4450,
4510,
4560,
4605,
4607,
4652,
4684,
4768,
4776,
4926,
4933,
4972,
5103,
5132,
5160,
5176,
5178,
5227,
5303,
5357,
5448,
5534,
5616,
5624,
5725,
5809,
5818,
5891,
5959,
6021,
6064,
6102,
6164,
6244,
6251,
6317,
6424,
6526,
6569,
6577,
6659,
6668,
6759,
6845,
6884,
6949,
6989,
7049,
7084,
7127,
7231,
7291,
7366,
7374,
7426,
7510,
7589,
7591,
7643,
7693,
7740,
7785,
7787,
7844,
7883,
7927,
7966,
8009,
8112,
8169,
8176,
8237,
8286,
8288,
8295,
8345,
8377,
8463,
8470,
8472,
8541,
8583,
8694,
8710,
8724,
8731,
8796,
8895,
8927,
8973,
9029,
9109,
9186,
9220,
9254,
9293,
9332,
9361,
9415,
9444,
9451,
9482,
9560,
9567,
9572,
9632,
9703
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 9703,
"ccnet_original_nlines": 210,
"rps_doc_curly_bracket": 0.0035040699876844883,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.059210531413555145,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04934211075305939,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.5239661931991577,
"rps_doc_frac_unique_words": 0.5220125913619995,
"rps_doc_mean_word_length": 9.518867492675781,
"rps_doc_num_sentences": 13,
"rps_doc_symbol_to_word_ratio": 0.002349619986489415,
"rps_doc_unigram_entropy": 5.3520989418029785,
"rps_doc_word_count": 636,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.022794850170612335,
"rps_doc_frac_chars_dupe_6grams": 0.022794850170612335,
"rps_doc_frac_chars_dupe_7grams": 0.014535839669406414,
"rps_doc_frac_chars_dupe_8grams": 0.014535839669406414,
"rps_doc_frac_chars_dupe_9grams": 0.014535839669406414,
"rps_doc_frac_chars_top_2gram": 0.008589359931647778,
"rps_doc_frac_chars_top_3gram": 0.012223320081830025,
"rps_doc_frac_chars_top_4gram": 0.012553679756820202,
"rps_doc_books_importance": -1036.658447265625,
"rps_doc_books_importance_length_correction": -1036.658447265625,
"rps_doc_openwebtext_importance": -617.7319946289062,
"rps_doc_openwebtext_importance_length_correction": -617.7319946289062,
"rps_doc_wikipedia_importance": -396.5736083984375,
"rps_doc_wikipedia_importance_length_correction": -396.5736083984375
},
"fasttext": {
"dclm": 0.9998587369918823,
"english": 0.3486906886100769,
"fineweb_edu_approx": 3.5247693061828613,
"eai_general_math": 0.6028378009796143,
"eai_open_web_math": 0.5719915628433228,
"eai_web_code": 0.31307291984558105
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "518",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Numerical analysis"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "4",
"label": "Code/Software"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "3",
"label": "Academic Writing"
}
},
"reasoning_depth": {
"primary": {
"code": "4",
"label": "Advanced Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "4",
"label": "Graduate/Expert Level"
},
"secondary": {
"code": "3",
"label": "Undergraduate Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
7,418,088,867,057,381,000 |
Support for our reactive computational engine
Post by Exigo »
Hello! I hope this is the correct part of the forum to post the following.
I am experiencing problems modifying your Scheduling Engine when attempting to mix ALAP and ASAP scheduling. I have created a new Mixin class mixing SchedulerProEvent, ConstrainedLateEventMixin and ScheduledByDependenciesLateEventMixin - of which the latter two are from the Gantt part of the scheduler.
When I use webpack to generate a new schedulerpro.umd.js and then load a schedule, everything shows up fine when just using ASAP everywhere. However, upon trying to use the Backward direction on any event, it simply disappears. I have found this is because the LateStartDate and LateEndDates are not being calculated.
If I try to retrieve either of these parameters, it returns a Cycle during synchronous computation error. Upon inspecting the ScheduledByDependenciesLateEventMixin class, I can see that the model field lateStartDateIntervals has a calculate function called calculateLateStartDateConstraintIntervals. The class ConstrainedLateEventMixin has a calculate function, for the model field lateStartDateConstraintIntervals, named exactly the same. Is this intentional?
In any case, if I remove the 'Constraint' part of the function name, I get rid of the Cycle error, but now the LateStart- and LateEndDates are simply undefined.
Of worth noting is probably that simply importing SchedulerPro from SchedulerPro.js and loading a schedule from there, everything works and is calculated as expected.
This leads me to believe I might do something wrong when webpacking the files. Therefore I have attached the webpack config and index files I am using.
Just as a note: I have disabled any calculator functions in the custom Class.
I hope you are able to help!
Jesper @ Exigo
Attachments
webpack.config.js
(892 Bytes) Downloaded 182 times
index.js
(2.1 KiB) Downloaded 176 times
Post by arcady »
Providing your class code would also help to understand what happens (ideally a test case). :)
If you don't want to publish it here you can PM me.
Post by Exigo »
Hello arcady. Thank you for responding!
It seems that I have not been rigorous enough with my tests, as I have now resolved the issues.
The Cycle during synchronous computation error arose because of a cyclic dependency that has since been removed. (The dependency had fromEvent == toEvent.) The rearranging of the calculator function names seemed to make the calculations skip the dependencies, which is not what should happen.
As for the other part, I have found that the lateStartDate and lateEndDate parameters will not be calculated if a constraintDate is set. This seems to make sense for the usecases the Engine is built for, but is something I will have to figure a way around. This does fall outside of the scope of this topic though.
Thus it seems that this topic is not needed anymore. I apologize for the inconvenience. Should it be deleted?
Jesper @ Exigo
Post by arcady »
Ok I'm glad you are unblocked. No need for deleting I'll just mark it as resolved. :)
Post Reply
|
{
"url": "https://forum.bryntum.com/viewtopic.php?t=16030",
"source_domain": "forum.bryntum.com",
"snapshot_id": "CC-MAIN-2023-06",
"warc_metadata": {
"Content-Length": "81616",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:BFQHGLQRDYFARECSXGKVFQWUIHBER3NR",
"WARC-Concurrent-To": "<urn:uuid:1ffed2fc-1c2b-48a3-89bc-cdd990e80cf6>",
"WARC-Date": "2023-01-28T16:52:11Z",
"WARC-IP-Address": "93.188.2.52",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:FYPPGPE34CGZQGV643XLTBP7HWJEOINA",
"WARC-Record-ID": "<urn:uuid:65ede5dd-9908-4885-a876-0e397f447b93>",
"WARC-Target-URI": "https://forum.bryntum.com/viewtopic.php?t=16030",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:97a3efc4-dff9-4342-8b7e-320c6c9f047f>"
},
"warc_info": "isPartOf: CC-MAIN-2023-06\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for January/February 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-110\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
46,
47,
48,
64,
65,
140,
141,
445,
446,
764,
765,
1226,
1387,
1388,
1555,
1707,
1708,
1786,
1787,
1816,
1817,
1832,
1833,
1845,
1863,
1896,
1905,
1936,
1937,
1954,
1955,
2050,
2102,
2103,
2104,
2120,
2121,
2161,
2162,
2258,
2259,
2552,
2553,
2868,
2869,
2979,
2980,
2995,
2996,
2997,
3014,
3015,
3101,
3102,
3103
],
"line_end_idx": [
46,
47,
48,
64,
65,
140,
141,
445,
446,
764,
765,
1226,
1387,
1388,
1555,
1707,
1708,
1786,
1787,
1816,
1817,
1832,
1833,
1845,
1863,
1896,
1905,
1936,
1937,
1954,
1955,
2050,
2102,
2103,
2104,
2120,
2121,
2161,
2162,
2258,
2259,
2552,
2553,
2868,
2869,
2979,
2980,
2995,
2996,
2997,
3014,
3015,
3101,
3102,
3103,
3113
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3113,
"ccnet_original_nlines": 55,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.417677640914917,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.043327558785676956,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.14558058977127075,
"rps_doc_frac_unique_words": 0.49593496322631836,
"rps_doc_mean_word_length": 5.101625919342041,
"rps_doc_num_sentences": 41,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.043177127838135,
"rps_doc_word_count": 492,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.0438246987760067,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.013944219797849655,
"rps_doc_frac_chars_top_3gram": 0.010756970383226871,
"rps_doc_frac_chars_top_4gram": 0.0095617501065135,
"rps_doc_books_importance": -293.86895751953125,
"rps_doc_books_importance_length_correction": -293.86895751953125,
"rps_doc_openwebtext_importance": -145.57476806640625,
"rps_doc_openwebtext_importance_length_correction": -145.57476806640625,
"rps_doc_wikipedia_importance": -114.50579833984375,
"rps_doc_wikipedia_importance_length_correction": -114.50579833984375
},
"fasttext": {
"dclm": 0.06308311223983765,
"english": 0.939117968082428,
"fineweb_edu_approx": 1.254010796546936,
"eai_general_math": 0.8025577664375305,
"eai_open_web_math": 0.3780072331428528,
"eai_web_code": 0.11654508113861084
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "658.403",
"labels": {
"level_1": "Industrial arts, Technology, and Engineering",
"level_2": "Business",
"level_3": "Management"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "4",
"label": "Analyze"
},
"secondary": {
"code": "3",
"label": "Apply"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-5,509,206,413,712,569,000 |
Join output from FORM and function
Hello,
I try to use a join node to merge the output from a form with a output from a function to generate one json file. Unfortunly without sucsess.
Here is what i have so far:
[
{
"id": "8d9352e68a70b1fd",
"type": "ui_form",
"z": "82ac19b71eb25b31",
"name": "Form_Monitoring_email",
"label": "",
"group": "bab7662c278a9478",
"order": 1,
"width": 5,
"height": 1,
"options": [
{
"label": "HEADER",
"value": "header_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient I",
"value": "recipient_i_mon",
"type": "email",
"required": false,
"rows": null
},
{
"label": "Recipient ÍI",
"value": "recipient_ii_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient III",
"value": "recipient_iii_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient IV",
"value": "recipient_iv_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "TIME",
"value": "time_mon",
"type": "time",
"required": false,
"rows": null
},
{
"label": "ON/OFF",
"value": "onoff_mon",
"type": "switch",
"required": false,
"rows": null
}
],
"formValue": {
"header_mon": "",
"recipient_i_mon": "",
"recipient_ii_mon": "",
"recipient_iii_mon": "",
"recipient_iv_mon": "",
"time_mon": "",
"onoff_mon": false
},
"payload": "",
"submit": "submit",
"cancel": "",
"topic": "topic",
"topicType": "msg",
"splitLayout": "",
"className": "",
"x": 230,
"y": 980,
"wires": [
[
"5764cc98b83d07a8",
"ef0cb261063f0e03",
"68a215f7e32ede19",
"481883beddbfb833",
"3ee58843037493fc",
"ab9d78458ee8f0c1",
"d53af7de0858a5d1",
"de3608747211ba15",
"115c60abe275ac18"
]
]
},
{
"id": "5764cc98b83d07a8",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_header",
"func": "msg.payload = msg.payload.header_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 900,
"wires": [
[
"638eb62d60cb1f83"
]
]
},
{
"id": "ef0cb261063f0e03",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec1",
"func": "msg.payload = msg.payload.recipient_i_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 940,
"wires": [
[
"d13514091db804d1"
]
]
},
{
"id": "68a215f7e32ede19",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec2",
"func": "msg.payload = msg.payload.recipient_ii_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 980,
"wires": [
[
"7764e1e0525aead9"
]
]
},
{
"id": "481883beddbfb833",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec3",
"func": "msg.payload = msg.payload.recipient_iii_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1020,
"wires": [
[
"82960e75e298387e"
]
]
},
{
"id": "3ee58843037493fc",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec4",
"func": "msg.payload = msg.payload.recipient_iv_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1060,
"wires": [
[
"9bf39b9929f32aeb"
]
]
},
{
"id": "ab9d78458ee8f0c1",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_time",
"func": "msg.payload = msg.payload.time_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1100,
"wires": [
[
"bb50f400ae29fc88"
]
]
},
{
"id": "d53af7de0858a5d1",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_onoff",
"func": "msg.payload = msg.payload.onoff_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 1140,
"wires": [
[
"b59778d570969767"
]
]
},
{
"id": "bb50f400ae29fc88",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "get hours and minutes",
"func": "const time = new Date(msg.payload)\n// this is the number of milliseconds into the day, if needed\n//const msecLocal = time.getTime() - time.getTimezoneOffset() * 60000\nconst hours = time.getHours()\nconst mins = time.getMinutes()\nmsg.payload = `${hours.toString().padStart(2, \"0\")}:${mins.toString().padStart(2, \"0\")}`\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 700,
"y": 1100,
"wires": [
[
"a7b6fc5b27f43c27",
"115c60abe275ac18"
]
]
},
{
"id": "115c60abe275ac18",
"type": "join",
"z": "82ac19b71eb25b31",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "7",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 670,
"y": 800,
"wires": [
[
"e1c41221f400be93"
]
]
},
{
"id": "de3608747211ba15",
"type": "debug",
"z": "82ac19b71eb25b31",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 400,
"y": 800,
"wires": []
},
{
"id": "bab7662c278a9478",
"type": "ui_group",
"name": "Monitoring email",
"tab": "d95144c56e383182",
"order": 6,
"disp": true,
"width": 5,
"collapse": false,
"className": ""
},
{
"id": "d95144c56e383182",
"type": "ui_tab",
"name": "Jung Von Matt",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]
Thank you
Why not just alter/add the object properties you wish, rather than try to join/merge.
All you require then is one change or function node.
e.g.
[{"id":"8d9352e68a70b1fd","type":"ui_form","z":"b9860b4b9de8c8da","name":"Form_Monitoring_email","label":"","group":"bab7662c278a9478","order":1,"width":5,"height":1,"options":[{"label":"HEADER","value":"header_mon","type":"text","required":false,"rows":null},{"label":"Recipient I","value":"recipient_i_mon","type":"email","required":false,"rows":null},{"label":"Recipient ÍI","value":"recipient_ii_mon","type":"text","required":false,"rows":null},{"label":"Recipient III","value":"recipient_iii_mon","type":"text","required":false,"rows":null},{"label":"Recipient IV","value":"recipient_iv_mon","type":"text","required":false,"rows":null},{"label":"TIME","value":"time_mon","type":"time","required":false,"rows":null},{"label":"ON/OFF","value":"onoff_mon","type":"switch","required":false,"rows":null}],"formValue":{"header_mon":"","recipient_i_mon":"","recipient_ii_mon":"","recipient_iii_mon":"","recipient_iv_mon":"","time_mon":"","onoff_mon":false},"payload":"","submit":"submit","cancel":"","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":210,"y":2400,"wires":[["8d9352e68a70b1fd","58b4e68f5cce095a","68cde66f7d9ddc5d"]]},{"id":"58b4e68f5cce095a","type":"change","z":"b9860b4b9de8c8da","name":"","rules":[{"t":"set","p":"payload.time_mon","pt":"msg","to":"$moment($$.payload.time_mon).format(\"HH:mm\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":2400,"wires":[["de3608747211ba15"]]},{"id":"68cde66f7d9ddc5d","type":"function","z":"b9860b4b9de8c8da","name":"get hours and minutes","func":"const time = new Date(msg.payload.time_mon)\n// this is the number of milliseconds into the day, if needed\n//const msecLocal = time.getTime() - time.getTimezoneOffset() * 60000\nconst hours = time.getHours()\nconst mins = time.getMinutes()\nmsg.payload.time_mon = `${hours.toString().padStart(2, \"0\")}:${mins.toString().padStart(2, \"0\")}`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":2480,"wires":[["57e9db6e5c0fb572"]]},{"id":"de3608747211ba15","type":"debug","z":"b9860b4b9de8c8da","name":"debug 9","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":620,"y":2420,"wires":[]},{"id":"57e9db6e5c0fb572","type":"debug","z":"b9860b4b9de8c8da","name":"debug 324","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":2480,"wires":[]},{"id":"bab7662c278a9478","type":"ui_group","name":"Monitoring email","tab":"d95144c56e383182","order":6,"disp":true,"width":5,"collapse":false,"className":""},{"id":"d95144c56e383182","type":"ui_tab","name":"Jung Von Matt","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
1 Like
was the easierst solution. thank you
|
{
"url": "https://discourse.nodered.org/t/join-output-from-form-and-function/80042",
"source_domain": "discourse.nodered.org",
"snapshot_id": "CC-MAIN-2023-40",
"warc_metadata": {
"Content-Length": "36506",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:GLTTNY5ITTQ6THZ6BWP2RKZELPQVQHSO",
"WARC-Concurrent-To": "<urn:uuid:67415e45-148f-4f3c-a96d-01c62b8f9a8c>",
"WARC-Date": "2023-09-28T20:49:45Z",
"WARC-IP-Address": "184.105.99.75",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:4MW3CDXE63YG6XUU3TUQM4BLD4DKWHNH",
"WARC-Record-ID": "<urn:uuid:be709faa-6944-4782-8a57-547967d50aa8>",
"WARC-Target-URI": "https://discourse.nodered.org/t/join-output-from-form-and-function/80042",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:0778e17f-d457-4b3d-8106-5b3c7deefe41>"
},
"warc_info": "isPartOf: CC-MAIN-2023-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September/October 2023\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-30\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
35,
36,
43,
44,
186,
187,
215,
216,
218,
224,
258,
285,
318,
359,
380,
417,
437,
457,
478,
499,
513,
548,
587,
619,
654,
683,
698,
712,
752,
796,
829,
864,
893,
908,
922,
963,
1008,
1040,
1075,
1104,
1119,
1133,
1175,
1221,
1253,
1288,
1317,
1332,
1346,
1387,
1432,
1464,
1499,
1528,
1543,
1557,
1590,
1627,
1659,
1694,
1723,
1738,
1752,
1787,
1825,
1859,
1894,
1923,
1937,
1948,
1971,
2001,
2036,
2072,
2109,
2145,
2173,
2204,
2215,
2238,
2266,
2288,
2314,
2342,
2369,
2394,
2412,
2430,
2449,
2463,
2499,
2535,
2571,
2607,
2643,
2679,
2715,
2751,
2786,
2800,
2810,
2817,
2823,
2857,
2885,
2918,
2953,
3024,
3046,
3066,
3092,
3116,
3136,
3154,
3172,
3191,
3205,
3240,
3254,
3264,
3271,
3277,
3311,
3339,
3372,
3405,
3481,
3503,
3523,
3549,
3573,
3593,
3611,
3629,
3648,
3662,
3697,
3711,
3721,
3728,
3734,
3768,
3796,
3829,
3862,
3939,
3961,
3981,
4007,
4031,
4051,
4069,
4087,
4106,
4120,
4155,
4169,
4179,
4186,
4192,
4226,
4254,
4287,
4320,
4398,
4420,
4440,
4466,
4490,
4510,
4528,
4547,
4566,
4580,
4615,
4629,
4639,
4646,
4652,
4686,
4714,
4747,
4780,
4857,
4879,
4899,
4925,
4949,
4969,
4987,
5006,
5025,
5039,
5074,
5088,
5098,
5105,
5111,
5145,
5173,
5206,
5239,
5308,
5330,
5350,
5376,
5400,
5420,
5438,
5457,
5476,
5490,
5525,
5539,
5549,
5556,
5562,
5596,
5624,
5657,
5691,
5761,
5783,
5803,
5829,
5853,
5873,
5891,
5910,
5929,
5943,
5978,
5992,
6002,
6009,
6015,
6049,
6077,
6110,
6151,
6509,
6531,
6551,
6577,
6601,
6621,
6639,
6658,
6677,
6691,
6727,
6762,
6776,
6786,
6793,
6799,
6833,
6857,
6890,
6910,
6936,
6963,
6994,
7025,
7049,
7074,
7103,
7132,
7155,
7177,
7207,
7232,
7258,
7288,
7315,
7333,
7351,
7370,
7384,
7419,
7433,
7443,
7450,
7456,
7490,
7515,
7548,
7575,
7599,
7626,
7652,
7679,
7708,
7733,
7763,
7781,
7799,
7819,
7826,
7832,
7866,
7894,
7930,
7965,
7985,
8007,
8027,
8054,
8078,
8085,
8091,
8125,
8151,
8184,
8213,
8233,
8260,
8284,
8290,
8292,
8293,
8303,
8304,
8390,
8443,
8448,
8449,
11242,
11243,
11250,
11251
],
"line_end_idx": [
35,
36,
43,
44,
186,
187,
215,
216,
218,
224,
258,
285,
318,
359,
380,
417,
437,
457,
478,
499,
513,
548,
587,
619,
654,
683,
698,
712,
752,
796,
829,
864,
893,
908,
922,
963,
1008,
1040,
1075,
1104,
1119,
1133,
1175,
1221,
1253,
1288,
1317,
1332,
1346,
1387,
1432,
1464,
1499,
1528,
1543,
1557,
1590,
1627,
1659,
1694,
1723,
1738,
1752,
1787,
1825,
1859,
1894,
1923,
1937,
1948,
1971,
2001,
2036,
2072,
2109,
2145,
2173,
2204,
2215,
2238,
2266,
2288,
2314,
2342,
2369,
2394,
2412,
2430,
2449,
2463,
2499,
2535,
2571,
2607,
2643,
2679,
2715,
2751,
2786,
2800,
2810,
2817,
2823,
2857,
2885,
2918,
2953,
3024,
3046,
3066,
3092,
3116,
3136,
3154,
3172,
3191,
3205,
3240,
3254,
3264,
3271,
3277,
3311,
3339,
3372,
3405,
3481,
3503,
3523,
3549,
3573,
3593,
3611,
3629,
3648,
3662,
3697,
3711,
3721,
3728,
3734,
3768,
3796,
3829,
3862,
3939,
3961,
3981,
4007,
4031,
4051,
4069,
4087,
4106,
4120,
4155,
4169,
4179,
4186,
4192,
4226,
4254,
4287,
4320,
4398,
4420,
4440,
4466,
4490,
4510,
4528,
4547,
4566,
4580,
4615,
4629,
4639,
4646,
4652,
4686,
4714,
4747,
4780,
4857,
4879,
4899,
4925,
4949,
4969,
4987,
5006,
5025,
5039,
5074,
5088,
5098,
5105,
5111,
5145,
5173,
5206,
5239,
5308,
5330,
5350,
5376,
5400,
5420,
5438,
5457,
5476,
5490,
5525,
5539,
5549,
5556,
5562,
5596,
5624,
5657,
5691,
5761,
5783,
5803,
5829,
5853,
5873,
5891,
5910,
5929,
5943,
5978,
5992,
6002,
6009,
6015,
6049,
6077,
6110,
6151,
6509,
6531,
6551,
6577,
6601,
6621,
6639,
6658,
6677,
6691,
6727,
6762,
6776,
6786,
6793,
6799,
6833,
6857,
6890,
6910,
6936,
6963,
6994,
7025,
7049,
7074,
7103,
7132,
7155,
7177,
7207,
7232,
7258,
7288,
7315,
7333,
7351,
7370,
7384,
7419,
7433,
7443,
7450,
7456,
7490,
7515,
7548,
7575,
7599,
7626,
7652,
7679,
7708,
7733,
7763,
7781,
7799,
7819,
7826,
7832,
7866,
7894,
7930,
7965,
7985,
8007,
8027,
8054,
8078,
8085,
8091,
8125,
8151,
8184,
8213,
8233,
8260,
8284,
8290,
8292,
8293,
8303,
8304,
8390,
8443,
8448,
8449,
11242,
11243,
11250,
11251,
11287
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 11287,
"ccnet_original_nlines": 331,
"rps_doc_curly_bracket": 0.0072650001384317875,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.07560297101736069,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.008812620304524899,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.6136363744735718,
"rps_doc_frac_unique_words": 0.4225352108478546,
"rps_doc_mean_word_length": 9.1936616897583,
"rps_doc_num_sentences": 55,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.031798362731934,
"rps_doc_word_count": 568,
"rps_doc_frac_chars_dupe_10grams": 0.11087705940008163,
"rps_doc_frac_chars_dupe_5grams": 0.21141324937343597,
"rps_doc_frac_chars_dupe_6grams": 0.1558789759874344,
"rps_doc_frac_chars_dupe_7grams": 0.14917655289173126,
"rps_doc_frac_chars_dupe_8grams": 0.14266565442085266,
"rps_doc_frac_chars_dupe_9grams": 0.11087705940008163,
"rps_doc_frac_chars_top_2gram": 0.03581003099679947,
"rps_doc_frac_chars_top_3gram": 0.044235918670892715,
"rps_doc_frac_chars_top_4gram": 0.04442742094397545,
"rps_doc_books_importance": -1123.3167724609375,
"rps_doc_books_importance_length_correction": -1123.3167724609375,
"rps_doc_openwebtext_importance": -520.3033447265625,
"rps_doc_openwebtext_importance_length_correction": -520.3033447265625,
"rps_doc_wikipedia_importance": -532.1054077148438,
"rps_doc_wikipedia_importance_length_correction": -532.1054077148438
},
"fasttext": {
"dclm": 0.9840399026870728,
"english": 0.32892096042633057,
"fineweb_edu_approx": 3.1481621265411377,
"eai_general_math": 0.17644023895263672,
"eai_open_web_math": 0.23034733533859253,
"eai_web_code": 0.889764666557312
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "004.0285",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-6,911,079,383,947,673,000 |
Thomson Reuters Tick History (TRTH) - REST API
Close Menu
Expand All Collapse All
Introductory Tutorials Tutorials Introduction Video introduction to the TRTH REST API Programming without SDK Tutorial REST API Tutorials REST API Tutorials Introduction REST API Tutorial 1: Connecting to the server REST API Tutorial 2: Retrieving VBD files REST API Tutorial 3: On Demand data extraction workflow REST API Tutorial 4: On Demand tick data extraction REST API Tutorial 5: On Demand market depth extraction REST API Tutorial 6: On Demand intraday bars extraction REST API Tutorial 7: On Demand End of Day extraction REST API Tutorial 8: On Demand raw data extraction REST API Tutorial 9: On Demand corporate actions extraction REST API Tutorial 10: On Demand Histo Reference extraction REST API Tutorial 11: On Demand extraction: instrument list REST API Tutorial 12: GUI control calls: immediate extract REST API Tutorial 13: Historical Search REST API Tutorial 14: Historical Criteria Search REST API Tutorial 15: Historical Chain Constituents Search REST API Tutorial 16: Search by Instrument REST API Tutorial 17: Search for an Equity REST API Tutorial 18: Search for a Future or Option .Net SDK Tutorials .Net SDK Tutorial 1: Connecting to the server .Net SDK Tutorial 2: Retrieving VBD files .Net SDK Tutorial 3: GUI control calls: List, report, sched .Net SDK Tutorial 4: GUI control calls: Validate, extraction .Net SDK Tutorial 5: On Demand extraction, file IO Google BigQuery Tutorials Introduction and environment set-up Data retrieval and tick filters Data analytics Query optimization
REST API Tutorial 2: Retrieving VBD files
Last update February 2020
Environment Any
Language Any HTTP is supported
Compilers None
Prerequisites DSS login, internet access
Source code Below
Tutorial purpose
This tutorial explains how to download the latest Venue by Day (VBD) files of interest, for a set of exchanges. This requires the following steps:
• Retrieve the list of user packages for which we have permission (for the TRTH VBD subscription this corresponds to the list of venues, i.e. exchanges).
• Select a few, based on a list of exchange names we are interested in.
• For each selected user package, we:
• Retrieve the full list of users package deliveries (data files);
• Select those with the most recent date (i.e. the previous or current day);
• Select those where the file type is in our list of interest;
• Retrieve those files.
These steps illustrate a typical use case and use the API calls, except the filtering steps, which do not require the API.
Table of contents
Domain objects: explanations
This section explains some key concepts, illustrated with the relevant API calls. These concepts are essential to understand the code. For more information, refer to the API User Guide.
Subscriptions
An account can have permission for one or several subscriptions, like Ownership and Profiles, StreetEvents, Insider, or TRTH Venue by Day.
Each subscription has a subscription Id and name, which does not change. For Tick History Venue by Day they are 0x0400dc1d24a00cb4 and TRTH Venue by Day respectively.
API call to retrieve the list of all subscriptions (regardless of permissions), and return their Ids and names:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1//StandardExtractions/Subscriptions
Packages
Each subscription delivers a set of packages. For the TRTH Venue by Day subscription the package list is the list of venues (exchanges or data providers).
Each package has a package Id.
API call to retrieve the list of all available packages for all subscriptions, and return all package Ids and names:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/Packages
API call to retrieve all available packages for a specific subscription Id:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/PackageGetPackagesBySubscriptionId(Id='0x0400dc1d24a00cb4')
API call to retrieve the list of all user packages, i.e. packages to which I am entitled (for all subscriptions), and return the user package Id, user package name and the corresponding subscription name:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackages
This tutorial uses this last API call.
Package deliveries
Package deliveries are data files.
For TRTH Venue by Day, these are of several file types:
• Market data file types, formatted or raw:
• NORMALIZEDMP Tick-by-tick: Auction, Correction, Market Condition, Quote and Trade
• NORMALIZEDLL2 Market by price (25 levels)
• MARKETPRICE NORMALIZEDMP in raw format
• LEGACYLEVEL2 NORMALIZEDLL2 in raw format
Formatted files are the preferred choice as they do not require subsequent treatment by the developer.
• Other file types:
• CORP Corporate Actions: dividend, earning, capital change, share type & stock split
• REF Asset specific reference data: metadata, terms & conditions, symbology changes, etc.
• Instruments All the venue’s active instruments. Based on your entitlements, you will receive 1 or more files.
Some file types include not only a data file but also an associated report file that mentions if an instrument was inactive, or its period of activity. Market data is usually active (except for banking holidays and non volatile instruments). Corporate actions and reference data are usually inactive. Here is a small extract for market data:
#RIC,Start (UTC),End (UTC),Status,Details,Count
ABS.MW,,,Inactive,,0
IBM.MW,2016-06-09T05:00:00.605323202Z,2016-06-09T20:00:00.618220426Z,Active,,51
API call to retrieve the list of all user package deliveries for a specific subscription Id and a specific date range, and return the file names and sizes:
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByDateRange(SubscriptionId='0x0400dc1d24a00cb4',FromDate=2016-10-12T19:33:10.709Z,ToDate=2016-10-14T19:33:10.709Z)
The servers keep VBD files for 30 days; after that they are discarded.
API call to retrieve the list of all user package deliveries for a specific user package Id, and return the file names and sizes:
GET
https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d13c59cb1')
This tutorial uses this last API call.
Other methods to retrieve user package deliveries (lazy loading, paging and change tracking) are illustrated in the REST API C# example application that was presented in the Quick Start.
Programming steps
The aim is to download the latest Venue by Day (VBD) files of interest, for a set of exchanges.
Main steps:
Get the list of all user packages - HTTP request
We start by retrieving the entire list of user packages, i.e. those for which we have permission.
Note: for all requests we need a user token, set in the header. The token was retrieved in Tutorial 1.
URL:
https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackages
Method: GET
Headers:
Prefer: respond-async
Content-Type: application/json
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061
Get the list of all user packages - HTTP response
If the token is valid, this is the response we get:
Status: 200 OK
Relevant headers:
Content-Type: application/json; charset=utf-8
Body:
Notes:
• The number of values in the response depends on the entitlements for the account we use.
• The response will contain packages for all subscriptions, not only TRTH Venue by Day.
• Here is the beginning of a typical response.
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#UserPackages",
"value": [
{
"UserPackageId": "0x04f21a8d13459cb1",
"PackageId": "0x04f21a8d13459cb1",
"PackageName": "ADC - NASD Alternative Display Facility for NYSE/AMEX Issues",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
{
"UserPackageId": "0x04f21a8d13759cb1",
"PackageId": "0x04f21a8d13759cb1",
"PackageName": "ADE - ATHENS DERIVATIVES EXCHANGE",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
{
"UserPackageId": "0x04f21a8d13859cb1",
"PackageId": "0x04f21a8d13859cb1",
"PackageName": "ADF - NASD Alternative Display Facility for Nasdaq Large Cap",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
{
"UserPackageId": "0x04f21a8d13a59cb1",
"PackageId": "0x04f21a8d13a59cb1",
"PackageName": "ADS - NASD Alternative Display Facility for Nasdaq Capital Market",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
This goes on with all the other available packages. Here is the last part:
{
"UserPackageId": "0x06559b6f5b6b2f96",
"PackageId": "0x06559b6f5b6b2f96",
"PackageName": "RRUS - Regulatory Russian Sanctions",
"SubscriptionId": "0x06516d2d08ab3036",
"SubscriptionName": "Regulatory Subscriptions"
},
{
"UserPackageId": "0x06af6b1a4720c1bf",
"PackageId": "0x06af6b1a4720c1bf",
"PackageName": "EMB - Euronext Access Brussels",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
{
"UserPackageId": "0x06baab580e50d65f",
"PackageId": "0x06baab580e50d65f",
"PackageName": "PSX - Pakistan Stock Exchange",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
}
]
}
Note: the PackageId is unique to the each package.
Select the TRTH VBD user packages
The results of the previous call include all packages for all subscriptions we are entitled to.
Our next step is to filter the results by SubscriptionName, to keep only those where the value is “TRTH Venue by Day”. This is a simple string comparison.
This filtering operation does not use API calls, it is therefore out of scope for this tutorial.
Note:
• One could be tempted to consider that the contents of this list will not change, and to just save it instead of using calls to retrieve it. This is not recommended, as permission changes would not be taken into account !
Filter the list based on exchange code (optional)
The results of the previous step include all TRTH VBD packages for all subscriptions we are entitled to.
The next (optional) step would be to further filter the results by PackageName, to keep only those of interest. This is again based on a string comparison.
This second filtering might not be required, as the permissioning should reflect the data needs.
This filtering operation does not use API calls, it is therefore out of scope for this tutorial.
The important point at this stage of the workflow is to end up with a list of PackageId for which we want to retrieve data.
In what follows we will limit our list to one single package, for exchange PHS:
{
"UserPackageId": "0x04f21a8d28f59cb1",
"PackageId": "0x04f21a8d28f59cb1",
"PackageName": "PHS - Philippine Stock Exchange",
"SubscriptionId": "0x0400dc1d24a00cb4",
"SubscriptionName": "TRTH Venue by Day"
},
Get the list of user package deliveries - HTTP request
For each selected PackageId we retrieve the entire list of user package deliveries (data files). The PackageId is a parameter set in the URL.
URL:
https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1')
Method: GET
Headers:
Prefer: respond-async
Content-Type: application/json
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061
Get the list of user package deliveries - HTTP response
If the token and PackageId are valid, this is the response we get:
Status: 200 OK
Relevant headers:
Content-Type: application/json; charset=utf-8
Body:
Notes:
• There are several files per day (one per file type).
• The servers keep VBD files for 30 days; after that they are discarded.
Here is the beginning of a typical response:
{
"@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#UserPackageDeliveries",
"value": [
{
"PackageDeliveryId": "0x06fe961e57016137",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-24-LEGACYLEVEL2-Report-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-24T12:00:00.000Z",
"FileSizeBytes": 8161,
"Frequency": "Daily",
"ContentMd5": "90ba1ab5408ec2ac8518f31f73faaf5f"
},
{
"PackageDeliveryId": "0x06fe9707ed61613e",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-24-LEGACYLEVEL2-Data-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-24T12:00:00.000Z",
"FileSizeBytes": 9406177,
"Frequency": "Daily",
"ContentMd5": "7dc36fe12422ed48d446366b2a3842f7"
},
{
"PackageDeliveryId": "0x06fe9363d4a16128",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-24-NORMALIZEDLL2-Data-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-24T12:00:00.000Z",
"FileSizeBytes": 3850840,
"Frequency": "Daily",
"ContentMd5": "8a07f63c3d4cc2ff98a9bbc0b36bf34c"
},
This goes on with all the other available packages deliveries. Here is the last part:
{
"PackageDeliveryId": "0x06fc020280615bd7",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-16-LEGACYLEVEL2-Data-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-16T12:00:00.000Z",
"FileSizeBytes": 172787,
"Frequency": "Daily",
"ContentMd5": "37e807047f11d2a0753694abef0dbc84"
},
{
"PackageDeliveryId": "0x06fbff46bf515bc2",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-16-NORMALIZEDLL2-Report-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-16T12:00:00.000Z",
"FileSizeBytes": 3290,
"Frequency": "Daily",
"ContentMd5": "1e03443ab73fe95069d6dd19df55d4b6"
},
{
"PackageDeliveryId": "0x06fc03d505715be4",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-16-NORMALIZEDLL2-Data-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-16T12:00:00.000Z",
"FileSizeBytes": 230,
"Frequency": "Daily",
"ContentMd5": "aea69465f84bad58fa485a7f347afaf3"
}
],
"@odata.nextlink": "https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveryGetUserPackageDeliveriesByPackageId(PackageId='0x04f21a8d28f59cb1')?$skiptoken='MjAyMC0wMi0xNlQwODoxODo1MC4zNjAwMDAwfDF8'"
}
The data might be followed by a nextlink which leads to more available files (older ones).
Select the most recent user package deliveries
The results of the previous call include all package deliveries (data files) for a specific UserPackageId. This covers a range of 30 days of data, and all file types.
In this example scenario we decided to select the most recent data set. This is just an example; other workflows can be implemented to fit whatever use case you require. The REST API C# example application described in the Quick Start illustrates other ways of proceeding, like requesting package deliveries by date range, or change tracking to detect new files. It also shows how to manage paging in case the number of results is very large.
We therefore filter the results by date, to keep only the more recent ones. This can be done using either the date in the file name, or the release date time.
Note:
• Venue by Day data for a specific exchange is made available after the exchange has closed. Depending on the relative geographic location, time of day and time zone of the exchange and the computer where the call is run, the most recent data could be dated of the current or previous day.
• To detect the most recent data set, one can simply use a string comparison between the package delivery names and a date, starting with today’s date, for the case where data is already available. If this delivers no results then try yesterday’s date.
As an illustration, here is the list of the files names for one day, for exchange PHS. Depending on your data permissions, your list might contain more or less files than this example:
PHS-2020-02-24-LEGACYLEVEL2-Report-1-of-1.csv.gz
PHS-2020-02-24-LEGACYLEVEL2-Data-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDLL2-Data-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDLL2-Report-1-of-1.csv.gz
PHS-2020-02-24-MARKETPRICE-Data-1-of-1.csv.gz
PHS-2020-02-24-MARKETPRICE-Report-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDMP-Report-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDMP-Data-1-of-1.csv.gz
PHS-2020-02-24-CORP-Report-1-of-1.csv.gz
PHS-2020-02-24-CORP-Data-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-REF-Report-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-1-of-1.csv.gz
This filtering operation does not use API calls, it is therefore out of scope for this tutorial.
Filter the list based on file type (optional)
The results of the previous step include all package deliveries (data files) for a specific UserPackageId and day, and contain all file types.
File types were described above under section: Package deliveries. Depending on the use case, maybe only a subset of the files might be required. The choice would typically be based on either or both of:
• The file type
Formatted files are the preferred choice as they do not require subsequent treatment by the developer; the raw ones are rarely required.
• Report files
These deliver additional information on instruments (in)activity, but require additional processing.
To filter on the file type we can simply make a string comparison between the package delivery names and a list of file type names we are interested in.
As an illustration, here is the shorter list of files names, excluding those that contain raw data (MARKETPRICE and LEGACYLEVEL2):
PHS-2020-02-24-NORMALIZEDLL2-Data-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDLL2-Report-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDMP-Report-1-of-1.csv.gz
PHS-2020-02-24-NORMALIZEDMP-Data-1-of-1.csv.gz
PHS-2020-02-24-CORP-Report-1-of-1.csv.gz
PHS-2020-02-24-CORP-Data-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-REF-Report-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-1-of-1.csv.gz
PHS-2020-02-24-REF-Data-CUSIP-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-SEDOL-1-of-1.csv.gz
PHS-2020-02-24-Instruments-SEDOL-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-GICS-1-of-1.csv.gz
PHS-2020-02-24-Instruments-CUSIP-1-of-1.csv.gz
This filtering operation does not use API calls, it is therefore out of scope for this tutorial.
The important point at this stage of the workflow is to end up with a list of PackageDeliveryId of all the files we want to retrieve.
Get the selected user package deliveries - HTTP request
In this last step we retrieve the files using an octet stream, in order to save them to local disk.
This is done one file at a time. The PackageDeliveryId is a parameter set in the URL.
As an example, let us retrieve this file:
{
"PackageDeliveryId": "0x06fe927a55916120",
"UserPackageId": "0x04f21a8d28f59cb1",
"SubscriptionId": "0x0400dc1d24a00cb4",
"Name": "PHS-2020-02-24-NORMALIZEDMP-Data-1-of-1.csv.gz",
"ReleaseDateTime": "2020-02-24T12:00:00.000Z",
"FileSizeBytes": 4687942,
"Frequency": "Daily",
"ContentMd5": "e88d29a0541648b237ee45754f397f70"
},
URL:
https://hosted.datascopeapi.reuters.com/RestApi/v1/StandardExtractions/UserPackageDeliveries('0x06fe927a55916120')/$value
Method: GET
Headers:
Prefer: respond-async
Content-Type:application/octet-stream
Authorization: Token F0ABE9A3FFF2E02E10AE2765ED872C59B8CC3B40EBB61B30E295E71DE31C254B8648DB9434C2DF9299FDC668AA123501F322D99D45C8B93438063C912BC936C7B87062B0CF812138863F5D836A7B31A32DCA67EF07B3B50B2FC4978DF6F76784FDF35FCB523A8430DA93613BC5730CDC310D4D241718F9FC3F2E55465A24957CC287BDEC79046B31AD642606275AEAD76318CB221BD843348E1483670DA13968D8A242AAFCF9E13E23240C905AE46DED9EDCA9BB316B4C5C767B18DB2EA7ADD100817ADF059D01394BC6375BECAF6138C25DBA57577F0061
Get the selected user package deliveries - HTTP response
If the token and PackageDeliveryId are valid, this is the response we get:
Status: 200 OK
Relevant headers:
Note: the content type is different from the other queries, it is text/plain.
Content-Type: text/plain
Body:
Here is the beginning of the response:
#RIC,Domain,Date-Time,GMT Offset,Type,Ex/Cntrb.ID,LOC,Price,Volume,Market VWAP,Buyer ID,Bid Price,Bid Size,No. Buyers,Seller ID,Ask Price,Ask Size,No. Sellers,Qualifiers,Seq. No.,Exch Time,Block Trd,PE Ratio,Yield,Bid Yld,Ask Yld,ISMA Bid Yld,ISMA Ask Yld,Duration,Mod Durtn,BPV,Convexity,Bench Spd,Swp Spd,Asst Swp Spd,Swap Point,UpLim Price,LoLim Price,Theo. Price,Parity,Premium,Bid Imp. Vol,Ask Imp. Vol,Imp. Vol.,Crack,Top,Freight Pr.,Offer,Actual,Prior,Revised,Forecast,Frcst High,Frcst Low,No. Frcts,Date,Bid Tic,Tick Dir.,Open,High,Low,Open Interest,Bench Price,Acc. Volume,Turnover,Mid Price,Original Date,Original Price,Original Volume,Original Seq. No.,Original Exch Time,Trade Price Currency,Unique Trade Identification,Net Change,Original Unique Trade Identification,ISIN,Unique Quote Identification
.PSAL,Market Price,2020-02-24T01:30:01.556889847Z,+8,Trade,,,4306.02,0,,,,,,,,,,,,01:30:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4306.02,4306.02,,,0,0,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:31:01.437066143Z,+8,Trade,,,4301.31,30748,,,,,,,,,,,,01:31:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4306.02,4301.31,,,30748250,108829255,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:32:01.468267839Z,+8,Trade,,,4307.05,2999,,,,,,,,,,,,01:32:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,^,4306.02,4307.05,4301.31,,,33747085,127181593,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:33:01.468835416Z,+8,Trade,,,4306.68,3158,,,,,,,,,,,,01:33:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4301.31,,,36905265,140414987,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:34:01.545606636Z,+8,Trade,,,4299.06,3285,,,,,,,,,,,,01:34:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4299.06,,,40190990,151749899,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:35:01.240809214Z,+8,Trade,,,4296.98,2606,,,,,,,,,,,,01:35:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4296.98,,,42796885,168932758,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:36:01.333410266Z,+8,Trade,,,4294.44,3294,,,,,,,,,,,,01:36:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4294.44,,,46090455,195649046,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:37:01.513132347Z,+8,Trade,,,4291.83,4642,,,,,,,,,,,,01:37:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4291.83,,,50732185,224475327,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:38:01.454314888Z,+8,Trade,,,4289.12,2430,,,,,,,,,,,,01:38:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4289.12,,,53162115,240115974,,,,,,,,,,,,
.PSAL,Market Price,2020-02-24T01:39:01.497485764Z,+8,Trade,,,4288.29,2250,,,,,,,,,,,,01:39:00.000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2020-02-24,,v,4306.02,4307.05,4288.29,,,55412685,251305473,,,,,,,,,,,,
Saving the file contents to disk does not use API calls, it is therefore out of scope for this tutorial.
Note: Postman might fail and crash when retrieving very large files. If you want to test this, choose a small file.
Conclusions
This tutorial illustrated several API calls in a simple scenario to retrieve the latest TRTH Venue By Day data, for a set of exchanges. The explanations have been kept simple to concentrate on the API functionality and simultaneously achieve a tangible result.
For more information and code snippets, refer to the the API User Guide and the C# example application described in the Quick Start.
Tutorial Group:
REST API Tutorials
|
{
"url": "https://developers.refinitiv.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/learning?content=10521&type=learning_material_item",
"source_domain": "developers.refinitiv.com",
"snapshot_id": "crawl=CC-MAIN-2020-16",
"warc_metadata": {
"Content-Length": "68201",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:2EA7DONPZWEDH7ACI47O5DJR7HNRJY2X",
"WARC-Concurrent-To": "<urn:uuid:0db8f047-8706-4c8b-a377-28f2aeca37a9>",
"WARC-Date": "2020-04-05T15:39:15Z",
"WARC-IP-Address": "164.57.208.98",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:JYYYIUSY2A7PHANEUE44SHPFFRPOKBFH",
"WARC-Record-ID": "<urn:uuid:1e8cf397-5a18-419d-88bf-f5d18869d316>",
"WARC-Target-URI": "https://developers.refinitiv.com/thomson-reuters-tick-history-trth/thomson-reuters-tick-history-trth-rest-api/learning?content=10521&type=learning_material_item",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:16864994-bc81-4ebf-bef7-b070e92dbbaf>"
},
"warc_info": "isPartOf: CC-MAIN-2020-16\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for March/April 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-212.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
47,
48,
59,
83,
1595,
1596,
1638,
1639,
1665,
1681,
1712,
1727,
1768,
1786,
1787,
1804,
1805,
1952,
1953,
2109,
2183,
2223,
2294,
2375,
2442,
2470,
2471,
2594,
2595,
2597,
2598,
2616,
2617,
2619,
2620,
2649,
2650,
2836,
2837,
2851,
2852,
2991,
2992,
3159,
3160,
3272,
3273,
3363,
3364,
3366,
3367,
3376,
3377,
3532,
3533,
3564,
3565,
3682,
3683,
3767,
3768,
3844,
3845,
3980,
3981,
4186,
4187,
4275,
4276,
4315,
4316,
4318,
4319,
4338,
4339,
4374,
4375,
4431,
4432,
4478,
4574,
4630,
4686,
4743,
4744,
4847,
4848,
4870,
4975,
5088,
5208,
5209,
5551,
5552,
5600,
5621,
5701,
5702,
5858,
5859,
6092,
6093,
6164,
6165,
6295,
6296,
6300,
6458,
6459,
6498,
6499,
6686,
6687,
6689,
6690,
6708,
6709,
6805,
6806,
6818,
6819,
6821,
6822,
6871,
6872,
6970,
6971,
7074,
7075,
7080,
7081,
7165,
7166,
7187,
7188,
7197,
7198,
7220,
7251,
7705,
7706,
7708,
7709,
7759,
7760,
7812,
7813,
7851,
7852,
7870,
7871,
7917,
7918,
7924,
7925,
7932,
7933,
8026,
8116,
8165,
8167,
8264,
8277,
8283,
8328,
8369,
8454,
8500,
8546,
8553,
8559,
8604,
8645,
8703,
8749,
8795,
8802,
8808,
8853,
8894,
8979,
9025,
9071,
9078,
9084,
9129,
9170,
9260,
9306,
9352,
9359,
9360,
9435,
9436,
9442,
9487,
9528,
9588,
9634,
9687,
9694,
9700,
9745,
9786,
9841,
9887,
9933,
9940,
9946,
9991,
10032,
10086,
10132,
10178,
10184,
10188,
10190,
10191,
10242,
10243,
10245,
10246,
10280,
10281,
10377,
10378,
10533,
10534,
10631,
10632,
10638,
10639,
10864,
10865,
10867,
10868,
10918,
10919,
11024,
11025,
11181,
11182,
11280,
11281,
11378,
11379,
11503,
11504,
11584,
11585,
11591,
11636,
11677,
11733,
11779,
11825,
11832,
11833,
11835,
11836,
11891,
11892,
12034,
12035,
12040,
12041,
12199,
12200,
12221,
12222,
12231,
12232,
12254,
12285,
12739,
12740,
12742,
12743,
12799,
12800,
12867,
12868,
12906,
12907,
12925,
12926,
12972,
12973,
12979,
12980,
12987,
12988,
13045,
13120,
13121,
13166,
13167,
13169,
13275,
13288,
13294,
13343,
13388,
13434,
13500,
13553,
13582,
13610,
13665,
13672,
13678,
13727,
13772,
13818,
13882,
13935,
13967,
13995,
14050,
14057,
14063,
14112,
14157,
14203,
14268,
14321,
14353,
14381,
14436,
14443,
14444,
14530,
14531,
14537,
14586,
14631,
14677,
14741,
14794,
14825,
14853,
14908,
14915,
14921,
14970,
15015,
15061,
15128,
15181,
15210,
15238,
15293,
15300,
15306,
15355,
15400,
15446,
15511,
15564,
15592,
15620,
15675,
15681,
15686,
15921,
15923,
15924,
16015,
16016,
16018,
16019,
16066,
16067,
16234,
16235,
16678,
16679,
16838,
16839,
16845,
16846,
17138,
17393,
17394,
17579,
17580,
17629,
17676,
17724,
17774,
17820,
17868,
17917,
17964,
18005,
18044,
18088,
18128,
18172,
18215,
18264,
18319,
18368,
18406,
18456,
18502,
18555,
18596,
18654,
18701,
18753,
18805,
18852,
18853,
18950,
18951,
18953,
18954,
19000,
19001,
19144,
19145,
19349,
19350,
19368,
19369,
19510,
19527,
19528,
19633,
19634,
19787,
19788,
19919,
19920,
19968,
20018,
20067,
20114,
20155,
20194,
20238,
20278,
20322,
20365,
20414,
20469,
20518,
20556,
20606,
20652,
20705,
20746,
20804,
20851,
20903,
20955,
21002,
21003,
21100,
21101,
21235,
21236,
21238,
21239,
21295,
21296,
21396,
21397,
21483,
21484,
21526,
21527,
21529,
21574,
21615,
21657,
21717,
21766,
21794,
21818,
21869,
21872,
21873,
21878,
21879,
22001,
22002,
22023,
22024,
22033,
22034,
22056,
22094,
22548,
22549,
22551,
22552,
22609,
22610,
22685,
22686,
22724,
22725,
22743,
22744,
22822,
22823,
22848,
22849,
22855,
22856,
22895,
22896,
23709,
23900,
24110,
24319,
24528,
24737,
24946,
25155,
25364,
25573,
25782,
25783,
25888,
25889,
26005,
26006,
26008,
26009,
26021,
26022,
26283,
26284,
26417,
26418,
26435
],
"line_end_idx": [
47,
48,
59,
83,
1595,
1596,
1638,
1639,
1665,
1681,
1712,
1727,
1768,
1786,
1787,
1804,
1805,
1952,
1953,
2109,
2183,
2223,
2294,
2375,
2442,
2470,
2471,
2594,
2595,
2597,
2598,
2616,
2617,
2619,
2620,
2649,
2650,
2836,
2837,
2851,
2852,
2991,
2992,
3159,
3160,
3272,
3273,
3363,
3364,
3366,
3367,
3376,
3377,
3532,
3533,
3564,
3565,
3682,
3683,
3767,
3768,
3844,
3845,
3980,
3981,
4186,
4187,
4275,
4276,
4315,
4316,
4318,
4319,
4338,
4339,
4374,
4375,
4431,
4432,
4478,
4574,
4630,
4686,
4743,
4744,
4847,
4848,
4870,
4975,
5088,
5208,
5209,
5551,
5552,
5600,
5621,
5701,
5702,
5858,
5859,
6092,
6093,
6164,
6165,
6295,
6296,
6300,
6458,
6459,
6498,
6499,
6686,
6687,
6689,
6690,
6708,
6709,
6805,
6806,
6818,
6819,
6821,
6822,
6871,
6872,
6970,
6971,
7074,
7075,
7080,
7081,
7165,
7166,
7187,
7188,
7197,
7198,
7220,
7251,
7705,
7706,
7708,
7709,
7759,
7760,
7812,
7813,
7851,
7852,
7870,
7871,
7917,
7918,
7924,
7925,
7932,
7933,
8026,
8116,
8165,
8167,
8264,
8277,
8283,
8328,
8369,
8454,
8500,
8546,
8553,
8559,
8604,
8645,
8703,
8749,
8795,
8802,
8808,
8853,
8894,
8979,
9025,
9071,
9078,
9084,
9129,
9170,
9260,
9306,
9352,
9359,
9360,
9435,
9436,
9442,
9487,
9528,
9588,
9634,
9687,
9694,
9700,
9745,
9786,
9841,
9887,
9933,
9940,
9946,
9991,
10032,
10086,
10132,
10178,
10184,
10188,
10190,
10191,
10242,
10243,
10245,
10246,
10280,
10281,
10377,
10378,
10533,
10534,
10631,
10632,
10638,
10639,
10864,
10865,
10867,
10868,
10918,
10919,
11024,
11025,
11181,
11182,
11280,
11281,
11378,
11379,
11503,
11504,
11584,
11585,
11591,
11636,
11677,
11733,
11779,
11825,
11832,
11833,
11835,
11836,
11891,
11892,
12034,
12035,
12040,
12041,
12199,
12200,
12221,
12222,
12231,
12232,
12254,
12285,
12739,
12740,
12742,
12743,
12799,
12800,
12867,
12868,
12906,
12907,
12925,
12926,
12972,
12973,
12979,
12980,
12987,
12988,
13045,
13120,
13121,
13166,
13167,
13169,
13275,
13288,
13294,
13343,
13388,
13434,
13500,
13553,
13582,
13610,
13665,
13672,
13678,
13727,
13772,
13818,
13882,
13935,
13967,
13995,
14050,
14057,
14063,
14112,
14157,
14203,
14268,
14321,
14353,
14381,
14436,
14443,
14444,
14530,
14531,
14537,
14586,
14631,
14677,
14741,
14794,
14825,
14853,
14908,
14915,
14921,
14970,
15015,
15061,
15128,
15181,
15210,
15238,
15293,
15300,
15306,
15355,
15400,
15446,
15511,
15564,
15592,
15620,
15675,
15681,
15686,
15921,
15923,
15924,
16015,
16016,
16018,
16019,
16066,
16067,
16234,
16235,
16678,
16679,
16838,
16839,
16845,
16846,
17138,
17393,
17394,
17579,
17580,
17629,
17676,
17724,
17774,
17820,
17868,
17917,
17964,
18005,
18044,
18088,
18128,
18172,
18215,
18264,
18319,
18368,
18406,
18456,
18502,
18555,
18596,
18654,
18701,
18753,
18805,
18852,
18853,
18950,
18951,
18953,
18954,
19000,
19001,
19144,
19145,
19349,
19350,
19368,
19369,
19510,
19527,
19528,
19633,
19634,
19787,
19788,
19919,
19920,
19968,
20018,
20067,
20114,
20155,
20194,
20238,
20278,
20322,
20365,
20414,
20469,
20518,
20556,
20606,
20652,
20705,
20746,
20804,
20851,
20903,
20955,
21002,
21003,
21100,
21101,
21235,
21236,
21238,
21239,
21295,
21296,
21396,
21397,
21483,
21484,
21526,
21527,
21529,
21574,
21615,
21657,
21717,
21766,
21794,
21818,
21869,
21872,
21873,
21878,
21879,
22001,
22002,
22023,
22024,
22033,
22034,
22056,
22094,
22548,
22549,
22551,
22552,
22609,
22610,
22685,
22686,
22724,
22725,
22743,
22744,
22822,
22823,
22848,
22849,
22855,
22856,
22895,
22896,
23709,
23900,
24110,
24319,
24528,
24737,
24946,
25155,
25364,
25573,
25782,
25783,
25888,
25889,
26005,
26006,
26008,
26009,
26021,
26022,
26283,
26284,
26417,
26418,
26435,
26453
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 26453,
"ccnet_original_nlines": 539,
"rps_doc_curly_bracket": 0.001285300008021295,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.16625960171222687,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.06786461919546127,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.45568737387657166,
"rps_doc_frac_unique_words": 0.26215478777885437,
"rps_doc_mean_word_length": 7.721898078918457,
"rps_doc_num_sentences": 353,
"rps_doc_symbol_to_word_ratio": 0.0012212099973112345,
"rps_doc_unigram_entropy": 5.663559436798096,
"rps_doc_word_count": 2571,
"rps_doc_frac_chars_dupe_10grams": 0.20334458351135254,
"rps_doc_frac_chars_dupe_5grams": 0.3716818690299988,
"rps_doc_frac_chars_dupe_6grams": 0.29642874002456665,
"rps_doc_frac_chars_dupe_7grams": 0.28277841210365295,
"rps_doc_frac_chars_dupe_8grams": 0.268120676279068,
"rps_doc_frac_chars_dupe_9grams": 0.2302926480770111,
"rps_doc_frac_chars_top_2gram": 0.009167379699647427,
"rps_doc_frac_chars_top_3gram": 0.014355509541928768,
"rps_doc_frac_chars_top_4gram": 0.009167379699647427,
"rps_doc_books_importance": -2785.86767578125,
"rps_doc_books_importance_length_correction": -2785.86767578125,
"rps_doc_openwebtext_importance": -1594.0941162109375,
"rps_doc_openwebtext_importance_length_correction": -1594.0941162109375,
"rps_doc_wikipedia_importance": -1288.911865234375,
"rps_doc_wikipedia_importance_length_correction": -1288.911865234375
},
"fasttext": {
"dclm": 0.024784859269857407,
"english": 0.6659855246543884,
"fineweb_edu_approx": 1.9241695404052734,
"eai_general_math": 0.10105293989181519,
"eai_open_web_math": 0.23446261882781982,
"eai_web_code": 0.619466245174408
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "332.0285",
"labels": {
"level_1": "Social sciences",
"level_2": "Economics",
"level_3": "Finance"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
2,073,995,443,074,411,300 |
0
Существует основная таблица, которая должна формировать список: Основная форма
При нажатии кнопки "Выбрать из типовых" открывается заполненная таблица.
Форма с типовыми объектами
Как обратиться из дочерней формы к родительской, что бы при двойном клике по строке, выбранная строка копировалась в основную таблицу?
Диалог подтверждения копирования
Код первой формы:
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void opensziform_Click(object sender, EventArgs e)
{
SZIForm sziForm = new SZIForm(this);
sziForm.ShowDialog();
}
Код второй формы:
namespace WindowsFormsApp1
{
public partial class SZIForm : Form
{
public SZIForm(Form1 ParrentForm)
{
InitializeComponent();
}
private void SZIForm_Load(object sender, EventArgs e)
{
}
private void dataGridTypeSZI_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
int index = dataGridTypeSZI.CurrentCell.RowIndex;
dataGridTypeSZI.Rows[index].Selected = true;
DialogResult dialogres = MessageBox.Show("Копирнуть??",
"Подтверждение",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
if (dialogres == DialogResult.Yes)
{
//Скопировать выбранную строку в основную таблицу
}
}
}
}
• В конструкторе второй формы вы получаете ссылку на родительскую: SZIForm(Form1 ParrentForm). Сохраните её в поле и далее через неё получайте доступ. / Вместо ссылки на форму можно передавать ссылку на датагрид или источник данных... – Alexander Petrov 11 ноя '19 в 14:27
• А как вы заполняете данными DGV? Лучше всего использовать в качестве источника данных BindingSource у него есть свойство Current и тогда легко скопировать Current из одного BindingSource в другой. – Bulson 11 ноя '19 в 14:35
0
Вот тут толпа способов передачи данных между формами: http://www.cyberforum.ru/windows-forms/thread110436.html
Можно передать ссылку на родителя в конструкторе(что вы кстати делаете, но не пользуетесь: public SZIForm(Form1 ParrentForm)), можно передать ссылку на родительский датагрид(сделав его пабликом), можно воспользоваться owner, в конце концов можно даже из родительской формы подписаться на событие двойного клика по дочернему датагриду(только не забыть отписаться если дочерняя закрывается).
Но лучше я(ибо всё и начинается с "как мне изменить текстбокс с другой формы", а потом...), расскажу страшный секретный способ(которого там вроде нет) для любой передачи чего угодно между чем угодно, куда угодно и откуда угодно :D. Создать (там откуда надо что-либо получать) своё событие, например:
public class MyEventArgs : EventArgs
{
//аргументы для передачи
public object Value { get; set; }
public Exception Ex { get; set; }
public MyEventArgs(object value, Exception ex) { Value = value; Ex = ex; }
}
public delegate void MyEventHandler(object sender, MyEventArgs e);
public event MyEventHandler MyEvent;
private void myEvent(MyEventArgs e) { MyEvent?.Invoke(this, e); }
И потом, когда захотим, оповестить всех желающих, вызвать из метода:
myEvent(new MyEventArgs("тут что-нибудь", null));
Добавлять/убирать желающих(внутри этих желающих) примерно так:
[ссылка на генератора события].MyEvent += [обработчик события];
[ссылка на генератора события].MyEvent -= [обработчик события];
Убирать событие перед уничтожением отслеживаемого объекта обязательно. Естественно нужно знать ссылку того объекта, на который мы хотим подписаться (для нестатических она берется в момент "= new "). Если ещё и потоки разные, то желающий будет выглядеть как-то так:
public partial class Form1 : Form
{
private MyClass myClass = new MyClass();
public Form1()
{
InitializeComponent();
myClass.MyEvent += eventHandler;
}
private delegate void MyDelegate(MyClass.MyEventArgs e);
private void eventHandler(object sender, MyClass.MyEventArgs e)
{
if (e != null) { if (InvokeRequired) { Invoke(new MyDelegate(currentEventHandler), e); } else { currentEventHandler(e); } }
}
private void currentEventHandler(MyClass.MyEventArgs e)
{
// тут делай что хочешь
if (e.Ex != null) MessageBox.Show(e.Ex.Message); return;
string str = (string)e.Value;
}
}
Ваш ответ
Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими пользовательским соглашением, политикой конфиденциальности и политикой о куки
Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.
|
{
"url": "https://ru.stackoverflow.com/questions/1044856/%D0%9A%D0%B0%D0%BA-%D1%81%D0%BA%D0%BE%D0%BF%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C-%D0%B2%D1%8B%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D1%83%D1%8E-%D1%81%D1%82%D1%80%D0%BE%D0%BA%D1%83-%D0%BE%D0%B4%D0%BD%D0%BE%D0%B3%D0%BE-datagridview-%D0%BE%D0%B4%D0%BD%D0%BE%D0%B9-%D1%84%D0%BE%D1%80%D0%BC%D1%8B-%D0%B2-%D0%B4%D1%80%D1%83%D0%B3%D0%BE%D0%B9-datag",
"source_domain": "ru.stackoverflow.com",
"snapshot_id": "crawl=CC-MAIN-2021-04",
"warc_metadata": {
"Content-Length": "164168",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:MXZMT6CMU63HKNJYE6IJGSK3AULQVVFN",
"WARC-Concurrent-To": "<urn:uuid:f94e3207-b421-4048-afaf-c171b404f33d>",
"WARC-Date": "2021-01-27T01:56:06Z",
"WARC-IP-Address": "151.101.65.69",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:BNCR3NKAUZYKS27HKZS35PAAKLCVZY5J",
"WARC-Record-ID": "<urn:uuid:5bba5140-7b0a-4ca8-8b7c-7bc7aac7adfa>",
"WARC-Target-URI": "https://ru.stackoverflow.com/questions/1044856/%D0%9A%D0%B0%D0%BA-%D1%81%D0%BA%D0%BE%D0%BF%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C-%D0%B2%D1%8B%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D1%83%D1%8E-%D1%81%D1%82%D1%80%D0%BE%D0%BA%D1%83-%D0%BE%D0%B4%D0%BD%D0%BE%D0%B3%D0%BE-datagridview-%D0%BE%D0%B4%D0%BD%D0%BE%D0%B9-%D1%84%D0%BE%D1%80%D0%BC%D1%8B-%D0%B2-%D0%B4%D1%80%D1%83%D0%B3%D0%BE%D0%B9-datag",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:fd00d864-667c-4dd2-9056-d8199cb595a2>"
},
"warc_info": "isPartOf: CC-MAIN-2021-04\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for January 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-33.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
2,
3,
82,
83,
156,
157,
184,
185,
320,
321,
354,
355,
373,
374,
405,
407,
445,
451,
474,
484,
519,
529,
589,
599,
609,
676,
686,
735,
769,
779,
780,
798,
799,
826,
828,
868,
874,
916,
926,
961,
962,
972,
1034,
1044,
1045,
1055,
1056,
1057,
1058,
1165,
1175,
1237,
1294,
1362,
1415,
1476,
1540,
1610,
1657,
1671,
1737,
1751,
1761,
1762,
1768,
1770,
2045,
2274,
2276,
2277,
2388,
2389,
2779,
2780,
3080,
3081,
3122,
3128,
3153,
3195,
3237,
3320,
3326,
3397,
3438,
3508,
3509,
3579,
3580,
3630,
3631,
3694,
3695,
3759,
3823,
3824,
4089,
4090,
4124,
4130,
4179,
4202,
4212,
4247,
4292,
4302,
4303,
4368,
4440,
4450,
4586,
4596,
4660,
4670,
4706,
4775,
4817,
4827,
4833,
4834,
4844,
4845,
4985,
4986
],
"line_end_idx": [
2,
3,
82,
83,
156,
157,
184,
185,
320,
321,
354,
355,
373,
374,
405,
407,
445,
451,
474,
484,
519,
529,
589,
599,
609,
676,
686,
735,
769,
779,
780,
798,
799,
826,
828,
868,
874,
916,
926,
961,
962,
972,
1034,
1044,
1045,
1055,
1056,
1057,
1058,
1165,
1175,
1237,
1294,
1362,
1415,
1476,
1540,
1610,
1657,
1671,
1737,
1751,
1761,
1762,
1768,
1770,
2045,
2274,
2276,
2277,
2388,
2389,
2779,
2780,
3080,
3081,
3122,
3128,
3153,
3195,
3237,
3320,
3326,
3397,
3438,
3508,
3509,
3579,
3580,
3630,
3631,
3694,
3695,
3759,
3823,
3824,
4089,
4090,
4124,
4130,
4179,
4202,
4212,
4247,
4292,
4302,
4303,
4368,
4440,
4450,
4586,
4596,
4660,
4670,
4706,
4775,
4817,
4827,
4833,
4834,
4844,
4845,
4985,
4986,
5067
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 5067,
"ccnet_original_nlines": 124,
"rps_doc_curly_bracket": 0.008683639578521252,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.041514039039611816,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.0061050099320709705,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.7277167439460754,
"rps_doc_frac_unique_words": 0.6095617413520813,
"rps_doc_mean_word_length": 7.001992225646973,
"rps_doc_num_sentences": 42,
"rps_doc_symbol_to_word_ratio": 0.0024419999681413174,
"rps_doc_unigram_entropy": 5.452085494995117,
"rps_doc_word_count": 502,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.08079659193754196,
"rps_doc_frac_chars_dupe_6grams": 0.05519203096628189,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.02190612070262432,
"rps_doc_frac_chars_top_3gram": 0.015362730249762535,
"rps_doc_frac_chars_top_4gram": 0.02048363909125328,
"rps_doc_books_importance": -389.0672912597656,
"rps_doc_books_importance_length_correction": -389.0672912597656,
"rps_doc_openwebtext_importance": -200.5107421875,
"rps_doc_openwebtext_importance_length_correction": -200.5107421875,
"rps_doc_wikipedia_importance": -91.86309051513672,
"rps_doc_wikipedia_importance_length_correction": -91.86309051513672
},
"fasttext": {
"dclm": 0.9310449361801147,
"english": 0.000871579977683723,
"fineweb_edu_approx": 2.5764074325561523,
"eai_general_math": 0.00013661000411957502,
"eai_open_web_math": 0.09646719694137573,
"eai_web_code": 0.49296897649765015
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.133",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "2",
"label": "Click Here References"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
9,085,730,221,307,377,000 |
Re: [gitg] limit the number of revisions
Hi Jan,
gitg actually passes unrecognized command line arguments to git log. You can separate those arguments from the normal gitg cmd arguments by specifying them after a double dash (--) as is customary for gnu command line options, so you can just do the following to load only 10 commits:
gitg -- -10
Cheers
2012/8/2 Jan Pohanka <pohanka jablocom com>
Hello,
does there exist any command line switch, which can limit the number of loaded revisions? For larger projects (eg. linux kernel) gitg start takes really long (~10s). Gitk has the switch -n that can do this.
regards
Jan
(please cc me if you respond, I'm not on the list)
_______________________________________________
gitg-list mailing list
gitg-list gnome org
https://mail.gnome.org/mailman/listinfo/gitg-list
[Date Prev][Date Next] [Thread Prev][Thread Next] [Thread Index] [Date Index] [Author Index]
|
{
"url": "https://mail.gnome.org/archives/gitg-list/2012-August/msg00002.html",
"source_domain": "mail.gnome.org",
"snapshot_id": "crawl=CC-MAIN-2022-21",
"warc_metadata": {
"Content-Length": "12879",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:7XQWKMGMR7BZPG4LQULQ54DD72ZMGB2Q",
"WARC-Concurrent-To": "<urn:uuid:a7721574-40cd-4323-bfc3-119dd9a96966>",
"WARC-Date": "2022-05-19T20:53:54Z",
"WARC-IP-Address": "8.43.85.24",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:JHIQIMWAKVNFYNELVAONOICGGIAO24AM",
"WARC-Record-ID": "<urn:uuid:edb11437-4068-43fa-bf2e-7f546ede7bce>",
"WARC-Target-URI": "https://mail.gnome.org/archives/gitg-list/2012-August/msg00002.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:b8f6024c-3952-4f3f-9e11-b11a22900925>"
},
"warc_info": "isPartOf: CC-MAIN-2022-21\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-243\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
2,
3,
44,
45,
46,
47,
55,
56,
341,
342,
354,
355,
356,
363,
364,
408,
415,
622,
623,
631,
635,
636,
687,
688,
689,
737,
760,
780,
830,
831,
832,
833,
834
],
"line_end_idx": [
2,
3,
44,
45,
46,
47,
55,
56,
341,
342,
354,
355,
356,
363,
364,
408,
415,
622,
623,
631,
635,
636,
687,
688,
689,
737,
760,
780,
830,
831,
832,
833,
834,
930
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 930,
"ccnet_original_nlines": 33,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.25628140568733215,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.005025130230933428,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.2763819098472595,
"rps_doc_frac_unique_words": 0.7111111283302307,
"rps_doc_mean_word_length": 4.918518543243408,
"rps_doc_num_sentences": 8,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.424442291259766,
"rps_doc_word_count": 135,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0,
"rps_doc_frac_chars_dupe_6grams": 0,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.04969879984855652,
"rps_doc_frac_chars_top_3gram": 0.042168669402599335,
"rps_doc_frac_chars_top_4gram": 0.048192769289016724,
"rps_doc_books_importance": -85.20903778076172,
"rps_doc_books_importance_length_correction": -85.20903778076172,
"rps_doc_openwebtext_importance": -51.70134735107422,
"rps_doc_openwebtext_importance_length_correction": -39.90296936035156,
"rps_doc_wikipedia_importance": -35.093204498291016,
"rps_doc_wikipedia_importance_length_correction": -35.093204498291016
},
"fasttext": {
"dclm": 0.5250095129013062,
"english": 0.6636925339698792,
"fineweb_edu_approx": 1.3992842435836792,
"eai_general_math": 0.4152291417121887,
"eai_open_web_math": 0.6948104500770569,
"eai_web_code": 0.002063390100374818
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.445",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "21",
"label": "Customer Support"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,135,344,651,667,464,000 |
Ask Your Question
0
Can I display a list of equations aligned like latex eqnarray?
asked 2012-12-03 09:30:07 -0500
PatrickSurry gravatar image
I have several sage equations stored in a python list (for use in solve() etc). I'd like to display them one per line, aligned on equal signs if possible. This is in the notebook.
Most things I've tried - view(), show(), pretty_print() just print something that looks like a python list of formatted equations, all on one line (although the documentation for view() claims it will print each element of a list on a separate line, that doesn't seem to be the case).
The only things I've come up with are to explicitly loop, like: for eqn in eqns: view(eqn) or to pass eqns to html.table() which does one per line with alternating line shading.
edit retag flag offensive close merge delete
2 answers
Sort by » oldest newest most voted
1
answered 2012-12-03 21:32:43 -0500
ndomes gravatar image
updated 2012-12-04 05:22:47 -0500
You can use html.table placing left hand side, equal sign and right hand side in separate columns.
var('x y z alpha')
eqns = [x == y^2, z+alpha^3 == 0]
table = [ (eq.lhs(),'=',eq.rhs()) for eq in eqns ]
html.table(table)
edit flag offensive delete link more
Comments
That's a good idea. If you add a %html cell you can improve the styling: avoid the alternating grey rows, tighten up the spacing, and right-align the leftmost column. I used this: %html <style> table.table_form * tr.row-a { background: #ffffff; } table.table_form * tr.row-b { background: #ffffff; } table.table_form * td { padding-top: 5px; padding-bottom: 5px; padding-left: 2px; padding-right: 2px; } table.table_form tr td:first-child { text-align: right; } </style>
PatrickSurry gravatar imagePatrickSurry ( 2012-12-03 23:50:28 -0500 )edit
You don't need a %html cell, I tried: html(""" <style> .row-a td:first-child {text-align:right;} .row-b td:first-child {text-align:right;} </style> """) inside a sage cell and it worked well.
ndomes gravatar imagendomes ( 2012-12-04 05:21:25 -0500 )edit
Makes sense. Tho I've started doing all my text as %html so I can use the <sage> tags and avoid the pre-formatted (fixed width) text I seem to get with html()
PatrickSurry gravatar imagePatrickSurry ( 2012-12-04 15:46:22 -0500 )edit
0
answered 2012-12-03 14:28:41 -0500
This doesn't look too bad:
sage: var('x y z alpha')
sage: L = [x == y^2, z+alpha^3 == 0]
view(L, viewer='pdf')
Alignment on equals signs is trickier, but the following works in the notebook. With L as above, create a cell containing this:
%latex
Here are the equations:
\begin{align*}
\sage{L[0].left_hand_side()} &= \sage{L[0].right_hand_side()} \\
\sage{L[1].left_hand_side()} &= \sage{L[1].right_hand_side()}
\end{align*}
There is probably a way to autogenerate this code in the notebook.
The patch at http://trac.sagemath.org/sage_trac/ti... might also help.
edit flag offensive delete link more
Your Answer
Please start posting anonymously - your entry will be published after you log in or create a new account.
Add Answer
Question Tools
Stats
Asked: 2012-12-03 09:30:07 -0500
Seen: 1,589 times
Last updated: Dec 04 '12
|
{
"url": "https://ask.sagemath.org/question/9603/can-i-display-a-list-of-equations-aligned-like-latex-eqnarray/",
"source_domain": "ask.sagemath.org",
"snapshot_id": "crawl=CC-MAIN-2019-30",
"warc_metadata": {
"Content-Length": "66549",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:G6K7U23F7DOR5DNCMI7X3OBIRR4RL26I",
"WARC-Concurrent-To": "<urn:uuid:951bb9db-4e16-45d7-b785-5ab9e1df2a99>",
"WARC-Date": "2019-07-21T15:28:42Z",
"WARC-IP-Address": "140.254.118.68",
"WARC-Identified-Payload-Type": "application/xhtml+xml",
"WARC-Payload-Digest": "sha1:L72H5LCZEYQAPKVBJTFQ5XKVNC5TGAYR",
"WARC-Record-ID": "<urn:uuid:3d7f4227-c02a-4f07-b317-8b55cb84fa7f>",
"WARC-Target-URI": "https://ask.sagemath.org/question/9603/can-i-display-a-list-of-equations-aligned-like-latex-eqnarray/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:5799ab7c-c6cb-4da7-ad18-6de73eb99a6d>"
},
"warc_info": "isPartOf: CC-MAIN-2019-30\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for July 2019\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-143-3-249.ec2.internal\r\nsoftware: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
18,
20,
21,
84,
85,
117,
118,
146,
147,
327,
328,
613,
614,
792,
793,
838,
839,
849,
850,
885,
887,
888,
923,
924,
946,
947,
981,
982,
1081,
1082,
1101,
1135,
1186,
1204,
1241,
1242,
1251,
1252,
1723,
1724,
1798,
1799,
1991,
1992,
2054,
2055,
2214,
2215,
2289,
2291,
2292,
2327,
2328,
2355,
2356,
2381,
2418,
2440,
2441,
2569,
2570,
2577,
2601,
2616,
2681,
2743,
2756,
2757,
2824,
2825,
2896,
2897,
2934,
2935,
2947,
2948,
3054,
3055,
3066,
3067,
3082,
3083,
3089,
3090,
3123,
3124,
3142,
3143
],
"line_end_idx": [
18,
20,
21,
84,
85,
117,
118,
146,
147,
327,
328,
613,
614,
792,
793,
838,
839,
849,
850,
885,
887,
888,
923,
924,
946,
947,
981,
982,
1081,
1082,
1101,
1135,
1186,
1204,
1241,
1242,
1251,
1252,
1723,
1724,
1798,
1799,
1991,
1992,
2054,
2055,
2214,
2215,
2289,
2291,
2292,
2327,
2328,
2355,
2356,
2381,
2418,
2440,
2441,
2569,
2570,
2577,
2601,
2616,
2681,
2743,
2756,
2757,
2824,
2825,
2896,
2897,
2934,
2935,
2947,
2948,
3054,
3055,
3066,
3067,
3082,
3083,
3089,
3090,
3123,
3124,
3142,
3143,
3167
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3167,
"ccnet_original_nlines": 88,
"rps_doc_curly_bracket": 0.007578149903565645,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.21411192417144775,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.020681269466876984,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.4075425863265991,
"rps_doc_frac_unique_words": 0.5448577404022217,
"rps_doc_mean_word_length": 5.0568928718566895,
"rps_doc_num_sentences": 36,
"rps_doc_symbol_to_word_ratio": 0.0036496398970484734,
"rps_doc_unigram_entropy": 5.257408618927002,
"rps_doc_word_count": 457,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.026828210800886154,
"rps_doc_frac_chars_dupe_6grams": 0.026828210800886154,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.025962790474295616,
"rps_doc_frac_chars_top_3gram": 0.01687581092119217,
"rps_doc_frac_chars_top_4gram": 0.01990479975938797,
"rps_doc_books_importance": -312.97967529296875,
"rps_doc_books_importance_length_correction": -312.97967529296875,
"rps_doc_openwebtext_importance": -186.59060668945312,
"rps_doc_openwebtext_importance_length_correction": -186.59060668945312,
"rps_doc_wikipedia_importance": -128.85740661621094,
"rps_doc_wikipedia_importance_length_correction": -128.85740661621094
},
"fasttext": {
"dclm": 0.27483755350112915,
"english": 0.7469438910484314,
"fineweb_edu_approx": 1.648625135421753,
"eai_general_math": 0.42411303520202637,
"eai_open_web_math": 0.3085854649543762,
"eai_web_code": 0.12553739547729492
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "510",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
121,067,120,279,081,070 |
Clear Filters
Clear Filters
for loop won't stop using break
1 view (last 30 days)
Yanxin Liu
Yanxin Liu on 4 Feb 2021
Commented: Yanxin Liu on 9 May 2021
I'm using ARMA to simulate and predict a series of data. "i" represens the number of pre-sample for ARMA estimate and "j" represents the number of estimation sample for ARMA estimate.
The absolute percentage errors (APE) are calculated for different numbers of pre-sample and estimate sample data.
I want to stop the loop when the APE is small than 0.05. I used break function, but it won't stop until it finishes all the loops (till i=60, j=60)
Mdl = arima(1,0,0);
APE = zeros(60,108);
for i = 12:60
for j = i:120-i
EstMdl = estimate(Mdl,Y_out((i+1):(i+j)),'Y0',Y_out(1:i));
gasforecast = forecast(EstMdl,180-i-j,'Y0',Y_out((i+1):(i+j)));
APE(i,j) = abs(gasforecast(end)-Y_out(end))/Y_out(end);
if APE(i,j) < 0.05
break;
end
end
end
Answers (1)
Walter Roberson
Walter Roberson on 4 Feb 2021
Mdl = arima(1,0,0);
APE = zeros(60,108);
stopping = false;
for i = 12:60
for j = i:120-i
EstMdl = estimate(Mdl,Y_out((i+1):(i+j)),'Y0',Y_out(1:i));
gasforecast = forecast(EstMdl,180-i-j,'Y0',Y_out((i+1):(i+j)));
APE(i,j) = abs(gasforecast(end)-Y_out(end))/Y_out(end);
if APE(i,j) < 0.05
stopping = true;
break;
end
end
if stopping; break; end
end
1 Comment
Yanxin Liu
Yanxin Liu on 9 May 2021
I got it. Since I have an outter loop, the 'break' only stops the execution of the inner loop. Thank you so much.
Sign in to comment.
Categories
Find more on Conditional Mean Models in Help Center and File Exchange
Tags
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
|
{
"url": "https://nl.mathworks.com/matlabcentral/answers/736652-for-loop-won-t-stop-using-break?s_tid=prof_contriblnk",
"source_domain": "nl.mathworks.com",
"snapshot_id": "CC-MAIN-2024-22",
"warc_metadata": {
"Content-Length": "116448",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:PEBNSVIBJNJN75RE47ZHF3ZKETYXAAU3",
"WARC-Concurrent-To": "<urn:uuid:3a9d9b94-9614-4173-a192-7df3508c4ce8>",
"WARC-Date": "2024-05-26T05:16:19Z",
"WARC-IP-Address": "23.34.160.82",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:DQSMMMSO3ZROPWWW3WZUFBLFHKDL434W",
"WARC-Record-ID": "<urn:uuid:ba5ebacf-b939-4921-9aec-d37a0bbebaa8>",
"WARC-Target-URI": "https://nl.mathworks.com/matlabcentral/answers/736652-for-loop-won-t-stop-using-break?s_tid=prof_contriblnk",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:a62ad206-55f9-425c-a3cb-9d8a5499d164>"
},
"warc_info": "isPartOf: CC-MAIN-2024-22\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2024\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-123\r\nsoftware: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
14,
28,
29,
61,
62,
84,
95,
120,
156,
340,
454,
602,
622,
643,
657,
673,
732,
796,
852,
871,
878,
882,
886,
890,
891,
903,
904,
920,
950,
970,
991,
1009,
1023,
1039,
1098,
1162,
1218,
1237,
1254,
1261,
1265,
1269,
1293,
1297,
1309,
1320,
1345,
1459,
1460,
1480,
1481,
1492,
1493,
1563,
1564,
1569,
1570,
1579,
1580,
1604,
1605,
1687,
1688
],
"line_end_idx": [
14,
28,
29,
61,
62,
84,
95,
120,
156,
340,
454,
602,
622,
643,
657,
673,
732,
796,
852,
871,
878,
882,
886,
890,
891,
903,
904,
920,
950,
970,
991,
1009,
1023,
1039,
1098,
1162,
1218,
1237,
1254,
1261,
1265,
1269,
1293,
1297,
1309,
1320,
1345,
1459,
1460,
1480,
1481,
1492,
1493,
1563,
1564,
1569,
1570,
1579,
1580,
1604,
1605,
1687,
1688,
1702
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 1702,
"ccnet_original_nlines": 63,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.23541666567325592,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.04374999925494194,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.40833333134651184,
"rps_doc_frac_unique_words": 0.5165289044380188,
"rps_doc_mean_word_length": 5.045454502105713,
"rps_doc_num_sentences": 13,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.580346584320068,
"rps_doc_word_count": 242,
"rps_doc_frac_chars_dupe_10grams": 0.22276821732521057,
"rps_doc_frac_chars_dupe_5grams": 0.27764126658439636,
"rps_doc_frac_chars_dupe_6grams": 0.2538902461528778,
"rps_doc_frac_chars_dupe_7grams": 0.22276821732521057,
"rps_doc_frac_chars_dupe_8grams": 0.22276821732521057,
"rps_doc_frac_chars_dupe_9grams": 0.22276821732521057,
"rps_doc_frac_chars_top_2gram": 0.03685503825545311,
"rps_doc_frac_chars_top_3gram": 0.027027029544115067,
"rps_doc_frac_chars_top_4gram": 0.029484029859304428,
"rps_doc_books_importance": -250.4524688720703,
"rps_doc_books_importance_length_correction": -238.48565673828125,
"rps_doc_openwebtext_importance": -144.44882202148438,
"rps_doc_openwebtext_importance_length_correction": -144.44882202148438,
"rps_doc_wikipedia_importance": -117.11238861083984,
"rps_doc_wikipedia_importance_length_correction": -108.04334259033203
},
"fasttext": {
"dclm": 0.5141128301620483,
"english": 0.7338913679122925,
"fineweb_edu_approx": 2.1548564434051514,
"eai_general_math": 0.8744427561759949,
"eai_open_web_math": 0.3527154326438904,
"eai_web_code": 0.10560966283082962
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "519.5",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Probabilities; or, Mathematical statistics"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "18",
"label": "Q&A Forum"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
4,648,409,088,901,784,000 |
Scripting
Since 2.2.0
Gaia Sky provides a scripting API that can be accessed via Python scripts. These scripts must be run with the system Python interpreter. They connect to a gateway service offered by a running instance of Gaia Sky.
Quick start
If you just need some examples to get started, look up the test and showcase scripts in scripts folder of the project.
Requirements
In order to connect to the gateway server, you need a Python 3.5+ interpreter and the Py4J package. You can install it with pip as a user package like this:
$ pip install --user py4j
You may also use your distribution or operating system package manager to install Py4J. Please, refer to your distribution or operating system documentation for more information. Find more information on the library at the Py4J homepage.
Running a test script
Then, launch Gaia Sky, download this script, open a terminal window (PowerShell in Windows) and run:
$ python asteroids-tour.py
The directory from which you run the script does not matter. If all goes well Gaia Sky should be showing a nice tour of the asteroids in the DR2 catalog.
_images/yt-asteroids.jpg
This script should produce results similar to this video
Have a look at the script. All lines which start with gs. are API calls which call methods in the Gaia Sky gateway server. What are API calls, you ask? See next section.
The scripting API
The scripting API is a set of methods which may be called from Python scripts to interact with Gaia Sky. The available methods differ depending on the version of Gaia Sky.
Writing scripts for Gaia Sky
Gaia Sky uses the single-threaded model of Py4J. In order to connect to Gaia Sky from Python, import ClientServer and JavaParameters, and then create a gateway and get its entry point. The entry point is the object you can use to call API methods on. Since Gaia Sky uses a server per script, the gateway must be shut down at the end of the script so that the Python program can terminate correctly and Gaia Sky can create a new server to deal with further scripts listening to the Py4J port.
from py4j.clientserver import ClientServer, JavaParameters
gateway = ClientServer(java_parameters=JavaParameters(auto_convert=True))
gs = gateway.entry_point
# User code goes here
[...]
gateway.shutdown()
The JavaParameters(auto_convert=True) is not strictly necessary, but if you don’t use it you need to convert Python lists to Java arrays yourself before calling the API.
Now, we can start calling API methods on the object gs.
# Disable input
gs.disableInput()
gs.cameraStop()
gs.minimizeInterfaceWindow()
# Welcome
gs.setHeadlineMessage("Welcome to the Gaia Sky")
gs.setSubheadMessage("Explore Gaia, the Solar System and the whole Galaxy!")
[...]
Find lots of example scripts here.
Logging to Gaia Sky and Python
When printing messages, you can either log to Gaia Sky or print to the standard output of the terminal where Python runs:
gs.print("This goes to the Gaia Sky log")
print("This goes to the Python output")
In order to log messages to both outputs, you can define a function which takes a string and prints it out to both sides:
def pprint(text):
gs.print(text)
print(text)
pprint("Hey, this is printed in both Gaia Sky AND Python!")
Method and attribute access
Py4J allows accessing public class methods but not public attrbiutes. In case you get objects from Gaia Sky, you can’t directly call public attributes, but need to access them via public methods:
# Get the Mars model object
body = gs.getObject("Mars")
# Get spherical coordinates
radec = body.getPosSph()
# DO NOT do this, it crashes!
gs.print("RA/DEC: %f / %f" % (radec.x, radec.y))
# DO THIS instead
gs.print("RA/DEC: %f / %f" % (radec.x(), radec.y()))
Strict parameter types
Please, be strict with the parameter types. Use floats when the method signature has floats and integers when it has integers. The scripting interface still tries to perform conversions under the hood but it is better to do it right from the beginning. For example, for the API method:
double[] galacticToInternalCartesian(double l, double b, double r);
may not work if called like this from Python:
gs.galacticToInternalCartesian(10, 43.5, 2)
Note that the first and third parameters are integers rather than floating-point numbers. Call it like this instead:
gs.galacticToInternalCartesian(10.0, 43.5, 2.0)
Loading datasets from scripts
Gaia Sky supports data loading from scripts using the STIL data provider. It is really easy to load a VOTable file from a script:
from py4j.clientserver import ClientServer, JavaParameters
gateway = ClientServer(java_parameters=JavaParameters(auto_convert=True))
gs = gateway.entry_point
# Load dataset
gs.loadDataset("dataset-name", "/path/to/dataset.vot")
# Async insertion, let's make sure the data is available
gs.sleep(2)
# Now we can play around with it
gs.hideDataset("dataset-name")
# Show it again
gs.showDataset("dataset-name")
# Shutdown
gateway.shutdown()
Find an example of how to load a star catalog from a script here. This one showcases how to load a dataset with generic particles (only positions).
Synchronizing with the main loop
Sometimes, when updating animations or creating camera paths, it is necessary to sync the execution of scripts with the thread which runs the main loop (main thread). However, the scripting engine runs scripts in separate threads asynchronously, making it a non-obvious task to achieve this synchronization. In order to fix this, a new mechanism has been added in Gaia Sky 2.0.3. Now, runnables can be parked so that they run at the end of the update-render processing of each loop cycle. A runnable is a class which extends java.lang.Runnable, and implements a very simple public void run() method.
Runnables can be posted, meaning that they are run only once at the end fo the current cycle, or parked, meaning that they run until they stop or they are unparked. Parked runnables must provide a name identifier in order to be later accessed and unparked.
Let’s see an example of how to implement a frame counter in Python using py4j:
from py4j.clientserver import ClientServer, JavaParameters, PythonParameters
class FrameCounterRunnable(object):
def __init__(self):
self.n = 0
def run(self):
self.n = self.n + 1
if self.n % 30 == 0:
gs.print("Number of frames: %d" % self.n)
class Java:
implements = ["java.lang.Runnable"]
gateway = ClientServer(java_parameters=JavaParameters(auto_convert=True),
python_parameters=PythonParameters())
gs = gateway.entry_point
# We park a runnable which counts the frames and prints the current number
# of frames every 30 of them
gs.parkRunnable("frame_counter", FrameCounterRunnable())
gs.sleep(15.0)
# We unpark the frame counter
gs.unparkRunnable("frame_counter")
gateway.shutdown()
In this example, we park a runnable which counts frames for 15 seconds. Note that here we need to pass a PythonParameters instance to the ClientServer constructor.
A more useful example can be found here. In this one, a polyline is created between the Earth and the Moon. Then, a parked runnable is used to update the line points with the new postions of the bodies. Finally, time is started so that the bodies start moving and the line positions are updated correctly and in synch with the main thread.
More examples
As we said, you can find more examples in the scripts folder in the repository.
Running and debugging scripts
In order to run scripts, you need a Python interpreter with the python-py4j module installed in your system.
Load up Gaia Sky, open a new terminal window and run your script:
$ python script.py
Please, note that Gaia Sky needs to be running before the script is started for the connection to succeed.
To debug a script in the terminal using pudb run this:
$ python -m pudb script.py
|
{
"url": "https://gaia.ari.uni-heidelberg.de/gaiasky/docs/Scripting-with-python.html",
"source_domain": "gaia.ari.uni-heidelberg.de",
"snapshot_id": "crawl=CC-MAIN-2021-43",
"warc_metadata": {
"Content-Length": "74088",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:GYZ4EGF343DPBNPCCOUOIISVO3Y5WGGN",
"WARC-Concurrent-To": "<urn:uuid:7ac690e6-098b-477b-ad79-999bb60092af>",
"WARC-Date": "2021-10-23T16:27:35Z",
"WARC-IP-Address": "129.206.112.50",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:JAG5ULOH6ADCEMKPCBKPUCENZEHJO3RD",
"WARC-Record-ID": "<urn:uuid:2a5a8cfb-d7ec-47b2-9939-09865e3f29e3>",
"WARC-Target-URI": "https://gaia.ari.uni-heidelberg.de/gaiasky/docs/Scripting-with-python.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:4d4c9c94-ef1b-446b-84fd-e7b9946ab509>"
},
"warc_info": "isPartOf: CC-MAIN-2021-43\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for October 2021\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-40\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
10,
11,
23,
24,
238,
239,
251,
252,
371,
372,
385,
386,
543,
544,
571,
572,
810,
811,
833,
834,
935,
936,
964,
965,
1119,
1120,
1145,
1146,
1203,
1204,
1374,
1375,
1393,
1394,
1566,
1567,
1596,
1597,
2089,
2090,
2149,
2150,
2224,
2249,
2250,
2272,
2278,
2279,
2298,
2299,
2469,
2470,
2526,
2527,
2543,
2561,
2577,
2606,
2607,
2617,
2666,
2743,
2749,
2750,
2785,
2786,
2817,
2818,
2940,
2941,
2983,
3023,
3024,
3146,
3147,
3165,
3184,
3200,
3201,
3261,
3262,
3290,
3291,
3487,
3488,
3516,
3544,
3572,
3597,
3598,
3628,
3677,
3678,
3696,
3749,
3750,
3773,
3774,
4060,
4061,
4129,
4130,
4176,
4177,
4221,
4222,
4339,
4340,
4388,
4389,
4419,
4420,
4550,
4551,
4610,
4684,
4709,
4710,
4725,
4780,
4837,
4849,
4850,
4883,
4914,
4915,
4931,
4962,
4963,
4974,
4993,
4994,
5142,
5143,
5176,
5177,
5777,
5778,
6035,
6036,
6115,
6116,
6193,
6194,
6230,
6254,
6273,
6274,
6293,
6321,
6350,
6404,
6405,
6421,
6465,
6466,
6467,
6541,
6601,
6626,
6627,
6702,
6731,
6788,
6789,
6804,
6805,
6835,
6870,
6871,
6890,
6891,
7055,
7056,
7396,
7397,
7411,
7412,
7492,
7493,
7523,
7524,
7633,
7634,
7700,
7701,
7721,
7722,
7829,
7830,
7885,
7886
],
"line_end_idx": [
10,
11,
23,
24,
238,
239,
251,
252,
371,
372,
385,
386,
543,
544,
571,
572,
810,
811,
833,
834,
935,
936,
964,
965,
1119,
1120,
1145,
1146,
1203,
1204,
1374,
1375,
1393,
1394,
1566,
1567,
1596,
1597,
2089,
2090,
2149,
2150,
2224,
2249,
2250,
2272,
2278,
2279,
2298,
2299,
2469,
2470,
2526,
2527,
2543,
2561,
2577,
2606,
2607,
2617,
2666,
2743,
2749,
2750,
2785,
2786,
2817,
2818,
2940,
2941,
2983,
3023,
3024,
3146,
3147,
3165,
3184,
3200,
3201,
3261,
3262,
3290,
3291,
3487,
3488,
3516,
3544,
3572,
3597,
3598,
3628,
3677,
3678,
3696,
3749,
3750,
3773,
3774,
4060,
4061,
4129,
4130,
4176,
4177,
4221,
4222,
4339,
4340,
4388,
4389,
4419,
4420,
4550,
4551,
4610,
4684,
4709,
4710,
4725,
4780,
4837,
4849,
4850,
4883,
4914,
4915,
4931,
4962,
4963,
4974,
4993,
4994,
5142,
5143,
5176,
5177,
5777,
5778,
6035,
6036,
6115,
6116,
6193,
6194,
6230,
6254,
6273,
6274,
6293,
6321,
6350,
6404,
6405,
6421,
6465,
6466,
6467,
6541,
6601,
6626,
6627,
6702,
6731,
6788,
6789,
6804,
6805,
6835,
6870,
6871,
6890,
6891,
7055,
7056,
7396,
7397,
7411,
7412,
7492,
7493,
7523,
7524,
7633,
7634,
7700,
7701,
7721,
7722,
7829,
7830,
7885,
7886,
7913
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 7913,
"ccnet_original_nlines": 192,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.330258309841156,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.013530139811336994,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.223247230052948,
"rps_doc_frac_unique_words": 0.36828646063804626,
"rps_doc_mean_word_length": 5.209718704223633,
"rps_doc_num_sentences": 111,
"rps_doc_symbol_to_word_ratio": 0.010455099865794182,
"rps_doc_unigram_entropy": 5.383012771606445,
"rps_doc_word_count": 1173,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.095238097012043,
"rps_doc_frac_chars_dupe_6grams": 0.0520373098552227,
"rps_doc_frac_chars_dupe_7grams": 0.04352806136012077,
"rps_doc_frac_chars_dupe_8grams": 0.04352806136012077,
"rps_doc_frac_chars_dupe_9grams": 0.04352806136012077,
"rps_doc_frac_chars_top_2gram": 0.025200460106134415,
"rps_doc_frac_chars_top_3gram": 0.008836519904434681,
"rps_doc_frac_chars_top_4gram": 0.018654879182577133,
"rps_doc_books_importance": -769.0528564453125,
"rps_doc_books_importance_length_correction": -769.0528564453125,
"rps_doc_openwebtext_importance": -416.6939697265625,
"rps_doc_openwebtext_importance_length_correction": -416.6939697265625,
"rps_doc_wikipedia_importance": -397.7619323730469,
"rps_doc_wikipedia_importance_length_correction": -397.7619323730469
},
"fasttext": {
"dclm": 0.49701952934265137,
"english": 0.7879431843757629,
"fineweb_edu_approx": 2.6386427879333496,
"eai_general_math": 0.9645007252693176,
"eai_open_web_math": 0.2092900276184082,
"eai_web_code": 0.9492217302322388
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.1",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "520",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Astronomy",
"level_3": ""
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "4",
"label": "Code/Software"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "23",
"label": "Tutorial"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "4",
"label": "Graduate/Expert Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-166,216,358,394,811,870 |
The Freedom Phone – A Response
My post on the Freedom Phone received more views than any other post ever on this blog (link).
One longtime reader of the blog chimed in with some actual technical concers regarding cell phones in general. Another reader left a comment about not doing bad things with certain body parts, essentially saying (I assume) that I was bashing the Freedom Phone. What I said was that I was taking a “wait and see” attitude. I am hopeful this new option provides exactly what they say the do. I responded to the commenter with some more specific concerns about the platform which I think bear mentioning in a post.
So here you go:
The offering is interesting but before I make a decision I would like more information. The company selling this phone offers VERY LITTLE in the way of technical specs for either the hardware or software. Before I give anything a thumbs up form a security perspective I want to see more than marketing blurbs.
While the Android OS is open source and based on Linux the vast majority of the code is developed privately by Google employees and contractors. Google is also the major sponsor and funding source for the open source community around Android OS. Many components necessary for the operating system to be used on a phone are still proprietary and closed software maintained by Google. It would be extremely easy for Google to insert code that could be used to spy on those running Android-based systems without anyone being aware. In fact, it is proven that they do exactly this. One of Google’s operating units, Jigsaw, is a government contractor assisting the NSA and otheragencies in their spy efforts. So, there is not only a political incentive but also a financial incentive for Google to plant spyware in the Android OS stack.
The hardware for the phone is sourced from China. It is a phone designed for the Chinese market by a Chinese company with ties to the CCP. Now, pretty much all phones are manufactured in China or from Chinese made parts. However, Apple, Google, Intel, etc. go to great lengths to ensure that the phones or components are free of embedded spyware (they hate competition). They have not always been successful with Intel being the most visible victim of this activity. If you buy ANY Chinese made electronics not under contract by a major US, Japanese, Korean or Taiwanese company it is almost guaranteed to have spyware embedded.
With all that said, it is POSSIBLE that the folks selling the Freedom Phone have overcome these obstacles and provided exactly what they advertise. But before I accept that as fact I want a lot more information and independent verification especially considering the recent history of even cybersecurity companies being compromised (supposedly by the Russians but more likely by the Chinese).
I certainly hope the folks at Freedom Phone have or can accomplish what their marketing claims.
With that said, cell phones technology as a whole has some critical security gaps which no vendor can bypass (technically or legally):
• Every cell device is required to have a unique identifier in order to access cellular networks. These numbers are tied to your account with a provider. Legally, retailers of so called “burner phones” are supposed to record personal data and tie it to the phones identifier (some may not if cash is used).
• When that device is powered on it connects to multiple cell towers providing a location (through triangulation) of the device. This information is tracked by the carrier and is available to the government, in most cases without a warrant. Just ask the folks who were in Washington DC on January 6th.
• Apps like Signal, ProtonMail and VPNs that encrypt communications are a good idea (I highly recommend using them). However, if the device itself is compromised/spyware installed the data on the device can easily be accessed including that sent over encrypted channels.
Another good point to consider and plan for is how you will communicate if cell service/Internet access is shut off. We are seeing that today in Cuba and have seen it in Hong Kong and other places recently.
Stay alert, stay prepared and stay safe.
God bless.
Freedom Phone
Several blog sites and Conservative blogs are sharing the news that the Freedom Phone is here.
What’s the Freedom Phone?
According to the web site (link) it is:
The Freedom Phone is a free speech and privacy first focused phone. With features like tracking blockers and an uncensorable app store.
Sounds like a noble goal.
It is based on the Android phone platform and runs a variant of the Android OS called “FreedomOS.” For me, that’s the rub. See Google is the driving force behind Android and Android OS. Yes, technically it is an Open Source project but it is primarily driven and supported by Google who are most definitely not pro-freedom (unless you agree with their social and political views, then you’re free to burn cities down, assault those you don’t control, and commit murder and mayhem). I am not an expert on Android but from what my friends who are say, they could have accomplished most of this simply by creating an alternate app store.
I will be needing a new phone before too long, but for now, I’m taking a wait and see attitude on the Freedom Phone.
If you are more inclined to jump on this new offering there is a $50 discount from The Gateway Pundit on them. Just use the code TGP at checkout.
Stay alert, stay prepared and stay safe.
God bless.
Colonial Pipeline: Something Smells Fishy…
After non-committal answers from the current administration during the Colonial Pipeline incident the Department of Justice has announced that they have recovered much of the money (Bitcoin) paid in ransom.
A couple of things I have been able to determine from the press coverage of this “win” for the justice department.
First, the bad actor in question was (supposedly) smart enough to infiltrate and bring down a critical component of national infrastructure (more on this in a moment) but dumb as all get out by having the Bitcoin transferred into an online wallet maintained by a US-based company with its servers in the US. Basically, said bad actor gave them his personal bank account info to deposit money into…
Second, the DoJ shared that the bad actors involved (the ones dumb enough to give out easily traced info for the payment) were not in fact the Russian (oh, the scary Russians again!) DarkSide hackers. They were the one (or ones) who contracted with DarkSide to perform the hack (yes, Ransomware as a Service (RaaS) is actually a real thing).
Something doesn’t pass the smell test on this whole thing. It may have been an inside job by a Colonial employee wanting a quick payout when he/she recognized the security lapses. It may have been a government sting that actually failed but they are spinning it as a win. I don’t know but I know.
For a good analysis of the facts check out this article:
https://dossier.substack.com/p/the-colonial-pipeline-hack-the-russians
Stay alert, stay prepared and stay safe.
God bless.
New Diversions: Raspberry Pi and Kali Linux
Over the past few weeks I have been indulging my TechNerd self. I have been spending more time thinking about and privacy and security from a personal perspective and that effort lead to a couple of new areas of interest; Single Board Computers specifically the Raspberry Pi and Kali Linux.
While researching personal security and privacy I came across a post detailing how this particular person used the Raspberry Pi (and other single board computers) to help ensure his own data privacy. I have looked at these devices before and although I thought they were cool I never really saw a need for one but after reading that I was interested enough to go ahead and spend the $90 to get a full set up; board, case, power supply and MicroSD card preloaded with the Raspberry version of Linux.It was cool and all but became even cooler when I bought a second MicroSD and loaded it up with Kali Linux.
Kali is a Linux distribution geared towards security professionals and is loaded up with tools for penetration testing, security auditing and forensic analysis. It’s a “one stop shop” for a ton of hacking tools geared towards the “white hat” hacking community.
Now, to be honest, this really isn’t just a diversion. I work in the cyber-security industry helping customers secure their environments from the bad guys. I know our product pretty well and I know the threats it is designed to counter but I really don’t know the other side of the story at any more than a conceptual level. I know the attacks we deal with and how we deal with them but I really don’t know how those attacks are performed. I have depended on other teams within the organization to research and educate us on them. Working with Kali will help me learn the attack side of things in addition to the defense since many of those tools are there to work with.
That will help make me better at my job. It also builds another marketable skill set. I doubt most penetration testers (pentesters) need to go onsite for their work very often so it is a skill set I could easily utilize remotely even after the COVID nightmare is over.
Hopefully, some of what I learn will make it into the blog in order to help others keep their data private and secure.
Stay alert, stay prepared and stay safe.
God bless.
Cyber Security/Privacy Suggestions
In these strange and dangerous times it would probably be a good idea to pay a little more attention to ensuring your privacy in electronic communications. Here are a few suggestions:
Instant Messaging/Texting – Although the security on most of the texting/Instant Messaging platforms is getting better it would be a good idea to take certain conversations a little more secure. Telegram and Signal are both pretty good solutions for the average person. Both offer end-to-end encryption of messages, the ability to set messages to expire and to actually delete messages without them being archived on servers. Both assure their users that they are not tracking usage.
Do you need to encrypt the latest pictures of the kids or grandkids? No, but given the fact that The New Regime (AmSoc) qualifies support of the Constitution, questioning the validity of the last elections, support for Trump or opposition to the the new order as being seditious, white supremacist, domestic terrorism just about any political talk should probably happen in a secure manner. There are other options that are both more secure and more technically challenging to configure but these are fine for most of us.
Personal VPN – Again, it should be no surprise that you Internet browsing history is no secret. Various business and government organizations habitually track where you go, what you search for, what time you search for them, etc. Using a personal VPN can help. Personal VPNs create a secure (encrypted) “tunnel” to keep your passwords and confidential data stay safe, even over public or un-trusted Internet connections. They help keep your browsing history private. I recommend ProtonVPN, if you decide to choose another vendor do your homework before selecting a VPN provider, especially for your mobile devices. A number of those in the two main app stores are based in China and do the opposite of securing your data…
Secure Email – Sometime text messaging is not enough but you still want to be secure. There are a number of secure email services out there (hint: Gmail, Outlook, and Apple mail are not among them). I recommend ProtonMail for many of the same reasons as I recommend their VPN solution; secure, based in Switzerland, relatively easy to use, and anonymous.
Social Media – Always assume anything you post on social media is being read by The New Regime (AmSoc), their Thought Police, and their street thugs. Even if you are on one of the “free speech” sites and seem to be surrounded by like-minded folks be cautious of what you post/share. Nothing posted on social media should be considered secure. Period. Always assume that those on the other side are watching and taking notes. While it may be your right to question the election results or express dissatisfaction with life under The New Regime it could also put you and your family at risk. If you attend an event or protest do not post photos that include others who attended without their explicit approval. Just being photographed at pro-Trump events has cost people their jobs.
That’s enough for now, we’ll have more suggestions in the future.
Take care and God bless.
What About Four Or More?
If Ian Fleming was right and Once is happenstance. Twice is coincidence. Three times is enemy action. I don’t know how to count these:
Solar Winds was a partner with a company named Huawei. Huawei is the largest telecommunications equipment manufacturer in the world, second largest cell phone maker and a network storage vendor. IT guys have been warned for years about Huawei including back doors for Chinese spying. As a partner and solution provider Solar Winds would have had to maintain Huawei equipment at least on their development network (which is part of what was compromised).
Silver Lake is one of the major investors in Solar Winds. They are also tied to Huawei and other Chinese government owned tech companies. Kenneth Hao, spearheaded the Silver Lake investments in China and opened the offices there. He is on the board of directors for Solar Winds…
Two more victims of this breach were announced today. One is Comcast a major network provider to businesses and government agencies. More interesting is the local government of Pima county Arizona. Why would the most advanced cyber attack on the planet target a local government instead of a large oil or insurance company? I can’t answer that for sure but oil and insurance companies don’t run elections.
Repeat after Ian Fleming:
Once is happenstance. Twice is coincidence. Three times is enemy action.
Take care and God bless.
Once is happenstance. Twice is coincidence. Three times is enemy action
If Ian Fleming was right we could be seeing the indications of a incredible enemy action.
The WuFlu hit (got loose/was released) in October 2019. The initial attacks linked to the Sunburst data breach started in October 2019
The WuFlu hit the US around March of 2020. The code for the Sunburst breach was injected into the supply chain in March 2020.
In December 2020 a new and more virulent strain of the WuFlu is discovered just weeks after the Sunburst breach was discovered
Repeat after Ian Fleming:
Once is happenstance. Twice is coincidence. Three times is enemy action.
By the way, despite what is being spun in the media there is nothing conclusive to show that this was the work of the Russians. The techniques are similar to those the Russian intelligence service uses but there is no hard evidence that this was a Russian operation.
Take care and God bless.
Seven VPN Apps Exposed Private Browsing Data
A group of seven VPN providers (all leveraging the same underlying infrastructure) was found by an independent lab of exposing the personal browsing data of the services users; despite claiming none of that data was even being collected (link).
The exposed data included browsing history of the users, personally identifiable information (such as name, address, phone number, Social Security numbers, etc.), user IDs and passwords for online services and even payment information including credit card data.
Research these apps and security providers before trusting them with your personal data.
Take care and God bless.
|
{
"url": "https://thearmedchristian.wordpress.com/category/cybersecurity/",
"source_domain": "thearmedchristian.wordpress.com",
"snapshot_id": "crawl=CC-MAIN-2022-21",
"warc_metadata": {
"Content-Length": "113704",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:4YI3IL4NFAJIU7JXWTXTEAD3Y6A56TEH",
"WARC-Concurrent-To": "<urn:uuid:2b4e101f-f603-404c-b787-86a01ba57c4d>",
"WARC-Date": "2022-05-16T14:39:09Z",
"WARC-IP-Address": "192.0.78.13",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:Q4ZJMNR24PCYK4247N3JW6HXDB6M6QL2",
"WARC-Record-ID": "<urn:uuid:329f6e90-04a0-482f-9324-7ce29926ffb2>",
"WARC-Target-URI": "https://thearmedchristian.wordpress.com/category/cybersecurity/",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8a1bf847-1e33-4ee5-bd92-678b41a4eef9>"
},
"warc_info": "isPartOf: CC-MAIN-2022-21\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May 2022\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-116\r\nsoftware: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.3-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
31,
32,
127,
128,
640,
641,
657,
658,
968,
969,
1801,
1802,
2431,
2432,
2825,
2826,
2922,
2923,
3058,
3059,
3370,
3676,
3951,
3952,
4159,
4160,
4201,
4202,
4213,
4214,
4228,
4229,
4324,
4325,
4351,
4352,
4392,
4393,
4529,
4530,
4556,
4557,
5192,
5193,
5310,
5311,
5457,
5458,
5499,
5500,
5511,
5512,
5555,
5556,
5763,
5764,
5879,
5880,
6278,
6279,
6621,
6622,
6919,
6920,
6977,
6978,
7049,
7050,
7091,
7092,
7103,
7104,
7148,
7149,
7440,
7441,
8047,
8048,
8309,
8310,
8981,
8982,
9251,
9252,
9371,
9372,
9413,
9414,
9425,
9426,
9461,
9462,
9646,
9647,
10131,
10132,
10654,
10655,
11377,
11378,
11733,
11734,
12515,
12516,
12582,
12583,
12608,
12609,
12634,
12635,
12770,
12771,
13225,
13226,
13505,
13506,
13912,
13913,
13939,
13940,
14013,
14014,
14039,
14040,
14112,
14113,
14203,
14204,
14339,
14340,
14466,
14467,
14594,
14595,
14621,
14622,
14695,
14696,
14963,
14964,
14989,
14990,
15035,
15036,
15281,
15282,
15545,
15546,
15635,
15636,
15661,
15662
],
"line_end_idx": [
31,
32,
127,
128,
640,
641,
657,
658,
968,
969,
1801,
1802,
2431,
2432,
2825,
2826,
2922,
2923,
3058,
3059,
3370,
3676,
3951,
3952,
4159,
4160,
4201,
4202,
4213,
4214,
4228,
4229,
4324,
4325,
4351,
4352,
4392,
4393,
4529,
4530,
4556,
4557,
5192,
5193,
5310,
5311,
5457,
5458,
5499,
5500,
5511,
5512,
5555,
5556,
5763,
5764,
5879,
5880,
6278,
6279,
6621,
6622,
6919,
6920,
6977,
6978,
7049,
7050,
7091,
7092,
7103,
7104,
7148,
7149,
7440,
7441,
8047,
8048,
8309,
8310,
8981,
8982,
9251,
9252,
9371,
9372,
9413,
9414,
9425,
9426,
9461,
9462,
9646,
9647,
10131,
10132,
10654,
10655,
11377,
11378,
11733,
11734,
12515,
12516,
12582,
12583,
12608,
12609,
12634,
12635,
12770,
12771,
13225,
13226,
13505,
13506,
13912,
13913,
13939,
13940,
14013,
14014,
14039,
14040,
14112,
14113,
14203,
14204,
14339,
14340,
14466,
14467,
14594,
14595,
14621,
14622,
14695,
14696,
14963,
14964,
14989,
14990,
15035,
15036,
15281,
15282,
15545,
15546,
15635,
15636,
15661,
15662,
15663
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 15663,
"ccnet_original_nlines": 152,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.426596462726593,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.024028969928622246,
"rps_doc_frac_lines_end_with_ellipsis": 0.026143789291381836,
"rps_doc_frac_no_alph_words": 0.11784067749977112,
"rps_doc_frac_unique_words": 0.3537183701992035,
"rps_doc_mean_word_length": 4.757266998291016,
"rps_doc_num_sentences": 150,
"rps_doc_symbol_to_word_ratio": 0.0013166599674150348,
"rps_doc_unigram_entropy": 5.9730329513549805,
"rps_doc_word_count": 2649,
"rps_doc_frac_chars_dupe_10grams": 0.022059990093111992,
"rps_doc_frac_chars_dupe_5grams": 0.0526900514960289,
"rps_doc_frac_chars_dupe_6grams": 0.034756388515233994,
"rps_doc_frac_chars_dupe_7grams": 0.034756388515233994,
"rps_doc_frac_chars_dupe_8grams": 0.034756388515233994,
"rps_doc_frac_chars_dupe_9grams": 0.034756388515233994,
"rps_doc_frac_chars_top_2gram": 0.007141720037907362,
"rps_doc_frac_chars_top_3gram": 0.009522300213575363,
"rps_doc_frac_chars_top_4gram": 0.006665609776973724,
"rps_doc_books_importance": -1395.1837158203125,
"rps_doc_books_importance_length_correction": -1395.1837158203125,
"rps_doc_openwebtext_importance": -937.2833251953125,
"rps_doc_openwebtext_importance_length_correction": -937.2833251953125,
"rps_doc_wikipedia_importance": -627.436279296875,
"rps_doc_wikipedia_importance_length_correction": -627.436279296875
},
"fasttext": {
"dclm": 0.024128789082169533,
"english": 0.9641255140304565,
"fineweb_edu_approx": 1.5874160528182983,
"eai_general_math": 0.02655261941254139,
"eai_open_web_math": 0.08816462755203247,
"eai_web_code": 0.0068064299412071705
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.8",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "323.119",
"labels": {
"level_1": "Social sciences",
"level_2": "Political science",
"level_3": "Human rights, Ethnic relations, Race relations, and Minorities"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "5",
"label": "Evaluate"
},
"secondary": {
"code": "4",
"label": "Analyze"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "2",
"label": "Conceptual"
},
"secondary": {
"code": "3",
"label": "Procedural"
}
},
"document_type_v1": {
"primary": {
"code": "9",
"label": "Personal/Misc"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "16",
"label": "Personal Blog"
},
"secondary": {
"code": "10",
"label": "Knowledge Article"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
3,085,450,498,009,302,500 |
Home » Web Servers » Apache » Apache mod_rewrite example: Redirecting and rewriting URLs
About Gabriel Canepa
Gabriel Canepa
Gabriel Canepa is a Linux Foundation Certified System Administrator (LFCS-1500-0576-0100) and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work. When he's not typing commands or writing code or articles, he enjoys telling bedtime stories with his wife to his two little daughters and playing with them, the great pleasure of his life.
Apache mod_rewrite example: Redirecting and rewriting URLs
This article is part of our Academy Course titled Apache HTTP Server Tutorial.
In this course, we provide a compilation of Apache HTTP Server tutorials that will help you get started with this web server. We cover a wide range of topics, from installing the server and performing a basic configuration, to configuring Virtual Hosts and SSL support. With our straightforward tutorials, you will be able to get your own projects up and running in minimum time. Check it out here!
In a previous article we mentioned that one of Apache’s most distinguishing features is its extensibility via modules, which we defined as “independent, separate pieces of software that provide specific functionality”.
Some modules are built-in into Apache as part of the core functionality and are present when the web server is installed as we explained in “How to install the Apache web server”.
Others, such as mod_bw (which we covered in “Apache name-based Virtual Host Configuration Example”), can be installed using your distribution’s package management system.
The current list of all of the modules that come as part of the Apache HTTP Server can be found at http://httpd.apache.org/docs/current/mod/
Want to master Apache HTTP server ?
Subscribe to our newsletter and download the Apache HTTP server Ultimate Guide right now!
In order to help you turbo boost your Web server, we have compiled a kick-ass guide with all the major Apache HTTP server features and use cases! Besides studying them online you may download the eBook in PDF format!
In this article we will explain how to use mod_rewrite (a well-known and widely used module) to dynamically map incoming HTTP requests targeting arbitrary URLs to specific documents in your web server’s or virtual host internal structure, or to another external URL.
In other words, this module will allow you to redirect (as the rewrite in the name suggests) an URL (http://www.example.com/scg/results.php?country=Argentina&province=Cordoba) to a more user or SEO friendly URL (http://www.example.com/scg/Argentina/Cordoba) in order to get a higher position in search engines rankings, which ultimately leads to more visitors.
To accomplish this purpose, mod_rewrite realies heavily on PCRE (Perl Compatible Regular Expressions) vocabulary, which we will introduce next. Please be advised, however, that this topic can be a little burdensome until you start reaping the benefits out of it.
1. Introducing regular expressions (regexs)
In simple words, a regular expression is a text string that represents a search pattern. The following list, adapted from the Apache documentation on PCRE, shows the most common characters used in regular expressions, their meaning, and an example:
• . (a dot) matches any single character. Thus, b.t will match bat, bet, bit, bot, and but.
• + (the plus sign) repeats the previous characters one or more times. For example, o+ matches oo, ooo, etc.
• * (star) repeats the previous match zero or more times. Additionally, * is also used to match an empty string. In other words, the matches returned by a+ are a subset of the matches of a*.
• ? (question sign) makes the match of the previous characters optional, so colou?r will match both color and colour.
• ^ (caret) matches the beginning of the string. For example ^a matches a string that begins with a.
• $ (dollar sign) matches the end of the string, so a$ matches a string that ends with a.
In addition, you can also group characters into groups of classes:
• A set of parentheses ( ) is used to group several characters into a single unit. You can then apply the above regex characters to the group as it was a single character. Thus, (ab)+ matches abab, ababab, etc. Keep in mind that the + here applies to the group of characters surrounded by parentheses.
• A character class [ ] matches at least one of the characters in the set inside square brackets. For example, [alnum] matches any letter of the alphabet or numerical digit. Character classes are well explained in the PCRE regex syntax for PHP.
• On the opposite, a negative character class [^ ] matches any character not specified. Thus, c[^/]t matches cat or c2t but not c/t.
Finally, you can use the exclamation sign (!) to negate it.
Now we are ready to discuss the RewriteRule and RewriteCond directives, which are essential to the operation of mod_rewrite.
2. Introducing RewriteRule and RewriteCond
The RewriteRule directive, as its name implies, substitutes a given pattern with either one of three things:
• An absolute path to a local resource found inside the system
• A path to a local web resource
• An absolute URL
Its basic syntax is:
RewriteRule [Pattern] [Substitution] [Optional → Flags]
Since the [Flags] parameters is optional, we will not cover it in detail, but only mention it when we use it in an example. You can find the full [Flags] documentation here.
Last, but not least, we need to mention that you can place this directive inside the main configuration file, inside a Virtual host definition or Directory block. You can use multiple RewriteRule directives in the same context, each one with its own [Pattern], [Substitution] and (optionally) [Flags].
Alternatively, you can insert RewriteRule directives in .htaccess files. Although this is a widely used but not very secure method, we have chosen to not cover it during this series. However, you can learn more about it in the Apache documentation here.
The RewriteCond directive introduces a condition that must be met before the RewriteRule rules are “activated”.
To better understand this topic, let’s illustrate with a few examples.
3. Examples
Before we proceed with some examples, there are some considerations that we must take into account. In order to actually use mod_rewrite, we need to add the directives listed below in the context where we will use this module. Additionally, we need to make sure the module is loaded. We do this by running (in Ubuntu)
sudo a2enmod rewrite
In CentOS, it is enabled by default, which you can confirm with
httpd -M | grep rewrite
You should get the following output:
rewrite_module (shared)
If not, you will need to check the presence of the module file (mod_rewrite.so) in /etc/httpd/modules and make sure Apache is loading the modules in that directory. Look for the following line in the main configuration file:
Include conf.modules.d/*.conf
(By the way, /etc/httpd/modules is actually a symbolic link to /etc/httpd/conf.modules.d)
If it is not there, add it before proceeding.
Suppose we want to enable mod_rewrite in the context of www.example1.com. We need to modify its configuration file and add RewriteEngine (to enable the rewriting engine). Additionally, you need to set the Options directive to allow FollowSymlinks:
<VirtualHost *:80>
DocumentRoot "/var/www/example1.com/public_html/"
ServerName www.example1.com
ServerAlias example1.com
ErrorLog /var/www/example1.com/error.log
LogLevel info
CustomLog /var/www/example1.com/access.log combined
BandwidthModule On
ForceBandWidthModule On
Bandwidth all 20480
MinBandwidth all -1
MaxConnection all 5
<Directory "/var/www/example1.com/public_html/media">
LargeFileLimit * 1024 10240
</Directory>
RewriteEngine on
Options FollowSymLinks
</VirtualHost>
With that in place, also add the following lines inside the virtual host definition given above:
RewriteCond "%{REMOTE_ADDR}" "^192\.168\.0\.104"
RewriteRule "^/vhosterrors" "/var/www/example1.com/error.log"
RewriteRule "^/default\.aspx$" "index.html" [R]
RewriteRule "^/go/to/example2$" "http://example2.com" [R]
RewriteRule "^/writer/(.*)/view$" "/var/www/example1.com/$1"
(Make sure your configuration is similar to that shown in Fig. 1)
Figure 1: Adding RewriteCond and RewriteRule directives
Figure 1: Adding RewriteCond and RewriteRule directives
Let’s see what is happening here:
RewriteCond "%{REMOTE_ADDR}" "^192\.168\.0\.104"
indicates that the below rules apply if the remote address is 192.168.0.104
RewriteRule "^/vhosterrors" "/var/www/example1.com/error.log"
If you browse to http://example1.com/vhosterrors, a non-existent directory (note that it is a regular expression beginning with the word vhosterrors, as indicated by the caret sign), you will view the error log for the virtual host (/var/www/example1.com/error.log), as seen in Fig. 2.
Figure 2: Rewriting an URL to point to a local resource
Figure 2: Rewriting an URL to point to a local resource
RewriteRule "^/default\.aspx$" "index.html"
If you go to http://example1.com/default.aspx, you will be taken to the index.html of the virtual host. Refer to Fig. 3 for details.
Figure 3: Another example of URL rewriting
Figure 3: Another example of URL rewriting
RewriteRule "^/go/to/example2$" "http://example2.com" [R]
Browse to http://example1.com/go/to/example2 and you will be redirected to http://example2.com. By the way, the R inside square brackets stands for Redirect. This rule, as opposed to the previous one (which does a URL rewrite in the full sense of the word), performs a redirect to an external site. You may want to keep in mind that example1.com and example2.com are two different, separate sites even though they are hosted in the same machine.
Finally,
RewriteRule "^/writer/(.*)/view$" "/var/www/example1.com/$1"
says that if you go to http://example1.com/writer/gabriel/view, you will be taken to /var/www/example1.com/public_html/gabriel. Here the $1 is a placeholder for whatever matches the regular expression (.*). As explained earlier, the dot stands for any character, and the star sign represents zero or more occurrences of such character. In other words, that is the regular expression for match everything. Since this file does not exist, in Fig. 4 we can see a portion of the error log that says so:
Figure 4: Using a regular expression match to rewrite an URL
Figure 4: Using a regular expression match to rewrite an URL
If you try any of the above rewrite rules from a machine other than 192.168.0.104, you will see they don’t work as the rewrite rules are only put into effect when the remote address is 192.168.0.104, as you can see in Fig. 5:
Figure 5: Verifying that the rules are valid as per the corresponding condition
Figure 5: Verifying that the rules are valid as per the corresponding condition
With a slight change in the RewriteCond directive, you could allow access from the 192.168.0.0/24 network. Replace
RewriteCond "%{REMOTE_ADDR}" "^192\.168\.0\.104"
with
RewriteCond "%{REMOTE_ADDR}" "^192\.168\.0"
Then test again (see Fig. 6):
Figure 6: Activating the rules for a given network
Figure 6: Activating the rules for a given network
Please note that you should consider creating custom 404 error pages to display when the visitor attempts to access a resource that does not exist.
For example, copy the following code in /var/www/example1.com/public_html/error.html:
<!DOCTYPE html>
<html>
<head>
<title>Not found</title>
</head>
<body>
<h1>Not found :(</h1>
<h3>The page you requested has not been found.</h3>
<p>Perhaps you would like to go to our <a href="index.html">home page</a>?</p>
</body>
</html>
Now add the following line inside the virtual host definition:
ErrorDocument 404 /error.html
Then browse to a non-existent resource (http://example1.com/hello, for example) and you will see your personalized error page. See Fig. 7 for details:
Figure 7: A custom error page for non-existing resources
Figure 7: A custom error page for non-existing resources
As you can see, a custom error page looks much better than Apache’s default. In addition, you can use the error page to provide instructions (such as the suggestion to go to the home page in the Fig. 7).
4. Summary
In this article we have explained how to use mod_rewrite, definitely one of Apache’s most versatile modules, to perform URL rewriting and redirecting. As it is a vast topic, we cannot adequately cover it in a single article, so you are highly encouraged to check out the documentation linked in this tutorial, along with the Redirecting and Remapping guide. This last resource provides lots of other examples of what you can do with mod_rewrite.
Do you want to know how to develop your skillset to become a sysadmin Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. Introduction to NGINX
2. Apache HTTP Server Cookbook
3. VirtualBox Essentials
4. Nagios Monitoring Cookbook
5. Linux BASH Programming Cookbook
6. Postgresql Database Tutorial
and many more ....
Leave a Reply
1 Comment on "Apache mod_rewrite example: Redirecting and rewriting URLs"
Notify of
avatar
Sort by: newest | oldest | most voted
Satheesh Rajan
Guest
Very Good article… which gives a good insight for RewriteRule. 🙂
wpDiscuz
|
{
"url": "https://www.systemcodegeeks.com/web-servers/apache/apache-mod_rewrite-example/",
"source_domain": "www.systemcodegeeks.com",
"snapshot_id": "crawl=CC-MAIN-2017-43",
"warc_metadata": {
"Content-Length": "81940",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:SAAIEME2KBNLLXODOEJ5JBSOABTWFJCD",
"WARC-Concurrent-To": "<urn:uuid:d4d625ff-bf7d-4426-a307-584509993cf5>",
"WARC-Date": "2017-10-17T20:33:33Z",
"WARC-IP-Address": "104.27.131.144",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:CGAVSLJZURJQQFOX7L3S5DF44PKRSZEH",
"WARC-Record-ID": "<urn:uuid:1375a0c2-da8a-4878-af25-ba16ffcd8949>",
"WARC-Target-URI": "https://www.systemcodegeeks.com/web-servers/apache/apache-mod_rewrite-example/",
"WARC-Truncated": "length",
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:8cb8db02-5f6b-41b4-a49a-6c515f75ce56>"
},
"warc_info": "robots: classic\r\nhostname: ip-10-186-84-172.ec2.internal\r\nsoftware: Nutch 1.6 (CC)\r\nisPartOf: CC-MAIN-2017-43\r\noperator: Common Crawl Admin\r\ndescription: Wide crawl of the web for October 2017\r\npublisher: Common Crawl\r\nformat: WARC File Format 1.0\r\nconformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf"
}
|
{
"line_start_idx": [
0,
89,
90,
111,
112,
127,
627,
628,
687,
688,
767,
768,
1167,
1168,
1387,
1388,
1568,
1569,
1740,
1741,
1882,
1883,
1919,
1920,
2010,
2011,
2228,
2229,
2231,
2232,
2499,
2500,
2861,
2862,
3125,
3126,
3170,
3171,
3420,
3421,
3515,
3626,
3819,
3939,
4042,
4134,
4135,
4202,
4203,
4507,
4754,
4889,
4890,
4950,
4951,
5076,
5077,
5120,
5121,
5230,
5231,
5296,
5331,
5351,
5352,
5373,
5374,
5430,
5604,
5605,
5907,
5908,
6162,
6163,
6275,
6276,
6347,
6348,
6360,
6361,
6679,
6680,
6701,
6702,
6766,
6767,
6791,
6792,
6829,
6830,
6854,
6855,
7080,
7081,
7111,
7112,
7202,
7203,
7249,
7250,
7498,
7499,
7518,
7568,
7596,
7621,
7662,
7676,
7728,
7747,
7771,
7791,
7811,
7831,
7885,
7913,
7926,
7943,
7966,
7981,
7982,
8079,
8080,
8129,
8191,
8239,
8297,
8358,
8359,
8425,
8426,
8482,
8483,
8539,
8540,
8574,
8575,
8624,
8625,
8701,
8702,
8764,
8765,
9051,
9052,
9108,
9109,
9165,
9166,
9210,
9211,
9344,
9345,
9388,
9389,
9432,
9433,
9491,
9492,
9938,
9939,
9948,
9949,
10010,
10011,
10510,
10511,
10572,
10573,
10634,
10635,
10861,
10862,
10942,
10943,
11023,
11024,
11139,
11140,
11189,
11190,
11195,
11196,
11240,
11241,
11271,
11272,
11323,
11324,
11375,
11376,
11524,
11525,
11611,
11612,
11628,
11635,
11642,
11667,
11675,
11682,
11704,
11756,
11835,
11843,
11851,
11852,
11915,
11916,
11946,
11947,
12098,
12099,
12156,
12157,
12214,
12215,
12419,
12420,
12431,
12432,
12878,
12879,
12959,
12960,
13016,
13017,
13082,
13083,
13085,
13086,
13111,
13112,
13143,
13144,
13169,
13170,
13200,
13201,
13236,
13237,
13269,
13270,
13272,
13273,
13292,
13293,
13295,
13296,
13298,
13299,
13313,
13314,
13388,
13389,
13399,
13406,
13446,
13461,
13467,
13468,
13533,
13534
],
"line_end_idx": [
89,
90,
111,
112,
127,
627,
628,
687,
688,
767,
768,
1167,
1168,
1387,
1388,
1568,
1569,
1740,
1741,
1882,
1883,
1919,
1920,
2010,
2011,
2228,
2229,
2231,
2232,
2499,
2500,
2861,
2862,
3125,
3126,
3170,
3171,
3420,
3421,
3515,
3626,
3819,
3939,
4042,
4134,
4135,
4202,
4203,
4507,
4754,
4889,
4890,
4950,
4951,
5076,
5077,
5120,
5121,
5230,
5231,
5296,
5331,
5351,
5352,
5373,
5374,
5430,
5604,
5605,
5907,
5908,
6162,
6163,
6275,
6276,
6347,
6348,
6360,
6361,
6679,
6680,
6701,
6702,
6766,
6767,
6791,
6792,
6829,
6830,
6854,
6855,
7080,
7081,
7111,
7112,
7202,
7203,
7249,
7250,
7498,
7499,
7518,
7568,
7596,
7621,
7662,
7676,
7728,
7747,
7771,
7791,
7811,
7831,
7885,
7913,
7926,
7943,
7966,
7981,
7982,
8079,
8080,
8129,
8191,
8239,
8297,
8358,
8359,
8425,
8426,
8482,
8483,
8539,
8540,
8574,
8575,
8624,
8625,
8701,
8702,
8764,
8765,
9051,
9052,
9108,
9109,
9165,
9166,
9210,
9211,
9344,
9345,
9388,
9389,
9432,
9433,
9491,
9492,
9938,
9939,
9948,
9949,
10010,
10011,
10510,
10511,
10572,
10573,
10634,
10635,
10861,
10862,
10942,
10943,
11023,
11024,
11139,
11140,
11189,
11190,
11195,
11196,
11240,
11241,
11271,
11272,
11323,
11324,
11375,
11376,
11524,
11525,
11611,
11612,
11628,
11635,
11642,
11667,
11675,
11682,
11704,
11756,
11835,
11843,
11851,
11852,
11915,
11916,
11946,
11947,
12098,
12099,
12156,
12157,
12214,
12215,
12419,
12420,
12431,
12432,
12878,
12879,
12959,
12960,
13016,
13017,
13082,
13083,
13085,
13086,
13111,
13112,
13143,
13144,
13169,
13170,
13200,
13201,
13236,
13237,
13269,
13270,
13272,
13273,
13292,
13293,
13295,
13296,
13298,
13299,
13313,
13314,
13388,
13389,
13399,
13406,
13446,
13461,
13467,
13468,
13533,
13534,
13542
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 13542,
"ccnet_original_nlines": 262,
"rps_doc_curly_bracket": 0.000590750016272068,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.3473242521286011,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.01643930934369564,
"rps_doc_frac_lines_end_with_ellipsis": 0.003802279941737652,
"rps_doc_frac_no_alph_words": 0.2497376650571823,
"rps_doc_frac_unique_words": 0.3356097638607025,
"rps_doc_mean_word_length": 5.152194976806641,
"rps_doc_num_sentences": 188,
"rps_doc_symbol_to_word_ratio": 0.000699549971614033,
"rps_doc_unigram_entropy": 5.724762916564941,
"rps_doc_word_count": 2050,
"rps_doc_frac_chars_dupe_10grams": 0.030107930302619934,
"rps_doc_frac_chars_dupe_5grams": 0.09411095827817917,
"rps_doc_frac_chars_dupe_6grams": 0.07650066167116165,
"rps_doc_frac_chars_dupe_7grams": 0.07650066167116165,
"rps_doc_frac_chars_dupe_8grams": 0.046582091599702835,
"rps_doc_frac_chars_dupe_9grams": 0.046582091599702835,
"rps_doc_frac_chars_top_2gram": 0.006627529859542847,
"rps_doc_frac_chars_top_3gram": 0.010604050010442734,
"rps_doc_frac_chars_top_4gram": 0.009657260030508041,
"rps_doc_books_importance": -1304.731201171875,
"rps_doc_books_importance_length_correction": -1304.731201171875,
"rps_doc_openwebtext_importance": -748.6010131835938,
"rps_doc_openwebtext_importance_length_correction": -748.6010131835938,
"rps_doc_wikipedia_importance": -573.4498901367188,
"rps_doc_wikipedia_importance_length_correction": -573.4498901367188
},
"fasttext": {
"dclm": 0.15743601322174072,
"english": 0.8596922755241394,
"fineweb_edu_approx": 2.1655352115631104,
"eai_general_math": 0.7826486825942993,
"eai_open_web_math": 0.2845591902732849,
"eai_web_code": 0.680155873298645
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "005.74",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
},
"secondary": {
"code": "005.435",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computer programming"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "4",
"label": "Missing Images or Figures"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "8",
"label": "Documentation"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,245,147,634,750,745,000 |
[Tagging] Micro mapping traffic signals
Pieren pieren3 at gmail.com
Tue Aug 27 14:02:02 UTC 2013
Hi all,
If you did not notice, the OSM routing fans [1] are just pushing the
sub-tag "traffic_signals:direction" in the wiki:
http://wiki.openstreetmap.org/wiki/Traffic_signals
http://wiki.openstreetmap.org/wiki/Key:traffic_signals:direction
This is trying to fix one old issue in OSM. The tag
"highway=traffic_signals" has been created to say "this intersection
is controlled by traffic lights" and was placed on the intersection
node itself. It wasn't intended to tag each individual spotlight.
But since we have hi-res images, some contributors started the
micro-mapping of each individual traffic light and used the original
tag to see them on mapnik.
It looks nice on high mapnik zooms but this creates some issues for
data consumers because the same tag and the same feature can have
different amount of elements e.g, routine engine where routes with
traffic signals are penalized. And on complex intersections, we cannot
rely only on complex topological analysis. Note that we have a similar
issue with the "stop" sign, for instance.
The current solution with an additional tag
"traffic_signals:direction", pushed without a public discussion, is
solving most of the routing issues. But it is not sure to help other
applications where it is hard to determin which spotlight controls
which intersection and how it is synchronised , e.g. the rendering
issue where one, two, four or eight icons could be drawn depending on
the zoom level, icon size and distance between nodes; e.g. complex
intersections where more than one traffic light can be synchronized
(and should be counted only once for penalties); etc.
At low zoom levels, it's interresting to see only one symbol for the
whole intersection. At high zoom levels, each individual traffic light
can be painted. The current tagging solution does not help in this
regard. It's just working more or less by accident on mapnik when
icons are overlapping (if not, the rendering will fail).
My proposal:
- when micro-mapping the traffic lights, use a different tag than
"highway=traffic_signals" which should be reserved for the "simple,
old" fashion way of mapping the intersection itself.
- create a new tag for the micro-mapping of each individual traffic
signal e.g.: "highway=traffic_light" (any other suggestion is welcome)
- create a new relation type e.g. "type=traffic_lights" (or reuse the
proposal "type=junction" [2]) with a role for each "traffic_light"
node and one role on the "intersection" node(s)
- advantages : for routers, they just collect the relations where the
intersection node is member to calculate penalties. For renderers,
either they draw an icon for each individual traffic light at high
zoom levels or a centroid of the junction nodes member of the relation
at lower zoom levels. In principle, the old fashion is compatible with
the new one but once the relation is widely supported, the old
"highway=traffic_signals" could be removed where the relation is
present. Common traffic signals attributs like the "button_operated"
could be generalized into the relation.
- disadvantage : contributors going to micro-map the traffic signals
will have to use relations. But I don't see this as a big issue since
micromappers should be considered as advanced users. If they cannot
handle relations, they can fall back on the previous simple old manner
with a tag on the intersection node. It's also a good opportunity to
learn relations which can be used later for many other things (e.g.
turn restrictions ;-)
Your comments ?
Pieren
[1] https://github.com/DennisOSRM/Project-OSRM/issues/31
[2] http://wiki.openstreetmap.org/wiki/Relations/Proposed/Junctions
More information about the Tagging mailing list
|
{
"url": "https://lists.openstreetmap.org/pipermail/tagging/2013-August/014578.html",
"source_domain": "lists.openstreetmap.org",
"snapshot_id": "crawl=CC-MAIN-2020-40",
"warc_metadata": {
"Content-Length": "7228",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:JU3DMSBG5JI3O42IPAJC3GSHTV5CHLNH",
"WARC-Concurrent-To": "<urn:uuid:92c0a02e-2ae9-4433-a4a4-5fa740c1a182>",
"WARC-Date": "2020-09-25T04:51:49Z",
"WARC-IP-Address": "212.110.172.32",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:DDU77JR6YIKGYX5UZYMYFIIK5Z6K7PP5",
"WARC-Record-ID": "<urn:uuid:bdb80d3d-ca6c-43d8-94c9-c16303aba2b4>",
"WARC-Target-URI": "https://lists.openstreetmap.org/pipermail/tagging/2013-August/014578.html",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:79175d6e-f49f-439e-9dd8-87ddf941ba55>"
},
"warc_info": "isPartOf: CC-MAIN-2020-40\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for September 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-108.ec2.internal\r\nsoftware: Apache Nutch 1.17 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
40,
41,
69,
98,
99,
100,
108,
109,
178,
227,
228,
279,
344,
345,
397,
466,
534,
600,
663,
732,
759,
827,
893,
960,
1031,
1102,
1144,
1145,
1189,
1257,
1326,
1393,
1460,
1530,
1597,
1665,
1719,
1788,
1859,
1926,
1992,
2049,
2050,
2063,
2129,
2197,
2250,
2318,
2389,
2459,
2526,
2574,
2644,
2711,
2778,
2849,
2920,
2983,
3048,
3117,
3157,
3226,
3296,
3364,
3435,
3504,
3572,
3594,
3595,
3611,
3612,
3619,
3620,
3677,
3745,
3746,
3747,
3748
],
"line_end_idx": [
40,
41,
69,
98,
99,
100,
108,
109,
178,
227,
228,
279,
344,
345,
397,
466,
534,
600,
663,
732,
759,
827,
893,
960,
1031,
1102,
1144,
1145,
1189,
1257,
1326,
1393,
1460,
1530,
1597,
1665,
1719,
1788,
1859,
1926,
1992,
2049,
2050,
2063,
2129,
2197,
2250,
2318,
2389,
2459,
2526,
2574,
2644,
2711,
2778,
2849,
2920,
2983,
3048,
3117,
3157,
3226,
3296,
3364,
3435,
3504,
3572,
3594,
3595,
3611,
3612,
3619,
3620,
3677,
3745,
3746,
3747,
3748,
3795
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 3795,
"ccnet_original_nlines": 78,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.38412290811538696,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.006402050144970417,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.21766965091228485,
"rps_doc_frac_unique_words": 0.4611307382583618,
"rps_doc_mean_word_length": 5.335689067840576,
"rps_doc_num_sentences": 42,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 5.130321025848389,
"rps_doc_word_count": 566,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.025165559723973274,
"rps_doc_frac_chars_dupe_6grams": 0.025165559723973274,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.008278150111436844,
"rps_doc_frac_chars_top_3gram": 0.02781457081437111,
"rps_doc_frac_chars_top_4gram": 0.025827810168266296,
"rps_doc_books_importance": -260.8628845214844,
"rps_doc_books_importance_length_correction": -260.8628845214844,
"rps_doc_openwebtext_importance": -152.90052795410156,
"rps_doc_openwebtext_importance_length_correction": -152.90052795410156,
"rps_doc_wikipedia_importance": -128.98583984375,
"rps_doc_wikipedia_importance_length_correction": -128.98583984375
},
"fasttext": {
"dclm": 0.06347501277923584,
"english": 0.9160100221633911,
"fineweb_edu_approx": 2.176388740539551,
"eai_general_math": 0.7523331642150879,
"eai_open_web_math": 0.26287198066711426,
"eai_web_code": 0.6101236939430237
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "004.6",
"labels": {
"level_1": "General works, books and libraries, information sciences",
"level_2": "",
"level_3": "Computers and Computer science"
}
},
"secondary": {
"code": "388.0285",
"labels": {
"level_1": "Social sciences",
"level_2": "Commerce and Communication and traffic",
"level_3": "Local transit"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "4",
"label": "Analyze"
},
"secondary": {
"code": "5",
"label": "Evaluate"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "5",
"label": "Social/Forum"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "0",
"label": "No Artifacts"
},
"secondary": {
"code": "3",
"label": "Irrelevant Content"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "8",
"label": "Documentation"
},
"secondary": {
"code": "18",
"label": "Q&A Forum"
}
},
"reasoning_depth": {
"primary": {
"code": "3",
"label": "Intermediate Reasoning"
},
"secondary": {
"code": "2",
"label": "Basic Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "3",
"label": "Mostly Correct"
},
"secondary": {
"code": "4",
"label": "Highly Correct"
}
},
"education_level": {
"primary": {
"code": "3",
"label": "Undergraduate Level"
},
"secondary": {
"code": "2",
"label": "High School Level"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
-7,409,110,731,150,942,000 |
Hawaii
level5
Ms. Kathy
Target 1
Lesson Type:
New
numberQuantity
:
rational
5.NQ.RN.4
Supporting targets:
1:
5
2:
3:
4:
5:
Grade:
6th
Vocabulary:
Decimal, Fraction, Convert
Activities:
• Given a decimal and a fraction, students converted the fraction to a decimal to compare the two numbers.
Challenge Problem:
Challenge Data:
Home Exploration
Guiding Questions:
Challenge Answer:
Target 2
Lesson Type:
New
geometry
measurement
5.G.M.4
:
Supporting targets:
1:
5
2:
6
3:
4:
5:
Grade:
6th
Vocabulary:
Volume, Composite, Figure
Activities:
• Students calculated the volume of composite figures by dividing the figure into different prisms and totaling up the volume.
Home Exploration
Challenge Problem:
Challenge Data:
Guiding Questions:
Challenge Answer:
saturday
|
{
"url": "https://www.growingiq.com/dlt-collection/Ms.-Kathy/level5/saturday",
"source_domain": "www.growingiq.com",
"snapshot_id": "crawl=CC-MAIN-2020-24",
"warc_metadata": {
"Content-Length": "678392",
"Content-Type": "application/http; msgtype=response",
"WARC-Block-Digest": "sha1:W4477TK32744CDWWSBHLXVCCTWVTSEQY",
"WARC-Concurrent-To": "<urn:uuid:168b3ce4-da6c-4235-abf6-c3167aedb23b>",
"WARC-Date": "2020-06-01T15:05:55Z",
"WARC-IP-Address": "185.230.61.195",
"WARC-Identified-Payload-Type": "text/html",
"WARC-Payload-Digest": "sha1:IJWSLGQRSKS2KPE6VYXDY47MB2CLCKG3",
"WARC-Record-ID": "<urn:uuid:cee065c9-585b-4371-a368-7797211553aa>",
"WARC-Target-URI": "https://www.growingiq.com/dlt-collection/Ms.-Kathy/level5/saturday",
"WARC-Truncated": null,
"WARC-Type": "response",
"WARC-Warcinfo-ID": "<urn:uuid:182e3fdf-b3a3-4dba-9f54-c188cf29b365>"
},
"warc_info": "isPartOf: CC-MAIN-2020-24\r\npublisher: Common Crawl\r\ndescription: Wide crawl of the web for May/June 2020\r\noperator: Common Crawl Admin ([email protected])\r\nhostname: ip-10-67-67-190.ec2.internal\r\nsoftware: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)\r\nrobots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)\r\nformat: WARC File Format 1.1\r\nconformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/"
}
|
{
"line_start_idx": [
0,
7,
14,
15,
25,
26,
36,
37,
50,
51,
55,
56,
71,
72,
74,
75,
84,
85,
95,
96,
116,
119,
120,
122,
123,
126,
127,
130,
131,
134,
135,
138,
139,
146,
147,
151,
152,
164,
165,
192,
193,
205,
206,
315,
316,
335,
351,
352,
369,
370,
389,
407,
408,
417,
418,
431,
435,
444,
456,
464,
465,
467,
468,
488,
491,
492,
494,
495,
498,
499,
501,
502,
505,
506,
509,
510,
513,
514,
521,
522,
526,
527,
539,
540,
566,
567,
579,
580,
709,
710,
727,
728,
747,
763,
782,
800
],
"line_end_idx": [
7,
14,
15,
25,
26,
36,
37,
50,
51,
55,
56,
71,
72,
74,
75,
84,
85,
95,
96,
116,
119,
120,
122,
123,
126,
127,
130,
131,
134,
135,
138,
139,
146,
147,
151,
152,
164,
165,
192,
193,
205,
206,
315,
316,
335,
351,
352,
369,
370,
389,
407,
408,
417,
418,
431,
435,
444,
456,
464,
465,
467,
468,
488,
491,
492,
494,
495,
498,
499,
501,
502,
505,
506,
509,
510,
513,
514,
521,
522,
526,
527,
539,
540,
566,
567,
579,
580,
709,
710,
727,
728,
747,
763,
782,
800,
808
]
}
|
{
"red_pajama_v2": {
"ccnet_original_length": 808,
"ccnet_original_nlines": 95,
"rps_doc_curly_bracket": 0,
"rps_doc_ldnoobw_words": 0,
"rps_doc_lorem_ipsum": 0,
"rps_doc_stop_word_fraction": 0.1111111119389534,
"rps_doc_ut1_blacklist": 0,
"rps_doc_frac_all_caps_words": 0.02469136007130146,
"rps_doc_frac_lines_end_with_ellipsis": 0,
"rps_doc_frac_no_alph_words": 0.40740740299224854,
"rps_doc_frac_unique_words": 0.5675675868988037,
"rps_doc_mean_word_length": 5.46846866607666,
"rps_doc_num_sentences": 10,
"rps_doc_symbol_to_word_ratio": 0,
"rps_doc_unigram_entropy": 4.017045974731445,
"rps_doc_word_count": 111,
"rps_doc_frac_chars_dupe_10grams": 0,
"rps_doc_frac_chars_dupe_5grams": 0.13509060442447662,
"rps_doc_frac_chars_dupe_6grams": 0.06919275224208832,
"rps_doc_frac_chars_dupe_7grams": 0,
"rps_doc_frac_chars_dupe_8grams": 0,
"rps_doc_frac_chars_dupe_9grams": 0,
"rps_doc_frac_chars_top_2gram": 0.03294892981648445,
"rps_doc_frac_chars_top_3gram": 0.042833611369132996,
"rps_doc_frac_chars_top_4gram": 0.06260296702384949,
"rps_doc_books_importance": -28.985689163208008,
"rps_doc_books_importance_length_correction": -28.985689163208008,
"rps_doc_openwebtext_importance": -15.395508766174316,
"rps_doc_openwebtext_importance_length_correction": -15.388541221618652,
"rps_doc_wikipedia_importance": -1.9497376680374146,
"rps_doc_wikipedia_importance_length_correction": -1.9497376680374146
},
"fasttext": {
"dclm": 0.9717198610305786,
"english": 0.7866896986961365,
"fineweb_edu_approx": 2.810077428817749,
"eai_general_math": 0.1321706771850586,
"eai_open_web_math": 0.49235641956329346,
"eai_web_code": 0.00009870999929262325
}
}
|
{
"free_decimal_correspondence": {
"primary": {
"code": "513.26",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry"
}
},
"secondary": {
"code": "516.2",
"labels": {
"level_1": "Science and Natural history",
"level_2": "Mathematics",
"level_3": "Geometry, Algebraic"
}
}
},
"bloom_cognitive_process": {
"primary": {
"code": "3",
"label": "Apply"
},
"secondary": {
"code": "2",
"label": "Understand"
}
},
"bloom_knowledge_domain": {
"primary": {
"code": "3",
"label": "Procedural"
},
"secondary": {
"code": "2",
"label": "Conceptual"
}
},
"document_type_v1": {
"primary": {
"code": "3",
"label": "Reference/Encyclopedic/Educational"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"extraction_artifacts": {
"primary": {
"code": "3",
"label": "Irrelevant Content"
},
"secondary": {
"code": "0",
"label": "No Artifacts"
}
},
"missing_content": {
"primary": {
"code": "0",
"label": "No missing content"
},
"secondary": {
"code": "-1",
"label": "Abstain"
}
},
"document_type_v2": {
"primary": {
"code": "23",
"label": "Tutorial"
},
"secondary": {
"code": "6",
"label": "Content Listing"
}
},
"reasoning_depth": {
"primary": {
"code": "2",
"label": "Basic Reasoning"
},
"secondary": {
"code": "3",
"label": "Intermediate Reasoning"
}
},
"technical_correctness": {
"primary": {
"code": "4",
"label": "Highly Correct"
},
"secondary": {
"code": "3",
"label": "Mostly Correct"
}
},
"education_level": {
"primary": {
"code": "2",
"label": "High School Level"
},
"secondary": {
"code": "1",
"label": "General Audience"
}
}
}
|
672f1e42c33a7f9846924a2431ea77df
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.