So where are the downloaded CSS files stored? - html

Let's say I view a web page via IE and check the source code. In it, I find this tag:<link rel="stylesheet" type="text/css" href="forumdata/cache/style_12_common.css?Ccx" />. I suppose this means the web page comes with a CSS sheet and it's downloaded onto my computer under some temp folder? But I looked at the Temporary Internet Files folder, it was not there. So my question is where are the css files normally stored?

Edit to add: In an act of recursive (circular?) Googling, it appears that SO has another question which contains the answer to "where is the IE cache?"
I'm not sure about IE, but Firefox has a Cache folder under your profile directory. For my Linux box, it's ~/.mozilla/firefox/<profile>/Cache/. The folder looks like this (this is a list of files within the directory, in case you're not familiar with Unix/Linux):
[20:36:44] ~/.mozilla/firefox/dk6fwbbj.default/Cache $ ls
00C56123d01 334039C7d01 700B13E5d01 92393F82d01 B69F8DE4d01 E1F99924d01
012339DDd01 3A9A68BCd01 71FF4ED1d01 9243F45Ed01 BA493504d01 E4E00324d01
037348D3d01 3C4AC614d01 72C8CEC0d01 92B52013d01 BB86F350d01 E859A0FCd01
03853A65d01 3C80A952d01 72D4BE1Ad01 940EB7F7d01 BC018BB6d01 E870B684d01
077DC091d01 3D836843d01 72F96B17d01 941D6849d01 BC9A173Bd01 EDB6437Ed01
07FD89F5d01 3FCEE28Fd01 7539C750d01 95271C82d01 C279B0F8d01 EE63135Fd01
0A5F348Ed01 3FF14615d01 75F022C4d01 95C75CD0d01 C3794520d01 EEE47171d01
0AD8884Dd01 4043D770d01 788F4621d01 96B132EBd01 C4F55DF1d01 EF242AEBd01
0E109194d01 42723FEBd01 79221C58d01 984C14FDd01 C57415D3d01 EF8B0F23d01
12342345d01 442D11BFd01 79475512d01 9988F946d01 C5F20BB5d01 F08CF2B7d01
19CACB1Bd01 48251E09d01 79ED3E52d01 9A3A0149d01 C6849F0Ed01 F092E396d01
1B36C300d01 487A6337d01 7A96B218d01 9BB04B2Fd01 _CACHE_001_ F412BCA2d01
20700CB5d01 4945A4A0d01 7BF44070d01 9E204875d01 _CACHE_002_ F7244486d01
22586D64d01 4BB37585d01 7D6A17E7d01 9F960283d01 _CACHE_003_ F8267AFAd01
231BBB5Bd01 51C94367d01 7FC74BB9d01 A2875302d01 _CACHE_MAP_ FC47F8FFd01
2A58D97Cd01 52D4E476d01 80EBF2CDd01 A4D4D28Ad01 CE6E2E3Ad01 FD5C4583d01
2C21BE1Cd01 5AD48B1Cd01 82B87282d01 A5F56480d01 CEEF1936d01 FD5D91ABd01
2D19219Ed01 5B3C0D0Ad01 84BFAD4Fd01 A6541AAEd01 D2333F52d01 FF10CACDd01
2F4138C8d01 5E07A792d01 84D2DAF9d01 AA7E06A9d01 D25B5CDDd01
2F6C237Fd01 669EA2A9d01 857A2691d01 B0D4AE97d01 D6E28915d01
3058F347d01 68E61CCCd01 88D1BD18d01 B49E3998d01 D7DB1F90d01
30B9D5CCd01 6AC45753d01 8A088207d01 B4F10D7Ed01 DB526AF3d01
31BD736Bd01 6DD04606d01 8D9AA2B1d01 B5F58FDFd01 E19B4778d01
[20:37:41] ~/.mozilla/firefox/dk6fwbbj.default/Cache $
and a quick grep of these files (which are not named in a way that is helpful to humans) shows that there is CSS code in some of them:
[20:37:50] ~/.mozilla/firefox/dk6fwbbj.default/Cache $ grep 'color:' *
B49E3998d01: .ctl00_TreeView1_2 { color:White; }
B49E3998d01: .ctl00_TreeView1_3 { background-color:#3366FF;width:180px; }
Binary file _CACHE_001_ matches
Binary file _CACHE_002_ matches
Binary file _CACHE_003_ matches
[20:38:57] ~/.mozilla/firefox/dk6fwbbj.default/Cache $
I'd imagine IE probably does something similar, if you're interested in that browser. Try Googling for it, perhaps, but I don't use IE.

Related

QGIS CSV not geolocating correctly

I've been adding text layers without issue in 3.22.3-Białowieża and files that I concert from Excel position in the wrong location.
I've added Shape files and some text (csv) but the files that don't plot properly...never work. I saw a post about restarting the program but that doesnt fix the problem
Here is a picture of the plotted position and example of the data...The red is from the ESRI Shape and green the CSV. Also an example of the CSV data...
"EXPED_CD","DATE","LAT","LONG"
"68006","1968-01-25T19:00",44.433331,-57.116661
"68006","1968-01-25T20:00",44.433331,-56.796669
"68006","1968-01-25T21:00",44.413879,-56.495022
"68006","1968-01-25T22:00",44.394409,-56.193272
"68006","1968-01-26T00:00",44.37167,-55.575001
"68006","1968-01-26T01:00",44.333328,-55.25
"68006","1968-01-26T07:00",44.25,-55.333328
"68006","1968-01-26T08:00",44.099998,-55.549999
"68006","1968-01-26T09:00",43.933331,-55.73333
"68006","1968-01-26T10:00",43.75,-55.916672
"68006","1968-01-26T11:00",43.566669,-56.066669
"68006","1968-01-26T12:00",43.415001,-56.26667
"68006","1968-01-26T13:00",43.263329,-56.466671
"68006","1968-01-26T14:00",43.10833,-56.666672
"68006","1968-01-26T15:00",42.964581,-56.831669
"68006","1968-01-27T02:00",42.386669,-57.369999
"68006","1968-01-27T03:00",42.255001,-57.544998
"68006","1968-01-27T04:00",42.105,-57.68716
"68006","1968-01-27T05:00",41.943939,-57.843941
"68006","1968-01-27T06:00",41.757069,-58.034851
"68006","1968-01-27T07:00",41.570202,-58.225761
"68006","1968-01-27T08:00",41.383339,-58.416672
"68006","1968-01-27T09:00",41.22084,-58.5825
"68006","1968-01-27T10:00",41.058331,-58.748329
"68006","1968-01-27T11:00",40.903332,-58.900002
"68006","1968-01-27T12:00",40.700001,-59.099998
"68006","1968-01-28T01:00",40.145,-59.738331
"68006","1968-01-28T02:00",39.959999,-59.88834
"68006","1968-01-28T03:00",39.775002,-60.03833
"68006","1968-01-28T04:00",39.587502,-60.202499
"68006","1968-01-28T05:00",39.400002,-60.366661
"68006","1968-01-28T06:00",39.23333,-60.541618
"68006","1968-01-28T07:00",39.066669,-60.716671
"68006","1968-01-28T10:00",39.025002,-60.60833
"68006","1968-01-28T11:00",38.888329,-60.805
"68006","1968-01-28T12:00",38.73333,-60.963329
"68006","1968-01-28T13:00",38.575001,-61.131672
"68006","1968-01-29T07:00",38,-62.599998
"68006","1968-01-29T08:00",37.816669,-62.633339
"68006","1968-01-29T09:00",37.625,-62.681671
"68006","1968-01-29T10:00",37.433331,-62.73
"68006","1968-01-29T11:00",37.25,-62.783329
"68006","1968-01-29T12:00",37.049999,-62.833328
"68006","1968-01-29T13:00",36.818329,-62.898331
"68006","1968-01-29T14:00",36.616661,-62.96167
"68006","1968-01-30T03:00",35.833328,-63.41333
"68006","1968-01-30T04:00",35.647049,-63.549019
"68006","1968-01-30T05:00",35.460758,-63.6847
"68006","1968-01-30T06:00",35.274479,-63.820389
"68006","1968-01-30T07:00",35.088188,-63.956081
"68006","1968-01-30T08:00",34.901909,-64.091766
"68006","1968-01-30T10:00",34.529381,-64.363037
"68006","1968-01-30T11:00",34.343121,-64.498787
"68006","1968-01-30T12:00",34.14167,-64.599998
"68006","1968-01-30T13:00",33.970791,-64.699997
"68006","1968-01-30T14:00",33.799999,-64.800003
"68006","1968-01-30T17:00",33.616661,-64.916656
"68006","1968-01-30T18:00",33.395,-64.949997
"68006","1968-01-30T19:00",33.183331,-65.008171
"68006","1968-01-31T03:00",32.818329,-65.025002
"68006","1968-01-31T04:00",32.64167,-65.099998
"68006","1968-01-31T05:00",32.451981,-65.17775
"68006","1968-01-31T13:00",31.658331,-65.041656
"68006","1968-01-31T15:00",31.229071,-65.087463
"68006","1968-01-31T16:00",31.01453,-65.110397
"68006","1968-01-31T17:00",30.799999,-65.133331
"68006","1968-01-31T18:00",30.58333,-65.133331
"68006","1968-02-01T03:00",30.11167,-65.316673
"68006","1968-02-01T04:00",29.92333,-65.28833
"68006","1968-02-01T05:00",29.72665,-65.225517
"68006","1968-02-01T06:00",29.529961,-65.162712
"68006","1968-02-01T07:00",29.33333,-65.099998
"68006","1968-02-01T08:00",29.133329,-65.029114
"68006","1968-02-01T09:00",28.933331,-64.958344
"68006","1968-02-01T10:00",28.705,-64.925003
"68006","1968-02-01T11:00",28.450001,-64.966667
"68006","1968-02-01T12:00",28.21386,-64.911087
"68006","1968-02-01T13:00",27.97802,-64.866966
"68006","1968-02-01T20:00",27.799999,-64.883331
"68006","1968-02-01T21:00",27.6,-64.85183
"68006","1968-02-02T02:00",27.385,-64.946663
"68006","1968-02-02T03:00",27.15167,-64.910004
"68006","1968-02-02T04:00",26.988331,-64.85833
"68006","1968-02-02T05:00",26.816669,-64.883331
"68006","1968-02-03T05:00",24.51667,-64.633331
"68006","1968-02-03T06:00",24.299999,-64.550003
"68006","1968-02-03T07:00",24.116671,-64.466667
"68006","1968-02-03T08:00",23.9125,-64.402496
"68006","1968-02-03T09:00",23.70833,-64.338333
"68006","1968-02-03T10:00",23.495831,-64.290001
"68006","1968-02-03T11:00",23.283331,-64.241669
"68006","1968-02-03T12:00",23.08,-64.175003
"68006","1968-02-03T17:00",23.11515,-64.280296
"68006","1968-02-03T18:00",22.91667,-64.283333
"68006","1968-02-03T19:00",22.700001,-64.26667
"68006","1968-02-03T22:00",22.480869,-64.227539
"68006","1968-02-04T02:00",22.11833,-64.228333
restarted program expected fix

How to determine given GML version information?

Given a GML, how to determine its version? For eg, i have below GML. Is there any way to determine if its version 1, 2 or higher?
I don't see any version information as such. So what is the accurate way to determine the same?
<gml:FeatureCollection
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengeospatial.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlJP2Profile/1.0.0/gmlJP2Profile.xsd">
<gml:boundedBy>
<gml:Null>withheld</gml:Null>
</gml:boundedBy>
<gml:featureMember>
<gml:FeatureCollection>
<gml:featureMember>
<gml:RectifiedGridCoverage dimension="2" gml:id="RGC0001">
<gml:rectifiedGridDomain>
<gml:RectifiedGrid dimension="2">
<gml:limits>
<gml:GridEnvelope>
<gml:low>0 0</gml:low>
<gml:high>1023 1023</gml:high>
</gml:GridEnvelope>
</gml:limits>
<gml:axisName>x</gml:axisName>
<gml:axisName>y</gml:axisName>
<gml:origin>
<gml:Point gml:id="P0001" srsName="urn:ogc:def:crs:EPSG::4326">
<gml:pos>8.5001220703125 50.1249389648438</gml:pos>
</gml:Point>
</gml:origin>
<gml:offsetVector srsName="urn:ogc:def:crs:EPSG::4326">0.000244140625 0</gml:offsetVector>
<gml:offsetVector srsName="urn:ogc:def:crs:EPSG::4326">0 -0.0001220703125</gml:offsetVector>
</gml:RectifiedGrid>
</gml:rectifiedGridDomain>
<gml:rangeSet>
<gml:File>
<gml:fileName>gmljp2://codestream/0</gml:fileName>
<gml:fileStructure>Record Interleaved</gml:fileStructure>
</gml:File>
</gml:rangeSet>
</gml:RectifiedGridCoverage>
</gml:featureMember>
</gml:FeatureCollection>
</gml:featureMember>
</gml:FeatureCollection>
You can look at the schemas and their locations xsi:schemaLocation="http://www.opengeospatial.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlJP2Profile/1.0.0/gmlJP2Profile.xsd"
They should all be versioned as can be seen at http://schemas.opengis.net/gml/ and if not then you can check in a browser which shows http://www.opengeospatial.net/gml redirects to http://schemas.opengis.net/gml/3.1.1/base/gml.xsd

File corruption when inserting images to an existing word file

The following code applied to an existing file works for 2 images but beyond the file is marked as corrupted (though it can be recovered perfectly in word):
import docx
docTemplate = "TestTemplate.docx"
# docx job: add test subsections + images
doc_docx = docx.Document(docTemplate)
#doc_docx = docx.Document()
p = doc_docx.add_paragraph()
wp = p.add_run()
wp.add_picture('image.png')
wp.add_break()
wp.add_picture('image.png')
wp.add_break()
wp.add_picture('image.png')
doc_docx.save('TestFile2.docx')
The content of doc_docx.part.blob is available on pastebin
It appears that the docTemplate document was already containing some objects. Thanks to the answer from #Tores76 on python-docx github I could solve the "file corruption" issue. This means it was likely due to a duplicate docPr id
# fix id
doc_element = doc_docx._part._element
docPrs = doc_element.findall('.//' + qn('wp:docPr'))
for docPr in docPrs:
docPr.set('id',str(int(docPr.get('id'))+100000))

files().list returns incomplete and inconsistent list when using different pageSize

I have a python script that attempts to list all files and folders in a given folder.
This is the python code:
page_token = in_json.get('pageToken', None)
res = self._drive.files().list(
orderBy='folder, name',
pageSize=1000,
pageToken='page_token',
q='(\'PARENT_ID\' in parents) and (trashed = false)',
fields='nextPageToken, files(id, parents, name, modifiedTime, size, mimeType, md5Checksum, trashed)').execute()
PARENT_ID is the id of the parent folder, and page_token is set to the nextPageToken of previous response.
The folder (folder_0) I want to list contains 4096 files (0.a, 0.b, 1.a, 1.b, ..., 2047.a, 2047.b), but the return list only contains 4095 files (603.a is missing)
I change the query filter q to '(\'PARENT_ID\' in parents) and (name = \'603.a\') and (trashed = false)', and keep other fields unchange, the file 603.a can be list normally.
Then I use the original query filter q and change pageSize to 400/300/100, different files are missing (400: missing 1353.a, 300: no missing, 100: missing 1393.b).
(Using the same pageSize can get the same result, i.e., missing ths same file)
I try to list other folder (folder_1, folder_2, folder_3), each folder also contains 4096 files (0.a, 0.b, 1.a, 1.b, ..., 2047.a, 2047.b).
This is the result: (pageSize: missing files ('X' means no missing files))
folder_1: 100:503.a, 300:1091.a, 400: 1833.b, 1000:X
folder_2: 100:863.b, 300:194.b, 400: X, 1000:X
folder_3: 100:1085.a, 300:1896.a & 64.b, 400: X, 1000:X
I also try to upload (using files().create) and remove (using files().delete) file within that folder (folder_0) to observe the list result.
When I upload a file with similar name (603_), the missing file (603.a) shows up.
Then I remove the file I uploaded (603_) and list again, 1-st time the missing file (603.a) still exist, but from the 2-nd time the file disappeared again.
Below is the detailed steps:
(when pageSize=1000)
1. files().list: (4095/4096) missing 603.a
2. (upload 603_) → files().list: (4097/4097) X
3. (remove 603_) → files().list: (4096/4096) X
4. (do nothing) → files().list: (4095/4096) missing 603.a
5. (upload 1393_) → files().list: (4096/4097) missing 563.a <--- another file missing
(when pageSize=100)
1. files().list: (4095/4096) missing 1393.b
2. (upload 603_) → files().list: (4095/4097) missing 2 files (1393.b and 592.a) <---another file missing
3. (upload 1393_) → files().list: (4097/4098) missing 1491.b <---another file missing
4. (remove 603_) → files().list: (4097/4097) X
5. (remove 1393_) → files().list: (4096/4096) X
6. (do nothing) → files().list: (4095/4096) missing 1393.b
Other Information:
* It is not a pageToken issue as I make sure to send a request again with the given nextPageToken when it exists, and concatenate the response object list properly.
* This condition happens in an unlimited storage account. I use another unlimited storage account and list folders with the same structure, the result list is correct.
I have no ideas about this conditions since there is no clear pattern to find.
Thank you for taking a look into this issue!

filtered list of files in a directory

I have files in the directory with the following naming convention arriving daily and wish to filter a list of file to interoperate the data. I have been playing with regular and finding it difficult match the file I want to filter.
import re
fnames = ["JEExport_20150501-20150531_Credit-Balance-Adjustment-Applied_20150531183249.csv",
"JEExport_20150501-20150531_External-Credit-Balance-Payment_20150531183254.csv",
"JEExport_20150501-20150531_External-Payment_20150531183251.csv",
"JEExport_20150501-20150531_Invoice-Item_20150531183255.csv",
"JEExport_20150501-20150531_Invoice-Item-Adjustment_20150531183304.csv"
"JEExport_20150501-20150531_Invoice-Item-Adjustment-Tax_20150531183313.csv",
"JEExport_20150501-20150531_Taxation-Item_20150531183240.csv"]
for element in fnames:
m = re.match("[A-Za-z]+\-[A-Za-z]+|-[A-Za-z]+", element)
if m == 'Invoice-Item-Adjustment':
print(element) # do something
I don't think you need regex. Does this work?
fnames = ["JEExport_20150501-20150531_Credit-Balance-Adjustment-Applied_20150531183249.csv",
"JEExport_20150501-20150531_External-Credit-Balance-Payment_20150531183254.csv",
"JEExport_20150501-20150531_External-Payment_20150531183251.csv",
"JEExport_20150501-20150531_Invoice-Item_20150531183255.csv",
"JEExport_20150501-20150531_Invoice-Item-Adjustment_20150531183304.csv",
"JEExport_20150501-20150531_Invoice-Item-Adjustment-Tax_20150531183313.csv",
"JEExport_20150501-20150531_Taxation-Item_20150531183240.csv"]
for element in fnames:
if 'Invoice-Item-Adjustment' in element:
print(element) # do something
JEExport_20150501-20150531_Invoice-Item-Adjustment_20150531183304.csv
JEExport_20150501-20150531_Invoice-Item-Adjustment-Tax_20150531183313.csv