Search Results

Search found 2730 results on 110 pages for 'storing'.

Page 1/110 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • storing a sorted array of hashes

    - by srk
    use strict; use warnings; my @aoh =( { 3 => 15, 4 => 8, 5 => 9, }, { 3 => 11, 4 => 25, 5 => 6, }, { 3 => 5, 4 => 18, 5 => 5, }, { 0 => 16, 1 => 11, 2 => 7, }, { 0 => 21, 1 => 13, 2 => 31, }, { 0 => 11, 1 => 14, 2 => 31, }, ); #declaring a new array to store the sorted hashes my @new; print "\n-------------expected output------------\n"; foreach my $href (@aoh) { #i want a new array of hashes where the hashes are sorted my %newhash; my @sorted_keys = sort {$href->{$b} <=> $href->{$a} || $b <=> $a} keys %$href; foreach my $key (@sorted_keys) { print "$key => $href->{$key}\n"; $newhash{$key} = $href->{$key}; } print "\n"; push(@new,\%newhash); } print "-----------output i am getting---------------\n"; foreach my $ref(@new) { my @skeys = sort {$ref->{$a} <=> $ref->{$b} } keys %$ref; foreach my $key (@skeys) { print "$key => $ref->{$key}\n" } print "\n"; } The output of the program : -------------expected output------------ 3 => 15 5 => 9 4 => 8 4 => 25 3 => 11 5 => 6 4 => 18 5 => 5 3 => 5 0 => 16 1 => 11 2 => 7 2 => 31 0 => 21 1 => 13 2 => 31 1 => 14 0 => 11 -----------output i am getting--------------- 4 => 8 5 => 9 3 => 15 5 => 6 3 => 11 4 => 25 3 => 5 5 => 5 4 => 18 2 => 7 1 => 11 0 => 16 1 => 13 0 => 21 2 => 31 0 => 11 1 => 14 2 => 31 Please tell me what am i doing wrong in storing the hashes into a new array.. how do i achieve what i want.. ? Thanks in advance...

    Read the article

  • Storing DateTime (UTC) vs. storing DateTimeOffset

    - by Frederico
    I usually have an "interceptor" that right before reading/writing from/to the database does datetime conversion (from UTC to localtime, and from localtime to utc), so I can use DateTime.Now (derivations and comparisions) throughout the system without worrying about timezones. Regarding serialization and moving data between computers, there is no need to bother, as the datetime is always UTC. Should I continue storing my dates (SQL 2008 - datetime) in UTC format or should I instead store it using DateTimeOffset (SQL 2008 - datetimeoffset)? UTC Dates in the database (datetime type) have been working and known for so long, why change it? What are the advantages? I have already looked into articles like this one, but I'm not 100% convinced though. Any thoughts?

    Read the article

  • Storing a set of values in Delphi

    - by Hendriksen123
    I am trying to store a set of values in delphi, but i want to be able to address them using their name, instead of an assigned number. For example, an array of 'OldValues' would let me do OldValue[1] := InflationEdit.Text; Ideally however, i would like to have a value stored in 'Data.Inflation.OldValue' for example. For each identifier, such as Inflation, there is an OldValue, NewValue and StoredValue. There are about 12 of these identifiers. Is there some way i could store the values like this? that way i could then do something like: Data.Inflation.NewValue := Data.Inflation.OldValue; Data.Inflation.NewValue := InflationEdit.Text;

    Read the article

  • Basic Question on storing variables c# for use in other classes

    - by Calibre2010
    Ok guys I basically have a class which takes in 3 strings through the parameter of one of its method signatures. I've then tried to map these 3 strings to global variables as a way to store them. However, when I try to call these global variables from another class after instantiating this class they display as null values. this is the class which gets the 3 strings through the method setDate, and the mapping.. public class DateLogic { public string year1; public string month1; public string day1; public DateLogic() { } public void setDate(string year, string month, string day) { year1 = year; month1 = month; day1 = day; // getDate(); } public string getDate() { return year1 + " " + month1 + " " + day1; } } After this I try call this class from here public static string TimeLine2(this HtmlHelper helper, string myString2) { DateLogic g = new DateLogic(); string sday = g.day1; string smonth = g.month1; string syr = g.year1; } I've been debugging and the values make it all the way to the global variables but when called from this class here it doesnt show them, just shows null. Is this cause I'm creating a brand new instance, how do i resolve this?

    Read the article

  • JAVA: storing input into array

    - by Jann
    I need to write a program where the program would generate random letter and i would need to store this random character into an array char[] arrayRandom = new char[10]; for (int i = 0; i < 8; i++) { randomNumLet = (generator.nextInt(20) + 1); System.out.print(arrayRandomLetter[randomNumLet] + " "); arrayRandomLetter[randomNumLet] = arrayRandom[i]; } is there anything wrong with my code? because when i run this and printed the array i get boxes for all the values in the array and there are some letter that this line of code cannot print System.out.print(arrayRandomLetter[randomNumLet] + " "); Thanks

    Read the article

  • Storing data on server [closed]

    - by Maciekp
    1.How am I supposed to store data on server, using not only: databases,text files and images? And how someone could implement storing data in fb's graph api http://developers.facebook.com/docs/reference/api/ , so when I go to: https://graph.facebook.com/19292868552 it shows me such data(how it can be stored? I guess it's not Mysql database) PS. Link to article: http://jayant7k.blogspot.com/2009/05/how-facebook-stores-billions-of-photos.html <- How can concurrent users writing requests be solved(while storing data in text file).

    Read the article

  • storing map template in database

    - by Timigen
    I am working on an application that displays choropleth maps. These maps are of all different types, some display state by county, country by state/province, or world by country. How should I handle storing the map information in the database? My Thoughts: I won't need to do queries to find POI inside a region, so I don't think there is a need to use spatial datatypes. I am considering storing a map as a geoJSON object (I am using JS mapping library that accepts geoJSON). The only issue is what if I want a map of the US northeast. Then I would have geoJSON for the US and a separate one for the US northeast, which would be redundant. Would it make sense to have a shape database where I had each state then when I needed a map of the US I could query for each state, and when I needed a map of the US Northeast I could again query for what I need? Note: I am not concerned with storing the data for each region, just the region itself. I will query for the data on the fly for the specific region.

    Read the article

  • storing data for maps database

    - by Timigen
    I am working on an application that displays choropleth maps. These maps are of all different types, some display state by county, country by state/province, or world by country. How should I handle storing the map information in the database? My Thoughts: I won't need to do queries to find POI inside a region, so I don't think there is a need to use spatial datatypes. I am considering storing a map as a geoJSON object (I am using JS mapping library that accepts geoJSON). The only issue is what if I want a map of the US northeast. Then I would have geoJSON for the US and a separate one for the US northeast, which would be redundant. Would it make sense to have a shape database where I had each state then when I needed a map of the US I could query for each state, and when I needed a map of the US Northeast I could again query for what I need? Note: I am not concerned with storing the data for each region, just the region itself. I will query for the data on the fly for the specific region.

    Read the article

  • Using a permutation table for simplex noise without storing it

    - by J. C. Leitão
    Generating Simplex noise requires a permutation table for randomisation (e.g. see this question or this example). In some applications, we need to persist the state of the permutation table. This can be done by creating the table, e.g. using def permutation_table(seed): table_size = 2**10 # arbitrary for this question l = range(1, table_size + 1) random.seed(seed) # ensures the same shuffle for a given seed random.shuffle(l) return l + l # see shared link why l + l; is a detail and storing it. Can we avoid storing the full table by generating the required elements every time they are required? Specifically, currently I store the table and call it using table[i] (table is a list). Can I avoid storing it by having a function that computes the element i, e.g. get_table_element(seed, i). I'm aware that cryptography already solved this problem using block cyphers, however, I found it too complex to go deep and implement a block cypher. Does anyone knows a simple implementation of a block cypher to this problem?

    Read the article

  • Storing E-mail addresses more efficiently in SQL Server

    A lot of people are storing large quantities of e-mail addresses in their systems. Since a large percentage of any system's user base is going to be supplying e-mail addresses from a few of the vastly popular providers (such as GMail and Hotmail), we are storing the "@gmail.com" and "@hotmail.com" parts of those addresses on disk over and over and over again. Get smart with SQL Backup ProPowerful centralised management, encryption and more.SQL Backup Pro was the smartest kid at school. Discover why.

    Read the article

  • Advice for Storing and Displaying Dates and Times Across Different Time Zones

    A common question I receive from clients, colleagues, and 4Guys readers is for recommendations on how best to store and display dates and times in a data-driven web application. One of the challenges in storing and displaying dates in a web application is that it is quite likely that the visitors arriving at your site are not in the same time zone as your web server; moreover, it's very likely that your site attracts visitors from many different time zones from around the world. Consider an online messageboard site, like ASPMessageboard.com, where each of 1,000,000+ posts includes the date and time it was made. Imagine a user from New York leaves a post on April 7th at 4:30 PM and that the web server hosting the site is located in Dallas, Texas, which is one hour earlier than New York. When storing that post to the database do you record the post's date and time relative to the visitor (4:30 PM), the relative to the web server (3:30 PM), or some other value? And when displaying this post how do you show that date and time to a reader in San Francisco, which is three hours earlier than New York? Do you show the time relative to the person who made the post (4:30 PM), relative to the web server (3:30 PM), or relative to the user (1:30 PM)? And if you decide to store or display the date based on the poster's or visitor's time zone then how do you know their time zone and its offset? How do you account for daylight savings, and so on? This article provides guidance on how to store and display dates and times for visitors across different time zones and includes a demo that gives a working example of some of these techniques. Read on to learn more! Read More >

    Read the article

  • Storing User-uploaded Images

    - by Nyxynyx
    What is the usual practice for handling user uploaded photos and storing them on the database and server? For a user profile image: After receiving the image file from user, rename file to <image_id>_<username> Move image to /images/userprofile Add img filename to a table users containing their profile details like first_name, last_name, age, gender, birthday For a image for a review done by user: After receiving the image file from user, rename file to <image_id>_<review_id> Move image to /images/reviews Add img filename to a table reviews containing their profile details like review_id, review_content, user_id, score. Question 1: How should I go about storing the image filenames if the user can upload multiple photos for a particular review? Serialize? Question 2: Or have another table review_images with columns review_id, image_id, image_filename just for tracking images? Will doing a JOIN when retriving the image_filename from this table slow down performance noticeably? Question 3: Should all the images be stored in a single folder? Will there be a problem when we have 100K photos in the same folder? Is there a more efficient way to go about doing this?

    Read the article

  • Storing data offline with javascript

    - by Walker
    My question is about storing data offline and potentially whether I will need to bring in an outside programmer or could this be learned within a few weeks? The website I am working on will have an interface where users will login and go through a series of quizzes in the form of checkbox, drop down menus, and others. Each page/quiz area could have 20-100 total checkboxes in a series of 3-5 rows because of the comprehensive nature of course. This I can do - I know how to code the quiz and return a correct or incorrect answer based on each individual checkbox and present a cumulative score (ie: you got 57% correct). The issue lies in the fact that I would like to save the users results and keep them informed of their progress. When they complete all of the quizzes, I would like to have a visual output of their performance in each area. Storing the output from their results offline is where I think I may run into a problem with my lack of coding experience. I would also like to have a sidebar with their progress of each section (10-15) with a green percentage completion bar or a % correct which would draw from this. I have never had to code something that stores information like this offline - so back to my question - would it be better to learn the language needed or bring in a coder/developer for the back end stuff.

    Read the article

  • Google I/O 2012 - Storing Data in Google Apps Script

    Google I/O 2012 - Storing Data in Google Apps Script Drew Csillag This session covers the different ways in which developers can store data when using Google Script. We'll break things down by use case, and then show examples of how to use the different options: spreadsheet, Script/User Properties, JDBC connector, and distribution. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 24 1 ratings Time: 41:48 More in Science & Technology

    Read the article

  • Storing and Finding Art Assets

    - by ashes999
    I've started down a line of art asset development that will allow me to (hopefully) reuse and improve assets for several games. But how do I go about storing and finding them? Let's say for example I decide to focus on RPGs for ~2 years. I would create items, monsters, etc. and store them somewhere. How would I categorize them and make them easier to search later on? Is the best solution "use directories with broad categories like landscape/items/monsters/etc.?"

    Read the article

  • Advice for Storing and Displaying Dates and Times Across Different Time Zones

    A common question I receive from clients, colleagues, and 4Guys readers is for recommendations on how best to store and display dates and times in a data-driven web application. One of the challenges in storing and displaying dates in a web application is that it is quite likely that the visitors arriving at your site are not in the same time zone as your web server; moreover, it's very likely that your site attracts visitors from many different time zones from around the world.Consider an online messageboard site, like <a href="http://www.aspmessageboard.com/">ASPMessageboard.com</a>, where each of 1,000,000+ posts includes the date and time it was made. Imagine a user from New York leaves a post on April 7th at 4:30 PM and that the web server hosting the site

    Read the article

  • Storing lots of large strings with frequent "appends" and few reads

    - by Thiago Moraes
    In my current project, I need to store a very long ASCII string to each instance of a given object. This string will receive an 2 appends per minute and will not be retrieved so frequently. The worst case scenario is a 5-10MB string. I'll have thousands of instances of my object and I'm worried that storing all those strings in the filesystem would not be optimal, but I can't think of a better solution. Can anyone suggest an alternative? Maybe a key-value store? In this case, which one? Any other thoughts?

    Read the article

  • The Best Apps and Cloud Services for Taking, Storing, and Sharing Notes

    - by Lori Kaufman
    Is your desk and computer covered with sticky notes? Do you have miscellaneous pieces of paper with bits of information buried in drawers, your laptop case, backpack, purse, etc.? Get rid of all the chaos and get organized with note-taking software and services. We’ve collected a list of the best desktop applications and cloud-based services for taking, storing, and sharing information. How To Customize Your Wallpaper with Google Image Searches, RSS Feeds, and More 47 Keyboard Shortcuts That Work in All Web Browsers How To Hide Passwords in an Encrypted Drive Even the FBI Can’t Get Into

    Read the article

  • Storing documents in DMS

    - by Shaza
    I need your opinions and suggestions about storing documents in a DMS system. I think the DMS should save its own copies of the documents, not their original path on the disk. So, the DMS should have its own space to write on. But what about the way they're stored? Do they have their own extension different from the original one? What about the algorithm that stores them? What about the algorithm that retrieves them? What do you suggest??

    Read the article

  • Web App for storing and organize programming information?

    - by Fabzter
    So, I've found myself, after several years of coding (I consider myself a coder, rather than a programmer) full of links and loose snippets and coding tips, all dispersed across the web. In such way it is barely usable, even when every bit is important or interesting. I thought of simply storing the links in delicious or something alike, but it's not really the links I want to keep, I just need the succinth info. So I was thinking to use some web app, something like a wiki, maybe much more simple, so I could access it though my mobile if I need it. I could code it, but as I stated it before, I'm more of a code monkey, and I'm sure my solution would be far from decent... Can anyone give me recommendations on this?

    Read the article

  • Storing Projects on Google Drive (Cloud)

    - by JamesKraw
    I've started using Google Drive for my cloud needs and backing up pretty much everything. I've got the app installed so it auto-sync's all my content in most things. My question is this, I am currently coding for iOS (although this applies to any coding project) and am split on storing my project files on Google Drive while using sync. My theory is that if I did use it, I'd never have to worry about system crashes or lost code before backups, but if I do use it it will be sync'ing a-lot and I thought there might be problems with it detecting changes and trying to sync for example half way through compiling. Bandwidth isn't an issue as I have fast connection and unlimited monthly allowance. Has anyone ever used this, or similar cloud-based sync'ing (dropbox etc) for this and knows whether it works or not or whether there are any potential problems etc.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >