Search Results

Search found 2313 results on 93 pages for 'twice'.

Page 13/93 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Drupal: re-use same CCK Field in the same content type

    - by Patrick
    hi, I need a sequence of text, image, video CCK fields, repeated twice in my content type. I need to create 2 different groups (I don't want to use multi-upload functionality). I was wondering if I have to create a new field Image - File Upload for the second group, or I can somehow to re-use the first one (which is already added, and I would like to add it twice in the second group as well). thanks

    Read the article

  • Python named print?

    - by Mark
    I know it's a really simple question, but I have no idea how to google it. how can I do print '<a href="%s">%s</a>' % (my_url) So that my_url is used twice? I assume I have to "name" the %s and then use a dict in the params, but I'm not sure of the proper syntax? just FYI, I'm aware I can just use my_url twice in the params, but that's not the point :)

    Read the article

  • php json encode

    - by hafizan
    This below output come from php json_encode.What we see here is 0849 is twice.Since javascript only use sn to get value why we need the "0" value.The main problem is speed execution. If 800 kb data might can be reduce to 400 kb {"success":"true","total":968,"data":[{"0":"0849","sn":"0849" }] If no solution i have to make a script to filter in json_encode so no need twice data transter.

    Read the article

  • Workaround for JFormattedTextField delete bug in Java for Mac OS X 10.6 Update 2 (1.6.0_20)

    - by Johan Kaving
    There is apparently a bug introduced in the latest Java update for Mac OS X, which causes deletes in JFormattedTextFields to be performed twice. See http://lists.apple.com/archives/java-dev/2010/May/msg00092.html The DefaultEditorKit.deletePrevCharAction is invoked twice when the delete key is pressed. Are there any suggestions for a workaround? I'm thinking of replacing the delete action for my text fields with a patched version that somehow filters out these duplicate invocations.

    Read the article

  • How to reverse items in WPF Datagrid?

    - by irf1x
    If i have DataGrid which looks like: Col 1 Col 2 ------- ------- 1 a 2 b 3 c ... ... n n Can the order be reversed easily without sorting? So that n is first, and 1 is last. I have custom sort implemented from this article, but sorting the same column twice in a row calls sorting function twice (which is slow), so just reversing the order should be faster and have the same effect.

    Read the article

  • asp.net Multiple Page_Load events for a user control when using URL Routing

    - by Paul Hutson
    Hello, I've recently set up an ASP.net site (not using MVC.net) to use URL Routing (more on the code below) - when using user controls on the site (i.e I've created a "menu" user control to hold menu information) the page_load event for that control will fire twice when URLs have more than one variable passed over. i.e. pageName/VAR1 : will only fire the page_load event once. while pageName/VAR1/VAR2 : will fire the page_load event twice. *Multiple extra VARs added on the end will still only fire the page_load event twice*. Below are the code snippits from the files, the first is the MapPageRoute, located in the Global.asax : // Register a route for the Example page, with the NodeID and also the Test123 variables allowed. // This demonstrates how to have several items linked with the page routes. routes.MapPageRoute( "Multiple Data Example", // Route name "Example/{NodeID}/{test123}/{variable}", // Route URL - note the NodeID bit "~/Example.aspx", // Web page to handle route true, // Check for physical access new System.Web.Routing.RouteValueDictionary { { "NodeID", "1" }, // Default Node ID { "test123", "1" }, // Default addtional variable value { "variable", "hello"} // Default test variable value } ); Next is the way I've directed to the page in the menu item, this is a list item within a UL tag : <li class="TopMenu_ListItem"><a href="<%= Page.GetRouteUrl("Multiple Data Example", new System.Web.Routing.RouteValueDictionary { { "NodeID", "4855" }, { "test123", "2" } }) %>">Example 2</a></li> And finally the control that gets hit multiple times on a page load : // For use when the page loads. protected void Page_Load(object sender, EventArgs e) { // Handle the routing variables. // this handles the route data value for NodeID - if the page was reached using URL Routing. if (Page.RouteData.Values["NodeID"] != null) { nodeID = Page.RouteData.Values["NodeID"] as string; }; // this handles the route data value for Test123 - if the page was reached using URL Routing. if (Page.RouteData.Values["Test123"] != null) { ExampleOutput2.Text = "I am the output of the third variable : " + Page.RouteData.Values["Test123"] as string; }; // this handles the route data value for variable - if the page was reached using URL Routing. if (Page.RouteData.Values["variable"] != null) { ExampleOutput3.Text = "I say " + Page.RouteData.Values["variable"] as string; }; } Note, that when I'm just hitting the page and it uses the default values for items, the reloads do not happen. Any help or guidance that anyone can offer would be very much appreciated! EDIT : The User Control is only added to the page once. I've tested the load sequence by putting a breakpoint in the page_load event - it only hits twice when the extra routes are added. Thanks in Advance, Paul Hutson

    Read the article

  • iPhone ShouldStartLoad fires once per click?

    - by BahaiResearch.com
    In my UIWebView when an anchor is clicked I catch it in ShouldStartLoad and always return false to cancel it. (I treat the clicks as command to do things) Strangely the ShouldStartLoad only fires once if the same anchor is clicked more than once in a row. Eg: Click "A", Click "A" - ShouldStartLoad receives "A" once Click "A", Click "B", Click "A" - ShouldStartLoad receives "A", then "B" then "A" Is there a way to make ShouldStartLoad receive "A" twice when clicked twice in a row?

    Read the article

  • jQuery Sortable Cannot Click After Sort Issue

    - by Johan
    I have a table that is being sorted by the TR tags, everything works fine except that I have to click twice on any item in the list after something has been moved for anything to respond, on links etc. Do I have to call some function after the list has been sorted to re-activate it so that I don't have to click twice on items?

    Read the article

  • Multi Module Project - Assembly plugin

    - by user209947
    I am using Maven 2.0.9 to build a multi module project. I have defined the assembly plugin in my parent pom. I can get my assemblies built using mvn install assembly:assembly This command runs the tests twice, once during install phase and another during assembly. I tried assembly:single but it throws an error. Any help to get my assemblies built without running the tests twice is much appreciated.

    Read the article

  • Scaling vectors from a center point?

    - by user146780
    I'm trying to figure out if I have points that make for example a square: * * * * and let's say I know the center of this square. I want a formula that will make it for eample twice its size but from the center * * * * * * * * Therefore the new shape is twice as large and from the center of the polygon. It has to work for any shape not just squares. I'm looking more for the theory behind it more than the implementation. Thanks

    Read the article

  • Trivial Q about redefinition.

    - by Knowing me knowing you
    Why this isn't allowed: int a = 0; int a = 0; but this is: for (int i = 0; i < 2; ++i) { int a = 0; } As far as I know code inside for loop will be executed twice whitout actually going out of its scope, so it should also be an error to define a twice. Looking forward to your answers Thanks.

    Read the article

  • Organization &amp; Architecture UNISA Studies &ndash; Chap 6

    - by MarkPearl
    Learning Outcomes Discuss the physical characteristics of magnetic disks Describe how data is organized and accessed on a magnetic disk Discuss the parameters that play a role in the performance of magnetic disks Describe different optical memory devices Magnetic Disk The way data is stored on and retried from magnetic disks Data is recorded on and later retrieved form the disk via a conducting coil named the head (in many systems there are two heads) The writ mechanism exploits the fact that electricity flowing through a coil produces a magnetic field. Electric pulses are sent to the write head, and the resulting magnetic patterns are recorded on the surface below with different patterns for positive and negative currents The physical characteristics of a magnetic disk   Summarize from book   The factors that play a role in the performance of a disk Seek time – the time it takes to position the head at the track Rotational delay / latency – the time it takes for the beginning of the sector to reach the head Access time – the sum of the seek time and rotational delay Transfer time – the time it takes to transfer data RAID The rate of improvement in secondary storage performance has been considerably less than the rate for processors and main memory. Thus secondary storage has become a bit of a bottleneck. RAID works on the concept that if one disk can be pushed so far, additional gains in performance are to be had by using multiple parallel components. Points to note about RAID… RAID is a set of physical disk drives viewed by the operating system as a single logical drive Data is distributed across the physical drives of an array in a scheme known as striping Redundant disk capacity is used to store parity information, which guarantees data recoverability in case of a disk failure (not supported by RAID 0 or RAID 1) Interesting to note that the increase in the number of drives, increases the probability of failure. To compensate for this decreased reliability RAID makes use of stored parity information that enables the recovery of data lost due to a disk failure.   The RAID scheme consists of 7 levels…   Category Level Description Disks Required Data Availability Large I/O Data Transfer Capacity Small I/O Request Rate Striping 0 Non Redundant N Lower than single disk Very high Very high for both read and write Mirroring 1 Mirrored 2N Higher than RAID 2 – 5 but lower than RAID 6 Higher than single disk Up to twice that of a signle disk for read Parallel Access 2 Redundant via Hamming Code N + m Much higher than single disk Highest of all listed alternatives Approximately twice that of a single disk Parallel Access 3 Bit interleaved parity N + 1 Much higher than single disk Highest of all listed alternatives Approximately twice that of a single disk Independent Access 4 Block interleaved parity N + 1 Much higher than single disk Similar to RAID 0 for read, significantly lower than single disk for write Similar to RAID 0 for read, significantly lower than single disk for write Independent Access 5 Block interleaved parity N + 1 Much higher than single disk Similar to RAID 0 for read, lower than single disk for write Similar to RAID 0 for read, generally  lower than single disk for write Independent Access 6 Block interleaved parity N + 2 Highest of all listed alternatives Similar to RAID 0 for read; lower than RAID 5 for write Similar to RAID 0 for read, significantly lower than RAID 5  for write   Read page 215 – 221 for detailed explanation on RAID levels Optical Memory There are a variety of optical-disk systems available. Read through the table on page 222 – 223 Some of the devices include… CD CD-ROM CD-R CD-RW DVD DVD-R DVD-RW Blue-Ray DVD Magnetic Tape Most modern systems use serial recording – data is lade out as a sequence of bits along each track. The typical recording used in serial is referred to as serpentine recording. In this technique when data is being recorded, the first set of bits is recorded along the whole length of the tape. When the end of the tape is reached the heads are repostioned to record a new track, and the tape is again recorded on its whole length, this time in the opposite direction. That process continued back and forth until the tape is full. To increase speed, the read-write head is capable of reading and writing a number of adjacent tracks simultaneously. Data is still recorded serially along individual tracks, but blocks in sequence are stored on adjacent tracks as suggested. A tape drive is a sequential access device. Magnetic tape was the first kind of secondary memory. It is still widely used as the lowest-cost, slowest speed member of the memory hierarchy.

    Read the article

  • How can I load file into web app through certain periods?

    - by Elena
    Hi all! I have next task: I need to load the same file into my web app several times, for example - twice a day! Suppose in that file I have information, that changes, and I need to load this info into my app to change the statistics for example. How can I load file several times (twice an hour, or twice a day)? What should I use? Is any algorithm to do that? I am not allowed to use external libraries like Quartz Scheduler. So I need to do it with Thread and/or Timer. Can anybody give me some example or algorithm how to do it. Where can I create the entry point to my Thread, can I do it in managed bean or I need some sort of filter/listener/servlet. I works with jsf and richFaces. Maybe in this technologies there are some algorithms to solve my problem. Any ideas? Thanks very much for help!

    Read the article

  • Best practice PHP Form Action

    - by Rob
    Hi there i've built a new script (from scratch not a CMS) and i've done alot of work on reducing memory usage and the time it takes for the page to be displayed (caching HTML etc) There's one thing that i'm not sure about though. Take a simple example of an article with a comments section. If the comment form posts to another page that then redirects back to the article page I won't have the problem of people clicking refresh and resending the information. However if I do it that way, I have to load up my script twice use twice as much memory and it takes twice as long whilst i'm still only displaying the page once. Here's an example from my load log. The first load of the article is from the cache, the second rebuilds the page after the comment is posted. Example 1 0 queries using 650856 bytes of memory in 0.018667 - domain.com/article/1/my_article.html 9 queries using 1325723 bytes of memory in 0.075825 - domain.com/article/1/my_article/newcomment.html 0 queries using 650856 bytes of memory in 0.029449 - domain.com/article/1/my_article.html Example 2 0 queries using 650856 bytes of memory in 0.023526 - domain.com/article/1/my_article.html 9 queries using 1659096 bytes of memory in 0.060032 - domain.com/article/1/my_article.html Obviously the time fluctuates so you can't really compare that. But as you can see with the first method I use more memory and it takes longer to load. BUT the first method avoides the refresh problem. Does anyone have any suggestions for the best approach or for alternative ways to avoid the extra load (admittadely minimal but i'd still like to avoid it) whilst also avoiding the refresh problem?

    Read the article

  • JQuery with css3 keydown keyCode = 37 and 39

    - by rayrule
    I have tested both ways. jquery animation and css3 transition, and css3 is a little bit faster. But i have a problem with the following code: $(document).keydown(function(e){ if (e.keyCode == 39) { var DocHeight = $(document).height(); $('.container').css("margin-top","-="+DocHeight) } }); if i hit twice on keyCode 39 (arrow to the right) than my transition is outer space. Does anyone has an solution for this thing? outer space maybe not the correct word. But the problem is. if i hit twice the arrow key i'll get the last request, in other words... animation is started, and another animation start from the position that i don't want. example: hit #1 margin-top is at 0px and goes to 1024px. but when i hit it twice the margin-top is at 23px, and it stops at 1047px. This is not what i want. It has to stop at 1024px. I hope so.

    Read the article

  • I need some ideas on my algortihm for a Hit Counter

    - by stckvrflw
    My algorithm is for a hit count, I am tring to not count for the same person twice if that person came to the site twice in a time internval (For example if he comes twice in 5 minutes, I want to count it as 1 for this person) Here how my database looks like UserIp UserId Date of user came 127.0.0.1 new.user.akb 26.03.2010 10:15:44 127.0.0.1 new.user.akb 26.03.2010 10:16:44 127.0.0.1 new.user.akb 26.03.2010 10:17:44 127.0.0.1 new.user.akb 26.03.2010 10:18:44 127.0.0.1 new.user.akb 26.03.2010 10:19:44 127.0.0.1 new.user.akb 26.03.2010 10:20:44 127.0.0.1 new.user.akb 26.03.2010 10:21:44 127.0.0.1 new.user.akb 26.03.2010 10:22:44 127.0.0.1 new.user.akb 26.03.2010 10:23:44 What I need to do is get number of distinct UserIPs from the table above that occured within a time interval. For example if I set the time interval for 5 minutes, and let say that is starts at 26.03.2010 10:15:44 Then I will get 2 as the results, since 1 distinct value between 10:15 to 10:20 and , 1 distinct value from 10:20 to 10:23, For example if my interval is 3 minutes than the return result will be 3 Thanks.

    Read the article

  • Python logging in Django

    - by Jeff
    I'm developing a Django app, and I'm trying to use Python's logging module for error/trace logging. Ideally I'd like to have different loggers configured for different areas of the site. So far I've got all of this working, but one thing has me scratching my head. I have the root logger going to sys.stderr, and I have configured another logger to write to a file. This is in my settings.py file: sviewlog = logging.getLogger('MyApp.views.scans') view_log_handler = logging.FileHandler('C:\\MyApp\\logs\\scan_log.log') view_log_handler.setLevel(logging.INFO) view_log_handler.setFormatter(logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')) sviewlog.addHandler(view_log_handler) Seems pretty simple. Here's the problem, though: whatever I write to the sviewlog gets written to the log file twice. The root logger only prints it once. It's like addHandler() is being called twice. And when I put my code through a debugger, this is exactly what I see. The code in settings.py is getting executed twice, so two FileHandlers are created and added to the same logger instance. But why? And how do I get around this? Can anyone tell me what's going on here? I've tried moving the sviewlog logger/handler instantiation code to the file where it's used (since that actually seems like the appropriate place to me), but I have the same problem there. Most of the examples I've seen online use only the root logger, and I'd prefer to have multiple loggers.

    Read the article

  • Two "Calendar" entries listed on iPad - can't write to calendar using EventKit

    - by Neal
    My iOS app integrates with the device's calendar. On my iPad when I view the calendar app and tap the Calendars button on the top left to choose which calendars to show I see one entry named "Calendar". In my app when I loop through available calendars per the code below "Calendar" is listed twice. One is CalDAV for the type, the other is Local. I'm unable to create calendar entries in one of them, I believe the "Local" one, not sure why. Why do I see "Calendar" listed twice when I do NOT see it listed twice in the iCal app? public static List<string> Calendars { get { var calendars = new List<string>(); var ekCalendars = EventStore.Calendars; if (ekCalendars != null && ekCalendars.Length > 0) { foreach (EKCalendar cal in ekCalendars) { if (cal.AllowsContentModifications) calendars.Add(cal.Title); } calendars.Sort(); } return calendars; } }

    Read the article

  • How can I distribute x cakes amongst y people?

    - by Rupert
    I have an associative array with the ids of x cakes and another associative array with the ids of y people. I want to ensure that each cake is enjoyed by exactly 2 people and that each person gets a fair share of cake overall. However, cakes must be kept whole (i.e. if the average cake per person is a fraction, this fraction will be rounded up for some, and down for others). No person can be assigned the same cake twice. For example: $cake = array('id'=>'1','id'=>'2') $people = array('id'=>'1','id'=>'2','id'=>'3') In order to do so, I wish to create a new array where each row represents a cake-person assignment. As each cake is being assigned to two people, the number of rows in this table should be exactly twice the number of cakes. There will not be exactly 1 solution to this problem but a solution to the above example would be: $cake_person = array( '1'=>array('cake_id'=>'1', 'person_id'=>'1'), '2'=>array('cake_id'=>'1', 'person_id'=>'2'), '3'=>array('cake_id'=>'2', 'person_id'=>'2'), '4'=>array('cake_id'=>'2', 'person_id'=>'3'), ) Notice that people 1 and 3 are losing out but that is because there is no more cake to go around! Each cake must be given exactly twice. How can I generate such a solution reliably for larger numbers of people and cakes?

    Read the article

  • Game design flaw, need help investigating

    - by Snake
    I am not sure if I will be able to get help here but I would give it a shot. The problem is I dont know where the problem is. I have a cards game, in which when you "human" play by dragging a card, then at the end of card being dragged, a handler using postExecute is called with delay of 0.5 sec to start the next player in turn (which is a bot) The bot chooses the color and plays it and at the end of the animation (the card moving to the middle) a handler is started for the next bot and so on. Once the play reaches again to the human player, it waits for his touchs to drag the crad and start the cycle again. The problem that in production, sometimes I am getting errors. The error is resulting in somehow messing up the sequence which ends up with players having more cards than others. After investigation, I found that the transition from human to bot is the problem. Somehow, the transition is happening twice (meaning handler calling post execute twice and the bot is playing twice and everything is messed up). Its been mutliple months and I can't reproduce it (to fix it) and I cna't figure out why this is happeneing? ANY IDEA how I can go after it? How can I get more info about or how can I solve something like that? any pointer would help me

    Read the article

  • Nginx Retry of Requests ( Nginx - Haproxy Combination )

    - by vaibhav
    I wanted to ask about Nginx Retry of Requests. I have a Nginx running at the backend which then sends the requests to HaProxy which then passes it on the web server and the request is processed. I am reloading my Haproxy config dynamically to provide elasticity. The problem is that the requests are dropped when I reload Haproxy. So I wanted to have a solution where I can just retry that from Nginx. I looked through the proxy_connect_timeout, proxy_next_upstream in http module and max_fails and fail_timeout in server module. I initially only had 1 server in the upstream connections so I just that up twice now and less requests are getting dropped ( only when ) have say the same server twice in upstream , if I have same server 3-4 times drops increase ). So , firstly I wanted to now , that when a request is not able to establish connection from Nginx to Haproxy so while reloading it seems that conneciton is seen as error and straightway the request is dropped . So how can I either specify the time after the failure I want to retry the request from Nginx to upstream or the time before which Nginx treats it as failed request. ( I have tried increaing proxy_connect_timeout - didn't help , mail_retires , fail_timeout and also putting the same upstream server twice ( that gave the best results so far ) Nginx Conf File upstream gae_sleep { server 128.111.55.219:10000; } server { listen 8080; server_name 128.111.55.219; root /var/apps/sleep/app; # Uncomment these lines to enable logging, and comment out the following two #access_log /var/log/nginx/sleep.access.log upstream; error_log /var/log/nginx/sleep.error.log; access_log off; #error_log /dev/null crit; rewrite_log off; error_page 404 = /404.html; set $cache_dir /var/apps/sleep/cache; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://gae_sleep; client_max_body_size 2G; proxy_connect_timeout 30; client_body_timeout 30; proxy_read_timeout 30; } location /404.html { root /var/apps/sleep; } location /reserved-channel-appscale-path { proxy_buffering off; tcp_nodelay on; keepalive_timeout 55; proxy_pass http://128.111.55.219:5280/http-bind; } }

    Read the article

  • Mac Mini's internet very slow, every other device fine (PC, iPhone, Xbox 360)

    - by alex
    I recently haven't used my Mac Mini for about 5 days (however it was left on). I seem to be able to connect and get great download / upload speeds through my PC, Xbox 360, iPhone and parents' laptop. However, my Mac Mini is very slow. OS X's Mail.app is downloading mail at 0.4kbps and then dropping to 0. Skype file transfers are doing the same. Browsing the net is a terrible experience. It is taking 30 seconds or more to download basic pages. All of my devices connect wirelessly to a Netgear router / modem. I have tried giving the Mac Mini a manual IP, and renew DHCP lease, as well as flush DNS in Terminal. I have also rebooted the router / modem twice, and the Mac Mini twice. Do you know what could be causing this? Thanks

    Read the article

  • ProFTPd with sftp first login fails, seconds succeeds

    - by Nahrub
    We are working with ProFTPd and SFTP module enabled. We have a problem with using the sftp module. When we try to connect to server in FileZilla we need to enter the password to the server twice, upon connection and upon each file upload, which is very undesired. How can we help this? any idea's? suggestions? when we use the interactive login type in FileZilla, it works when we enter the username and password twice.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >