Daily Archives

Articles indexed Thursday December 23 2010

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

  • Is there a way to toggle bluetooth and/or wifi on and off programatically in iOS?

    - by Andy W
    I am looking for an easy way to toggle both bluetooth and wifi between on and off states on iOS 4.x devices (iPhone and iPad). I am constantly toggling these functions as I move between different locations and usage scenarios, and right now it takes multiple taps and visits to the Settings App. I am looking to create a simple App, that lives on Springboard, that I can just tap and it will turn off the wifi if it's on, and vice versa, then immediately quit. Similarly with an App for toggling bluetooth’s state. I have the developer SDK, and am comfortable in Xcode and with iOS development, so am happy to write the required Xcode to create the App. I am just at a loss as to which API, private or not, has the required functionality to simply toggle the state of these facilities. Because this is scratching a very personal itch, I have no intent to try and sell the App or get it up on the App store, so conforming with App guidelines on API usage is a non-issue. What I don’t want to do is jailbreak the devices, as I want to keep the core software as shipped. Can anyone point me at some sample code or more info on achieving this goal, as my Google-fu is letting me down, and if the information is out there for 4.x devices I just can’t find it.

    Read the article

  • Which languages and techniques can I use to improve my coding practices?

    - by Danjah
    I've been offered the opportunity upskill through study, while at work which is great. My background I am mostly self-taught, but have worked with many excellent people over the years - both self-taught and fully educated, and on many decent projects. I have mild experience in Actionscript, I'm getting better every day with my Javascript, and my CSS is angled at best practice, but needs a bit of modernising. I'm a traditional interface developer, I'm not stupid and I like a challenge. My goal I need to start seeing ways of applying better logic, optimising code, refactoring, different styles of development (agile, others?), and.. well I need to try and start thinking like.. a more solid programmer. Its hard to describe, I have good solutions and I'm efficient - but I KNOW that there's a bunch I am missing. I am already employed with a solid career, but I feel the need to fill gaps. My question/s Are there a set of guiding principles you can recommend I focus on to improve the points above? Are there particular programming languages which I might focus on to get a broader overview? Do you think I should avoid particular styles of development, or even languages, while solidifying what might end up being part 'the basics' but hopefully 'advanced programming'? -- Sorry if this appears off topic or something but I figure you're probably some of the best people to ask.

    Read the article

  • Django - Check users messages every request

    - by Hanpan
    Hi, I want to check if a user has any new messages each time they load the page. Up until now, I have been doing this inside of my views but it's getting fairly hard to maintain since I have a fair number of views now. I assume this is the kind of thing middleware is good for, a check that will happen every single page load. What I need it to do is so: Check if the user is logged in If they are, check if they have any messages Store the result so I can reference the information in my templates Has anyone ever had to write any middleware like this? I've never used middleware before so any help would be greatly appreciated.

    Read the article

  • Using NULLs in matchup table

    - by TomWilsonFL
    I am working on the accounting portion of a reservation system (think limo company). In the system there are multiple objects that can either be paid or submit a payment. I am tracking all of these "transactions" in three tables called: tx, tx_cc, and tx_ch. tx generates a new tx_id (for transaction ID) and keeps the information about amount, validity, etc. Tx_cc and tx_ch keep the information about the credit card or check used, respectively, which link to other tables (credit_card and bank_account among others). This seems fairly normalized to me, no? Now here is my problem: The payment transaction can take place for a myriad of reasons. Either a reservation is being paid for, a travel agent that booked a reservation is being paid, a driver is being paid, etc. This results in multiple tables, one for each of the entities: agent_tx, driver_tx, reservation_tx, etc. They look like this: CREATE TABLE IF NOT EXISTS `driver_tx` ( `tx_id` int(10) unsigned zerofill NOT NULL, `driver_id` int(11) NOT NULL, `reservation_id` int(11) default NULL, `reservation_item_id` int(11) default NULL, PRIMARY KEY (`tx_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Now this transaction is for a driver, but could be applied to an individual item on the reservation or the entire reservation overall. Therefore I demand either reservation_id OR reservation_item_id to be null. In the future there may be other things which a driver is paid for, which I would also add to this table, defaulting to null. What is the rule on this? Opinion? Obviously I could break this out into MANY three column tables, but the amount of OUTER JOINing needed seems outrageous. Your input is appreciated. Peace, Tom

    Read the article

  • Translate imperative control flow with break-s/continue-s to haskell

    - by dorserg
    Consider the following imperative code which finds the largest palindrome among products of 3-digit numbers (yes, it's the one of the first tasks from "Project of [outstanding mathematician of 18th century]" site): curmax = 0 for i in range(999,100): for j in range(999,100): if ((i*j) < curmax): break if (pal(i*j)): curmax = i*j break print curmax As I'm learning Haskell currently, my question is, how do you translate this (and basically any imperative construct that contains something more complex than just plain iteration, e.g. breaks, continues, temporary variables and all this) to Haskell? My version is maxpal i curmax | i < 100 = curmax | otherwise = maxpal (i-1) (innerloop 999) where innerloop j | (j < 100) || (p < curmax) = curmax | pal p = p | otherwise = innerloop (j-1) where p = i*j main = print $ maxpal 999 0 but this looks like we're still in imperative uglytown. So what could you advise, what are the approaches of dealing with such cases FP-style?

    Read the article

  • Java convert JSONObject to URL parameter

    - by Alex Ivasyuv
    What is the elegant way to convert JSONObject to URL parameters. For example, JSONObject: {stat: {123456: {x: 1, y: 2}, 123457: {z: 5, y: 2}}}} this should be like: stat[123456][x]=1&stat[123456][y]=2&stat[123457][z]=5&stat[123457][y]=2 of course with escaped symbols, and of course JSON object could be more complicated.. Maybe there already exist some mechanisms for that? Thanks,

    Read the article

  • Send Click Message to another application process

    - by Nazar
    Hi Guys I have a scenario, i need to send click events to an independent application. I started that application with the following code. private Process app; app = new Process(); app.StartInfo.FileName = app_path; app.StartInfo.WorkingDirectory = dir_path; app.Start(); Now i want to send Mouse click message to that applicaiton, I have specific coordinates in relative to application window. How can i do it using Windows Messaging or any other technique. I used [DllImport("user32.dll")] private static extern void mouse_event(UInt32 dwFlags, UInt32 dx, UInt32 dy, UInt32 dwData, IntPtr dwExtraInfo); It works well but cause the pointer to move as well. So not fit for my need. Then i use. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); It works well for minimize maximize, but do not work for mouse events. The codes for mousevents i am using are, WM_LBUTTONDOWN = 0x201, //Left mousebutton down WM_LBUTTONUP = 0x202, //Left mousebutton up WM_LBUTTONDBLCLK = 0x203, //Left mousebutton doubleclick WM_RBUTTONDOWN = 0x204, //Right mousebutton down WM_RBUTTONUP = 0x205, //Right mousebutton up WM_RBUTTONDBLCLK = 0x206, //Right mousebutton do Thanks for the help in advance, and waiting for feedback.

    Read the article

  • flex: is there a way to dispach a custom event from one loaded flex application to the other ?

    - by ufk
    Hello. I have an HTML page that loads two different SWF files. is there a way to dispatch a custom event from one flex application to another ? to create a custom event I extend the Event class and I add another variable to the constructor called params which is an Object. I use EventDispatcher to dispatch the events. I have no idea how to do that between one flex application to the other. is it even possible ? If it's not, is there any other way that these two flex applications can communicate without opening a LocalConnection ? Using flex 4.5 thanks!

    Read the article

  • Monitoring HP and Dell hardware in Gentoo.

    - by ewwhite
    I'm working in an environment that features a large number of Gentoo servers running on HP ProLiant and Dell PowerEdge equipment. While I've moved some of these systems to RedHat or CentOS for consistency, I'm still left with a good number of systems that will remain Gentoo. One of the issues I see with the Gentoo arrangement is lack of vendor-supported hardware monitoring. There doesn't seem to be an equivalent to the HP ProLiant Support Pack or Dell's agents for Gentoo. Is this simply something that you give up when using this distribution? How do you monitor hardware health and the like with Gentoo systems?

    Read the article

  • ability to see free/busy detail information for conference rooms in Outlook 2007 and Microsoft hosted Exchange solution

    - by Malav
    recently my company migrated from an in-house Exchange server to the Microsoft hosted exchange online solution. My client is Outlook 2007. Before the migration, I could see the details of the meetings when I hovered on the busy blue bar for a resource such as a conference room. I could click on the meetings and see the invite list and the contents of the meeting. Ofcourse if the meeting was marked as private I could not. however after the migration to the online solution, I cannot see the detailed information. I can still see if the room is busy or not but I can no longer see the details of that meeting. The IT folks can see the information and they claim that they can see it because they have full admin rights. It is their claim that in the hosted Exchange solution you can either have full access (admin access) and see the details or not see anything but just that the room is busy. there is no middle ground such as being able to see the details of the meeting but not having any admin rights. For some reason I believe this to be not true. Can someone please verify my doubts and inform me of what needs to be done to see that information if my IT folks are wrong? thanks

    Read the article

  • SharePoint doesn't support this authentication scheme.

    - by EtherDragon
    I have a new Windows Phone 7 phone, and I'm trying to investigate how to connect the Office application to our SharePoint site(s). In the Office application, on Phone 7, I flip to the SharePoint page. I go to open URL, and enter the url for one of my sites, that uses default authentication (Windows Auth). I get a message: Can't open SharePoint doesn't support this authentication scheme. For assistance, contact the person who manages thus SharePoint site (That would be me). You can try opening the content in your web browser instead. When opening in my browser, I can access the content without any problem. (Windows Auth passes) Anyone have any source material on what I should do to my SharePoint site to "support this authentication scheme?" Note: I am the administrator of our SharePoint server farm(s).

    Read the article

  • openLdap for windows and phpldapadmin

    - by Dr Casper Black
    Hi, Im having a problem connecting all of this. Im new to Ldap and after failing to install all of this on Ubuntu 10.04 Im trying to set it up on my local PC. I installed OpenLdap for windows http://www.userbooster.de/en/download/openldap-for-windows.aspx, Enabled the php5.3.1 extension for ldap (c:\xampp\php\ext\php_ldap.dll) in php.ini Copied the ssleay32.dll and libeay32.dll to Windows\System32 & Windows\System (Windows XP) Set the password generated by c:\Program Files\OpenLDAP\slappasswd.exe in c:\Program Files\OpenLDAP\slapd.conf (rootpw {SSHA}hash) run the c:\Program Files\OpenLDAP\slapd.exe Install phpldapadmin and call https:// 127.0.0.1 / phpldapadmin/ when I enter the credentials i get Invalid credentials (49) for user and in openldap.log i get could not stat config file "%SYSCONFDIR%\slapd.conf": No such file or directory (2) Can someone help.

    Read the article

  • Dialing into multiple PPP connections on Ubuntu

    - by sharjeel
    I have multiple 3G USB based Modems. I would like them to keep connected simultaneously, NOT necessarily aggregating their bandwidth; a separate intelligent application would manage their utilization effectively. However I am running into problem of setting up proper routes for the ppp0,ppp1 interfaces: when one of them connects, other's entries in the routing table get updated so it is no more usable. If I reconnect the second one, it would override the first one's routing entries. If I do it over and over, sometimes both of them's entries disappear while in rare cases the two work well. I have tried it both using NetworkManager as well as WVDial but issue pops up in both of these. Perhaps both of them use same PPP dialer at the backend and thats why this issue appears. What is the proper solution to make them work together? In the long run, I'd also like them to automatically dial in once USB gets connected.

    Read the article

  • Scheduled task giving last run result 0x80041324

    - by SteveC
    I've got a scheduled task set up in my Windows 7 machine which is meant to run a BAT file when I'm not around, i.e. the machine has been idle for 15 minutes. Does anyone know how to track down the cause of the error code ? Checked on MSDN and it says ... SCHED_E_TASK_ATTEMPTED 0x80041324 The Task Scheduler service attempted to run the task, but the task did not run due to one of the constraints in the task definition. And to confuse me even further, I've just noticed it has run while I'm at the machine with last result (0x0)

    Read the article

  • Making GRUB see RAID 0 under Ubuntu 10.10 LiveCD

    - by unknownthreat
    I just installed Windows 7 recently, and I expect that it would alter GRUB and it did. I've been following some guides around and I am always stuck at GRUB not able to detect the usual RAID content. I've tried running: sudo grub > root (hd0,0) GRUB complains it couldn't find my hard disk. So I tried: find (hd0,0) And it complains that it couldn't find anything. So I tried: find /boot/grub/stage1 It said "file not found". So what now? How can we make GRUB see RAID 0 under Ubuntu 10.10 LiveCD?

    Read the article

  • OpenBSD : NETSEC certainement impliqué dans une tentative d'insertion de backdoors, selon le responsable de l'OS

    OpenBSD : NETSEC certainement impliqué dans la tentative d'insertion de backdoors Sur demande du FBI, mais toujours aucune trace avérée de porte dérobée Mise à jour du 23/12/2010 Les investigations avancent sur les allégations émises la semaine dernière quant à une éventuelle insertion de portes dérobées (backdoors) dans le système OpenBSD (lire ci-avant). Une opération qui aurait été commanditée par le FBI. Theo de Raadt, le développeur principal du système, à l'origine de la divulgation de cette affaire (et au début plutôt sceptique), vient de rendre public un mail dans lequel il explique qu'...

    Read the article

  • Oracle VM VirtualBox 4.0 toujours gratuit mais pas ses nouvelles extensions, payantes pour les entreprises

    Oracle VM VirtualBox 4.0 Toujours gratuit mais pas ses extensions, payantes pour les entreprises Oracle vient d'annoncer la disponibilité en version finale de sa nouvelle solution de virtualisation Oracle VM VirtualBox 4.0. issue du rachat de Sun Microsystems. VirtualBox 4.0 est disponible sous licence open-source GNU GPL 2 et supporte plusieurs plate-formes (dont Windows et Linux 32 et 64 bits). Cette version d'Oracle VM VirtualBox intègre plusieurs nouvelles fonctionnalités, dont certaines sont livrées sous forme d'extension. Ces Extensions Packs sont mises à disposition suivant la licence PUEL (Personnal Use and Evaluation Licence), autrement dit, accessible gra...

    Read the article

  • Windows Phone 7 : 1,5 millions d'unités écoulées en six semaines selon son vice-président marketing, bon ou mauvais chiffre ?

    Windows Phone 7 : 1.5 millions d'unités écoulées en six semaines Selon le vice-président marketing de l'OS, bon ou mauvais chiffre ? Lors d'une interview réalisée en interne, Achim Berg, le vise-président chargé du marketing du département Windows Phone, a déclaré que les constructeurs de téléphones partenaires de Microsoft, avaient écoulé 1.5 millions d'unités sous Windows Phone 7 depuis la sortie de l'OS. Très loin des 300 000 activations quotidienne d'Android, ce chiffre doit tout de même être relativisé. Il ne s'agit en effet pas du nombre d'activations par les nouveaux utilisateurs finaux, mais des appareils vendus aux importateurs et aux détaillants. A...

    Read the article

  • How-to hide the close icon for task flows opened in dialogs

    - by frank.nimphius
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} ADF bounded task flows can be opened in an external dialog and return values to the calling application as documented in chapter 19 of Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework11g: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/taskflows_dialogs.htm#BABBAFJB Setting the task flow call activity property Run as Dialog to true and the Display Type property to inline-popup opens the bounded task flow in an inline popup. To launch the dialog, a command item is used that references the control flow case to the task flow call activity <af:commandButton text="Lookup" id="cb6"         windowEmbedStyle="inlineDocument" useWindow="true"         windowHeight="300" windowWidth="300"         action="lookup" partialSubmit="true"/> By default, the dialog that contains the task flow has a close icon defined that if pressed closes the dialog and returns to the calling page. However, no event is sent to the calling page to handle the close case. To avoid users closing the dialog without the calling application to be notified in a return listener, the close icon shown in the opened dialog can be hidden using ADF Faces skinning. Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} The following skin selector hides the close icon in the dialog af|panelWindow::close-icon-style{ display:none; } To learn about skinning, see chapter 20 of Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_skin.htm#BAJFEFCJ However, the skin selector that is shown above hides the close icon from all af:panelWindow usages, which may not be intended. To only hide the close icon from dialogs opened by a bounded task flow call activity, the ADF Faces component styleClass property can be used. The af:panelWindow component shown below has a "withCloseWindow" style class property name defined. This name is referenced in the following skin selector, ensuring that the close icon is displayed af|panelWindow.withCloseIcon::close-icon-style{ display:block; } In summary, to hide the close icon shown for bounded task flows that are launched in inline popup dialogs, the default display behavior of the close icon of the af:panelWindow needs to be reversed. Instead to always display the close icon, the close icon is always hidden, using the first skin selector. To show the disclosed icon in other usages of the af:panelWindow component, the component is flagged with a styleClass property value as shown below <af:popup id="p1">   <af:panelWindow id="pw1" contentWidth="300" contentHeight="300"                                 styleClass="withCloseIcon"/> </af:popup> The "withCloseIcon" value is referenced in the second skin definition af|panelWindow.withCloseIcon::close-icon-style{ display:block; } The complete entry of the skin CSS file looks as shown below: af|panelWindow::close-icon-style{ display:none; } af|panelWindow.withCloseIcon::close-icon-style{ display:block; }

    Read the article

  • Linqpad and Autocompletion

    I have mentioned before about doing development for StreamInsight in Linqpad. I have it installed on two separate PCs and I have enabled autocompletion on only one of them. Whilst both versions are an excellent tool, the one with autocompletion enabled is so much easier to use. After enabling autocompletion you can see I now get parameter listing Free trial of SQL Backup™“SQL Backup was able to cut down my backup time significantly AND achieved a 90% compression at the same time!” Joe Cheng. Download a free trial now.

    Read the article

  • .NET chart Datamanipulator

    - by peter
    In .NET C#4.0 with the .NET Chart control I have this code to generate a pie chart: chart.Series[0].ChartType = SeriesChartType.Pie; foreach (Order order in orderCollection) { // If I set point.LegendText = order.UserName, .Group will erase it chart.Series[0].Points.AddXY(order.UserName, order.Total); } chart.DataManipulator.Sort(PointSortOrder.Ascending, "X", "Series1"); chart.DataManipulator.Group("SUM", 1, IntervalType.Months, "Series1"); This works well, it generates a pie chart with the top 10 users showing their total order sum. I would like to set the DataPoints' legendtext to the order.UserName property. The problem is, DataManipulator.Group overwrites the series DataPoints. So if I set the legendtext in the foreach loop, they will be erased after the Group call. And after the Group call, I don't see a way to retrieve the correct UserName for a DataPoint to set the legendtext. What is the best approach for this situation?

    Read the article

  • Create a grid in WPF as Template programmatically

    - by wickie79
    I want to create a basic user control with a style programmatically. In this style i want to add a Grid (no problem), but i dont can add column definitions to this grid. My example code is ControlTemplate templ = new ControlTemplate(); FrameworkElementFactory mainPanel = new FrameworkElementFactory(typeof(DockPanel)); mainPanel.SetValue(DockPanel.LastChildFillProperty, true); FrameworkElementFactory headerPanel = new FrameworkElementFactory(typeof(StackPanel)); headerPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal); headerPanel.SetValue(DockPanel.DockProperty, Dock.Top); mainPanel.AppendChild(headerPanel); FrameworkElementFactory headerImg = new FrameworkElementFactory(typeof(Image)); headerImg.SetValue(Image.MarginProperty, new Thickness(5)); headerImg.SetValue(Image.HeightProperty, 32d); headerImg.SetBinding(Image.SourceProperty, new Binding("ElementImage") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerImg); FrameworkElementFactory headerTitle = new FrameworkElementFactory(typeof(TextBlock)); headerTitle.SetValue(TextBlock.FontSizeProperty, 16d); headerTitle.SetValue(TextBlock.VerticalAlignmentProperty, VerticalAlignment.Center); headerTitle.SetBinding(TextBlock.TextProperty, new Binding("Title") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerTitle); FrameworkElementFactory mainGrid = new FrameworkElementFactory(typeof(Grid)); FrameworkElementFactory c1 = new FrameworkElementFactory(typeof(ColumnDefinition)); c1.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star)); FrameworkElementFactory c2 = new FrameworkElementFactory(typeof(ColumnDefinition)); c2.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Auto)); FrameworkElementFactory c3 = new FrameworkElementFactory(typeof(ColumnDefinition)); c3.SetValue(ColumnDefinition.WidthProperty, new GridLength(3, GridUnitType.Star)); FrameworkElementFactory colDefinitions = new FrameworkElementFactory(typeof(ColumnDefinitionCollection)); colDefinitions.AppendChild(c1); colDefinitions.AppendChild(c2); colDefinitions.AppendChild(c3); mainGrid.AppendChild(colDefinitions); mainPanel.AppendChild(mainGrid); FrameworkElementFactory content = new FrameworkElementFactory(typeof(ContentPresenter)); content.SetBinding(ContentPresenter.ContentProperty, new Binding() { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent), Path = new PropertyPath("Content") }); mainGrid.AppendChild(content); templ.VisualTree = mainPanel; Style mainStyle = new Style(); mainStyle.Setters.Add(new Setter(UserControl.TemplateProperty, templ)); this.Style = mainStyle; But the creation of FrameworkElementFactory with type ColumnDefinitionCollection will throw an exception "'ColumnDefinitionCollection' type must derive from FrameworkElement, FrameworkContentElement, or Visual3D." Who can help me?

    Read the article

  • Django Model Formset Pre-Filled Value Problem

    - by user552377
    Hi, i'm trying to use model formsets with Django. When i load forms template, i see that it's filled-up with previous values. Is there a caching mechanism that i should stop, or what? Thanks for your help, here is my code: models.py class FooModel( models.Model ): a_field = models.FloatField() b_field = models.FloatField() def __unicode__( self ): return self.a_field forms.py from django.forms.models import modelformset_factory FooFormSet = modelformset_factory(FooModel) views.py def foo_func(request): if request.method == 'POST': formset = FooFormSet(request.POST, request.FILES, prefix='foo_prefix' ) if formset.is_valid(): formset.save() return HttpResponseRedirect( '/true/' ) else: return HttpResponseRedirect( '/false/' ) else: formset = FooFormSet(prefix='foo_prefix') variables = RequestContext( request , { 'formset':formset , } ) return render_to_response('footemplate.html' , variables ) template: <form method="post" action="."> {% csrf_token %} <input type="submit" value="Submit" /> <table id="FormsetTable" border="0" cellpadding="0" cellspacing="0"> <tbody> {% for form in formset.forms %} <tr> <td>{{ form.a_field }}</td> <td>{{ form.b_field }}</td> </tr> {% endfor %} </tbody> </table> {{ formset.management_form }} </form>

    Read the article

  • PHP getimagesize is not working when is called from a function in function.php (Wordpress)?

    - by janoChen
    PHP getimagesize is not working when is called from a function in function.php. function.php: add_action('wp_head', 'get_image_size'); function get_image_size() { global $width; // I thought this would solve the problem but it didn't global $height; // I thought this would solve the problem but it didn't list($width, $height, $type, $attr) = getimagesize($options['logo']); echo "Image width " .$width; echo "<BR>"; echo "Image height " .$height; echo "<BR>"; } $options['logo'] is returning http://localhost/wordpress/wp-content/uploads/2010/12/logo4.png so the image is being displayed. I also did var_dump to $width and $height but they didn't show up. Any suggestions?

    Read the article

  • Can a large transaction log cause cpu hikes to occur

    - by Simon Rigby
    Hello all, I have a client with a very large database on Sql Server 2005. The total space allocated to the db is 15Gb with roughly 5Gb to the db and 10 Gb to the transaction log. Just recently a web application that is connecting to that db is timing out. I have traced the actions on the web page and examined the queries that execute whilst these web operation are performed. There is nothing untoward in the execution plan. The query itself used multiple joins but completes very quickly. However, the db server's CPU hikes to 100% for a few seconds. The issue occurs when several simultaneous users are working on the system (when I say multiple .. read about 5). Under this timeouts start to occur. I suppose my question is, can a large transaction log cause issues with CPU performance? There is about 12Gb of free space on the disk currently. The configuration is a little out of my hands but the db and log are both on the same physical disk. I appreciate that the log file is massive and needs attending to, but I'm just looking for a heads up as to whether this may cause CPU spikes (ie trying to find the correlation). The timeouts are a recent thing and this app has been responsive for a few years (ie its a recent manifestation). Many Thanks,

    Read the article

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