how to get Processor ID using Kernel32.dll - dll

I want to know if there is an Entry point for kernel32.dll , that is related to any processor data (ID , Serial , etc ... )
and I tried to Google it but I didn't find good results .
Note: I already know WMI , but I need something related to Kernel !

i think it is the best one
http://msdn.microsoft.com/en-us/library/ms724381(VS.85).aspx

Related

What does 'count' mean in Master API of Assign a file key?

I was reading this link about api:
https://github.com/chrislusf/seaweedfs/wiki/Master-Server-API#assign-a-file-key
but I didn't understand what will "count" option do.
Can you give an example about this option please?
count: how many file ids to assign. Use <fid>_1, <fid>_2 for the assigned additional file ids. e.g. 3,01637037d6_1, 3,01637037d6_2
Best regards
Sometimes you may want to reserve multiple file ids.
E.g., one picture may have multiple versions.
In a file id, <volume_id, key, cookie>.
For _1, _2, they will be translated to <volume_id, key+1, cookie>, <volume_id, key+2, cookie>

Extract incident details from Service Now in Excel

I am trying to extract ticket details from Service Now. Is there a way to extract the details without ODBC ? I have also tried the solution mentioned in [1]: https://community.servicenow.com/docs/DOC-3844, but I am receiving an error 9 -subscript out of range.
Is there a better way to extract details efficiently? I tried asking this in the service now forum but I thought I might get other opinions from here.
It's been a while since this question is asked. Hopefully following is still useful.
I am extracting change data (not incident) , but the process still should be same. You will need to gather incident table and column information. Then there are couple of ways to approach the problem.
1) If the data you are extracting has fixed parameters , such as fixed period or fixed column or group etc., then you can create a report within servicenow and then use REST/SOAP API to get the data in text/csv format. You can use different python modules to convert from csv to xls or xlsx depending on you need. I used openpyXL ,csv , xlsreader ,xlswriter etc.
See here for a example
ServiceNow - How to use SOAP to download reports
2) If the data has dynmaic parameters where you need to change columns, dates or filter etc, you can still use soap / REST API but form query within python scripts instead of having static report. This way you can change it based on your requirement on the fly.
Here is an example query for DB. you can use example for above. Just switch url with following.
table_name = 'u_change_table_name' #SN DB holding change/INCIDENT info
table_limit = 800
table_query = 'active=true&sysparm_display_value=true&planned_start_date=today'
date_query = 'chg_start_date>=javascript:gs.daysAgoStart(1)^active=true^chg_type=normal'
table_fields = 'chg_number,chg_start_date,chg_duration,chg_end_date' #Actual column names from DB and not from SN report.
url= (
'https://yourcompany.service-now.com/api/now/table/' +table_name +\
'?sysparm_query=' + date_query + '&sysparm_fields=' \
+ table_fields + '&sysparm_limit=' + str(table_limit)
)

Using iTunes Search API unable to find existing resource using iTunes ID

The specific case:
https://itunes.apple.com/gb/movie/112-weddings/id889327105/
Movie ID is 889327105. However, neither of the following is able to find the resource:
https://itunes.apple.com/lookup?id=889327105&entity=movie
https://itunes.apple.com/lookup?id=889327105
https://itunes.apple.com/lookup?isbn=889327105
https://itunes.apple.com/lookup?amgVideoId=889327105
https://itunes.apple.com/lookup?upc=889327105
I have been able to reproduce this with almost any ID I have tried:
https://itunes.apple.com/lookup?id=593941435
https://itunes.apple.com/lookup?id=834624061
https://itunes.apple.com/lookup?id=519376363
https://itunes.apple.com/lookup?id=875243978
https://itunes.apple.com/lookup?id=594248614
I found the resource with this :
https://itunes.apple.com/search?term=112+weddings
And was able to get the info for this ID ( 988581839 ) :
https://itunes.apple.com/lookup?id=988581839

orientdb sql update edge?

I have been messing around with orientdb sql, and I was wondering if there is a way to update an edge of a vertex, together with some data on it.
assuming I have the following data:
Vertex: Person, Room
Edge: Inside (from Person to Room)
something like:
UPDATE Persons SET phone=000000, out_Inside=(
select #rid from Rooms where room_id=5) where person_id=8
obviously, the above does not work. It throws exception:
Error: java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to com.orientechnologies.orient.core.db.record.ridbag.ORidBag
I tried to look at the sources at github searching for a syntax for bag with 1 item,
but couldn't find any (found %, but that seems to be for serialization no for SQL).
(1) Is there any way to do that then? how do I update a connection? Is there even a way, or am I forced to create a new edge, and delete the old one?
(2) When writing this, it came to my mind that perhaps edges are not the way to go in this case. Perhaps I should use a LINK instead. I have to say i'm not sure when to use which, or what are the implications involved in using any of them. I did found this though:
https://groups.google.com/forum/#!topic/orient-database/xXlNNXHI1UE
comment 3 from the top, of Lvc#, where he says:
"The suggested way is to always create an edge for relationships"
Also, even if I should use a link, please respond to (1). I would be happy to know the answer anyway.
p.s.
In my scenario, a person can only be at one room. This will most likely not change in the future. Obviously, the edge has the advantage that in case I might want to change it (however improbable that may be), it will be very easy.
Solution (partial)
(1) The solution was simply to remove the field selection. Thanks for Lvca for pointing it out!
(2) --Still not sure--
CREATE EDGE and DELETE EDGE commands have this goal: avoid the user to fight with underlying structure.
However if you want to do it (a little "dirty"), try this one:
UPDATE Persons SET phone=000000, out_Inside=(
select from Rooms where room_id=5) where person_id=8
update EDGE Custom_Family_Of_Custom
set survey_status = '%s',
apply_source = '%s'
where #rid in (
select level1_e.#rid from (
MATCH {class: Custom, as: custom, where: (custom_uuid = '%s')}.bothE('Custom_Family_Of_Custom') {as: level1_e} .bothV('Custom') {as: level1_v, where: (custom_uuid = '%s')} return level1_e
)
)
it works well

Sort products by 2 attributes in magento catal

On my magento site we have the requirement to sort the product listings by 2 attributes, 'Manufacturer', 'Name' and then falling back to the Unique and default attribute 'Entity ID'.
Seems magento only lets you order by 1 then entity_id. I dont mind having to do this in a hacky way if required.
Looking around a few people have the problem but no one seems to offer an answer so thought I'd give this ago ( First question too, had to be a toughie :) ).
http://www.magentocommerce.com/boards/viewthread/7314/
http://www.magentocommerce.com/boards/viewthread/206869/
After some research ( I'm not a php developer =/ ), the following seems to work:
The setOrder() method accepts an array.
$Collection->setOrder(array('attribute1', 'attribute2'), asc);
I'm not sure how anyone would want to use this but I modified this line in Toolbar.php in the Catalogue/Product/List/ directory.
if ($this->getCurrentOrder()) {
$this->_collection->setOrder(array($this->getCurrentOrder(), 'name'), $this->getCurrentDirection());
}
So all my collections are sorted by the current order ( default order ) and then hardcoded to order by name afterwards. Still doing some testing on it but seems to work......