Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I wanted to know who will create the block ids for blocks in hadoop either HDFS client or Name node.Please let me know.
The NameNode allocates the block ID and gives it to the client. The client then uses this block ID while communicating with a DataNode to write data into the block.
Apache JIRA HDFS-4645 documents the current design for allocation of block IDs. It uses a monotonically increasing ID starting from a specific constant. If you're interested in seeing the code for this, refer to the BlockIdManager and SequentialBlockIdGenerator classes in the Apache Hadoop codebase.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
For example, if I update a global variable in one goroutine, then read the variable in another goroutine, can I get the newest value?
Another question is, can "atomic.Load*" and "atomic.Store*" ensure visibility?
Without explicit synchronization between goroutines, there is no guarantee that you will see the latest value of a shared variable. The Go memory model describes this:
https://golang.org/ref/mem
Atomic load/store have memory barriers, and they do guarantee you will see the latest value, though the Go memory model does not explicitly state this.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to write a small dictionary Ruby app where I can look up existing entries, add and remove entries (ALL ENTRIES ARE PUT INTO A HASH). So right now I'm creating a Dictionary class and I'm not quite sure what exactly should be 'initialized' method.
I'm still pretty new to Ruby, so if someone could explain what should be initialized at the beginning of a class I'd be extremely grateful.
How do you know what to initialize?
Time and experience. In general, #new should:
Initialize instance variables.
Configure any object defaults.
Register itself with observers.
Housekeeping tasks needed to reach a minimal "ready" state.
Sometimes an object needs to do a lot more work to be "ready" (whatever that means for your class), and #new can just as easily do too little as too much. Finding the right balance for your application is what matters, so feel free to open new questions here or on Code Review Stack Exchange with more concrete questions and some actual code.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Recently I attended an interview, where the interviewer asked me the following questions in technical face to face interview:
How does Sticky Notes works?
How Windows is able to preserver the data even though it is not saved explicitly?
How the data is preserved even when the system crashes?
I've no idea how does it works. Tried googling, but I couldn't find any useful information.
Can anyone explain or give some information?
I agree with #Vii's response. He has the right information about where the file is stored.
I have found some forensic background on this file here:
http://www.forensicswiki.org/wiki/Sticky_Notes
It seems like the SNT file has 3 datastreams, 0,1 and 3. Stream 0 stores information in RTF form and Steam 3 stores the actual text in Unicode format.
The Root Entry of the storage stream has a timestamp associated with it and you can use tools like MiTec Storage Viewer, Sticky7List to view the creation and modification times associated with the file. You can create a sticky note and observe when it creates the datastream and modify the sticky note and monitor how it modifies the file.
Some helpful references:
http://www.pcworld.com/article/191453/sticky_notes.html
https://superuser.com/questions/396698/how-to-retrieve-contents-of-stick-notes-directly-from-file-system
http://www.forensicswiki.org/wiki/Sticky_Notes
http://computer-forensics.sans.org/blog/2010/10/19/digital-forensics-stuck-stickies-2
http://windowsir.blogspot.com/2011/08/sticky-notes-analysis.html
Sticky notes are written to a file which you can find at '%appdata%\Microsoft\Sticky Notes\StickyNotes.snt' and since there is not an explicit 'save' option, it should be flushing the content to that file as you write it and hence the data is preserved in case of a system crash.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to have the data in my site individually. For example: visitant 1 visited page 1, page 2, page 3, at time x,y,z.
How can i get this data in analytics?
You cannot see data for individual visitors in GA (and trying to do so would violate Googles Terms of Service).
You can redirect the tracking calls to your own server and write a script to parse for visitor data, see me answer here:
What would database-schema/database-design look like for google analytics?
(Those methods served for compatibility with the Urchin analytics software - since support for Urchin was dropped it might be that those method will be dropped at some point in the future).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to screenscrape a bunch of pages and store them in a database using ActiveRecord. I messed around using EventMachine and Typhoeus but I get flaky results, mostly mysteriously empty records getting saved.
What's the trick? I had the best results with scraping pages and writing them to disk, then inserting them into the DB, but I'd really like to do it in a single pass.
Is anybody doing this successfully?
My guess is your threads are sharing an AR connection. This will cause problems, and anyway concurrency won't get records into your database any faster. I suggest you download concurrently and insert them in a single thread (like you've been doing.)