Search Results

Search found 345 results on 14 pages for 'ctp'.

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • Display a MYSQL field using CAKE

    - by adam
    Forgive me if this is a "homework" question. We have a "Rating" table in our mysql db. I want to display this number on our user profile page. JUST BELOW THE GRAVATAR. here is the code in app/views/user/view.ctp <div class="nhplft"> flash(); ? ?d=identicon&s=100" border="0" alt="My Avatar! UID:" / Change Image link("Home",'/items'); ?  |  link('Add',array('controller' = 'items','action'='add')); ?  |  link('Search',array('controller'='items','action'='index')); ?  |  link("Logout",'/users/logout'); } ?

    Read the article

  • Is the F# language reference documentation available in an offline format (PDF, CHM)?

    - by stakx
    I've found several posts on hubFS of people asking if there is, or will be, offline documentation for F#. These posts haven't been answered. So I want to give it a shot and ask the same question here on SO. Where I've looked for offline documentation so far: The April 2010 CTP release of Visual F# (version 2.0) is available for VS 2008, but it doesn't come without an offline help. There's a question on SO about offline documentation for various programming languages, but F# isn't mentioned there at the time of this writing. There is of course Microsoft's F# language reference documentation (available on MSDN), which could be downloaded for offline browsing using e.g. wget. Question: Does anyone know whether any "official" offline documentation is on the way, anytime soon? (And related to this, albeit this probably can't be answered objectively: Would it be reasonable to expect that F# likely won't undergo ECMA or ISO standardization, ie. there likely won't be a standards document describing the language?)

    Read the article

  • F# books question

    - by Michiel Borkent
    I am now reading Foundations of F# by Robert Pickering and parallelly the book in progress 'Real World Functional Programming' by Tomas Petricek. My question is, what is the added value I would get from buying and reading the following books: 1) Expert F# by Don Syme and others 2) F# for Scientists by John Harrop Are those books still up to date with the current CTP version. What are things to keep notice of with respect to the recent changes in the language? Will there be reprinted updated versions? Also I want to learn more about datamining techniques with F# as a tool for this. What are good books to read next on this topic?

    Read the article

  • CakePHP Form Helper Database Interaction

    - by xtine
    Currently I am developing a CakePHP that will list various businesses. In the database, there is a table for businesses that lists them like so: id | name | address | city | state | state_id | zip | url The state column are abbreviations of states (for listing purposes) CA, AK, FL, etc and the state_id matches up with the ids in the states table: id | name | state_abbr I have an admin_add.ctp template with form helpers for inserting new businesses. For entering a state for a business I am going to have a pull down that lists all the states. However, how do I make the database insert so it will know how to add the state abbreviation and state id when I submit the form to add the business?

    Read the article

  • "Cannot use fixed local inside lambda expression"

    - by JulianR
    I have an XNA 3.0 project that compiled just fine in VS2008, but that gives compile errors in VS2010 (with XNA 4.0 CTP). The error: Cannot use fixed local 'depthPtr' inside an anonymous method, lambda expression, or query expression depthPtr is a fixed float* into an array, that is used inside a Parallel.For lambda expression from System.Threading. As I said, this compiled and ran just fine on VS2008, but it does not on VS2010, even when targeting .NET 3.5. Has this changed in .NET 4.0, and even so, shouldn't it still compile when I choose .NET 3.5 as the target framework? Searching for the term "Cannot use fixed local" yields exactly one (useless) result, both in Google and Bing. If this has changed, what is the reason for this? I can imagine capturing a fixed pointer-type in a closure could get a bit weird, is that why? So I'm guessing this is bad practice? And before anyone asks: no, the use of pointers is not absolutely critical here. I would still like to know though :)

    Read the article

  • How to integrate yahoo user interface with cakePHP

    - by ygmehboob
    Hi all I am very new to cakePHP, I want to add YUI accordion in the default layout of my application. A simple explanation could be like this - I have a table 'lecturers' in my database. I have baked the model lecturer (file) I have baked the controller lecturers_controller (file) I have baked the view lecturers (folder) I need to override the default layout but I want to add YUI 3 accordion sothat the table name lecturers will be on top, after clicking on the top division it will slidedown and will show me the column name of lecturer table. Is there anyone who could suggest me how to integrate the YUI 3 accordion - Do I have to write a helper for this or simply after copying the YUI 3 library I could code this in the default.ctp file. I am really confused as I could hardly get a full tutorial on this topic. Thank you in advance ................

    Read the article

  • cakephp droplist/form - xml and ajax

    - by gudinne
    Hello- I'm complete noob in Cakephp - here goes... I have a website set up with Cakephp framework. I have been tasked with creating two dropdown forms to compare/show data. When the user selects an item from the dropdown from either one of the forms it is to show the content below on website. I was thinking this data would need to be stored in an xml file. How do I create and sync two dropdown forms with xml data within Cakephp? The page the form is on is the view(.ctp) file. Thanks

    Read the article

  • Bug in variadic function template specialization with MSVC?

    - by Andrei Tita
    Using the Visual Studio Nov 2012 CTP, which supports variadic templates (among other things). The following code: template<int, typename... Args> void myfunc(Args... args) { } template<> void myfunc<1, float>(float) { } produces the following errors: error C2785: 'void myfunc(Args...)' and 'void myfunc(float)' have different return types error C2912: explicit specialization 'void myfunc(float)' is not a specialization of a function template (yeah, the first one is pretty funny) So my questions are: 1) Am I writing legal C++11 here? 2) If yes, is there a way to find out if this is a known bug in MSVC before submitting it?

    Read the article

  • Are Domain Specific Languages (DSL) bad for the Common Programmer?

    - by iestyn
    I have lately been delving into F# and the new DSL stuff as in the Microsoft SQL Server Modelling CTP, and have some concerns. Will this new idea that will come about be bad for skilled programmers? Is code going to be dumbed down? I know I sound like a luddite, but this does worry me, after spending years of time practising in my craft, and now might be scuttled by genius from within. I am afraid, very afraid. Will I be now trapped in a job that only programs against a DSL and therefore every job that I work on, I have to learn a whole new DSL based on top of a Framework (.net Java), that I will only be allowed to touch certain parts of. I don't think the world is ready for DSL, but the sales pitch is deafening!

    Read the article

  • Visual Studio 2010 SP1 Beta supports IIS Express

    - by DigiMortal
    Visual Studio 2010 SP1 Beta and ASP.NET MVC 3 RC2 were both announced today. I made a little test on one of my web applications to see how Visual Studio 2010 works with IIS Express. In this posting I will show you how to make your ASP.NET MVC 3 application work with IIS Express. Installing new stuff You can install IIS Express using Web Platform Installer. It is not part of WebMatrix anymore and you can just install IIS Express without WebMatrix. NB! You have to install IIS Express using Web Platform installer because IIS Express is not installed by SP1. After installing Visual Studio 2010 SP1 Beta on my machine (it took a long-long-long time to install) I installed also ASP.NET MVC 3 RC2. If you have Async CTP installed on your machine you have to uninstall it to get ASP.NET MVC 3 RC2 installed and run without problems. Screenshot on right shows what kinf of horrors my old laptop had to survive to get all new stuff installer. Setting IIS Express as server for web application Now, when you right-click on some web project you should see new menu item in context menu – Use IIS Express…. If you click on it you are asked for confirmation and if you say Yes then your web application is reconfigured to use IIS Express. After configuration you will see dialog box like this. And you are done. You can run your application now. Running web application When you run your application it is run on IIS Express. You can see IIS Express icon on taskbar and when you click it you can open IIS Express settings. If you closed your application in browser you can open it again from IIS Express icon. Modifying IIS Express settings for web application You can modify IIS Express settings for your application. Just open your project properties and move to Web tab. IIS and IIS Express are using same settings. The difference is if you make check to Use IIS Express checkbox or not. Switching back to Visual Studio Development Server If you don’t want or you can’t use IIS Express for some reason you can easily switch back to Visual Studio Development Server. Just right-click on your web application project and select Use Visual Studio Development Server from context menu. Conclusion IIS Express is more independent than full version of IIS and it can be also installed and run on machines where are very strict rules (some corporate and academic environments by example). IIS Express was previously part of WebMatrix package but now it is separate product and Visual Studio 2010 has very nice support for it thanks to SP1. You can easily make your web applications use IIS Express and if you want to switch back to development server it is also very easy.

    Read the article

  • Silverlight Cream for May 05, 2010 -- #856

    - by Dave Campbell
    In this Issue: Jeremy Alles(-2-), Kunal Chowdhury, anand iyer, Yochay Kiriaty(-2-, -3-), Max Paulousky, David Kelley, smartyP, Tim Heuer, and Dan Wahlin. Shoutout: Tim Heuer provides links for all the Ways to give feedback on Silverlight From SilverlightCream.com: [WP7] Bug when using NavigationService in Windows Phone 7 Jeremy Alles has blogged about a bug he found using the Navigation service in WP7. He gives the steps to reproduce and a couple possible workarounds. [WP7] Using the camera in the emulator Jeremy Alles is also digging into the camera functionality in the emulator. He has code demonstrating launching a camera task, and a list of other tasks available. Silverlight Tutorials Chapter 3: Introduction to Panels Kunal Chowdhury has Chapter 3 of his Silverlight 4 Tutorial series up and he's talking about Panels this time out. Push Notifications in Windows Phone 7 developer tools CTP April Refresh anand iyer is discussing the Push Notifications, only from a code perspective. Good information and good additional links to follow. Windows Phone Application Life Cycle Yochay Kiriaty talks with Tudor Toma and Jaime Rodriguez about the WP7 application lifecycle on Channel 9. Understanding Microsoft Push Notifications for Windows Phones Yochay Kiriaty has a 2-part post up on WP7 Push Notifications. The first part is explaining what Push Notifications are and why we need them... as a developer and as an end user viewing Toast or Tile notifications. Understanding How Microsoft Push Notification Works – Part 2 In the 2nd part of his Push Notification series, Yochay Kiriaty discusses how the Push Notification works under the covers. To Remember: Deployment of Silverlight Applications With Wcf Ria Services Max Paulousky has a post up for reference on what to look into when you get "Load Operation Failed" in WCF RIA services. Launching a URL from an OOB Silverlight Application David Kelley has a quick post up on launching URLs from an OOB app. If you haven't tried it, you may be surprised as he was at first. Creating a Windows Phone 7 XNA Game in Landscape Orientation smartyP is looking at recreating a landscape WP7 game in XNA and is detailing some of the issues he's been dealing with, and is also sharing a project file. New Silverlight 4 Themes available–get the raw bits Tim Heuer provided 'raw' versions of 3 new themes. Read his post to see exactly what he means by 'raw' ... they're definitely good looking, and are going to get a lot of play. Handling WCF Service Paths in Silverlight 4 – Relative Path Support Dan Wahlin shares his technique for avoiding the pain involved with ServiceReferences.ClientConfig by using Silverlight 4 relative path support. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Initial Look: Storing SQL Compact Data on a Windows Phone 7 Series

    - by Nikita Polyakov
    Ok, the title is misleading – I’ll admit it, but there is a way to store your data in Windows Phone 7 Series. Windows Phone 7 Silverlight solutions have what is called Isolated Storage. [XNA has content storage as well] At this time there is no port of SQL Compact engine for Silverlight Isolated Storage. There is no wind of such intention. [That was a question way before WP7 was even rumored to have Silverlight.] There a few options: 1. Microsoft recommends you “simply” use client-server or cloud approach here. But this is not an option for Offline. 2. Use the new Offline/CacheMode with Sync Framework as shown in the Building Offline Web Apps Using Microsoft Sync Framework MIX10 presentation see 19:10 for Silverlight portion [go to 22:10 mark to see the app]. 3. Use XlmSerializer to dumb your objects to a XML file into the Isolated Storage. Good for small data. 4. Experiment with C#SQLite for Silverlight that has been shown to work in WP7 emulator, read more. 5. Roll your own file format and read/write from it. Think good ol’ CSV. Good for when you want 1million row table ;)   Is Microsoft aware of this possible limitation? Yes. What are they doing about it? I don’t know. See #1 and #2 above as the official guidance for now. What should you do about it? Don’t be too quick to dismiss WP7 because you think you’ll “need” SQL Compact. As lot of us will be playing with these possible solutions, I will be sure to update you on further discoveries. Remember that the tools [even the emulator] released at MIX are CTP grade and might not have all the features. Stay up to date: Watch the @wp7dev account if you are on Twitter. And watch the Windows Phone Dev Website and Blog. More information and detail is sure to come about WP7 Dev, as Windows Phone is planned to launch “Holidays” 2010. [For example Office will be discussed in June from the latest news, June is TechEd 2010 timeframe btw]

    Read the article

  • Why I Love Microsoft Development

    - by Brian Lanham
    I've been writing software for a while and recently had an opportunity to broaden my horizons and start developing for iOS. We decided to leverage, as much as possible, our existing skills and use MonoTouch and MonoDevelop by Novell.    For those of you who do not know, Mono is a .NET port originally designed for Linux but adapted for other platforms as well. MonoTouch is a port specifically for building iOS applications using the .NET framework. MonoDroid is a port (in CTP-esque release) for Android.   A MISSING COMPONENT - VISUAL DESIGNER   MonoDevelop lacks one very significant component compared with other tools I am using: NO VISUAL DESIGNER. Instead of using an integrated visual designer, MonoDevelop shells to the Mac OS "Interface Builder".  Since MonoDevelop lets me have a "Visual Studio-esque" feel *and* I get to use C#, AND it's FREE, I am gladly willing to overlook this.  In fact, it's not even a question.  Free?  Sure, I'll take it with no Visual Designer.   In my experiences I've grown from UNIX and DOS to .NET development through many steps. Java/JSP/Servlets; Windows; Web; etc. I've been doing .NET for quite a few years and I guess I just got "comfortable" with the tools.   WHY AM I NOT GETTING IT?   Interface Builder (IB) is amazingly confusing for me. I had the opportunity to speak at the Northern VA Code Camp on 12/11/2010. My presentation was "Getting Started with iOS Development using MonoTouch and C#".    At the visual design part of the presentation, I asked one of the 3 or 4 Mac developers in the room about my confusion with the IB. I don't understand why the "Classes" list includes objects. I don't understand what "File's Owner" is. And, most importantly, WHAT THE HECK IS AN OUTLET AND WHY IS IT NECESSARY?!?!?"   His response to these question (especially Outlets): "They did it wrong."   I'm accustom to a visual designer that creates variables for graphical widgets for me. Not IB. Instead, I have to create "Outlets" manually. I still do not understand why and, the explanation from a seasoned Mac developer is that it's wrong. (He received nods of confirmation from the other Mac devs in the room.)   I LOVE MS DEV   I love development for Microsoft platforms using Microsoft development tools. I love Windows 7. I love Visual Studio 2010. I love SQL Server. Azure, Entity Framework, Active Directory, Office, WCF/WF/WPF, etc. are all designed with integration in mind. They are also all designed with developers in mind.   Steve Ballmer recently ranted "It's the developers!" That's why it is relatively quick to build apps using MS tools. Clearly, MS knows that while we usually enjoy building technology solutions, we are here to make money. And we need tools that accelerate our time to market without compromising the power and quality of our solutions.   So, yeah, I am sucking up I guess. But I love Microsoft Development. Thank you, Microsoft, for providing the plethora of great development tools.    P.S. (but please slow down a bit…I'm having trouble keeping up!)

    Read the article

  • 0xC0017011 and other error messages - what is the error message text?

    Recently there was a bug raised against BIDS Helper which originated in my Expression Editor control. Thankfully the person that raised it kindly included a screenshot, so I had the error code (HRESULT 0xC0017011) and a stack trace that pointed the finger firmly at my control, but no error message text. The code itself looked fine so I searched on the error code but got no results. I’d expected to get a hit from Books Online with the Integration Services Error and Message Reference topic at the very least, but no joy. There is however a more accurate and definitive reference, namely the header file that defines all these codes dtsmsg.h which you can find at- C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Include\dtsmsg.h Looking the code up in the header file gave me a much more useful error message. //////////////////////////////////////////////////////////////////////////// // The parameter is sensitive // // MessageId: DTS_E_SENSITIVEPARAMVALUENOTALLOWED // // MessageText: // // Accessing value of the parameter variable for the sensitive parameter "%1!s!" is not allowed. Verify that the variable is used properly and that it protects the sensitive information. // #define DTS_E_SENSITIVEPARAMVALUENOTALLOWED ((HRESULT)0xC0017011L) Unfortunately I’d forgotten all about this. By the time I had remembered about it, the person who raised the issue had managed to narrow it down to something to do with having  sensitive parameter. Putting that together with the error message I’d finally found, a quick poke around in the code and I found the new GetSensitiveValue method which seemed to do the trick. The HResult fields are also listed online but it only shows the short error message, and it doesn’t include that all so important HRESULT value itself. So let this be a lesson to you (and me!), if you need to check  SSIS error go straight to the horses mouth - dtsmsg.h. This is particularly true when working with early builds, or CTP releases when we expect the documentation to be a bit behind. There is also a programmatic approach to getting better SSIS error messages. I should to take another look at the error handling in the control, or the way it is hosted in BIDS Helper. I suspect that if I use an implementation of Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSInfoEvents100 I could catch the error itself and get the full error message text which I could then report back. This would obviously be a better user experience and also make it easier to diagnose any issues like this in the future. See ExprssionEvaluator.cs for an example of this in use in the Expression Editor control.

    Read the article

  • XAML RadControls Q1 2010 Official

    Q1 2010 release focuses on strengthening 3 main aspects of RadControls for Silverlight and RadControls for WPF: Ensuring first-class performance for all data-centric controls through various techniques, Enhancing and polishing RadControls themes Providing highly advanced, enterprise-level features, especially for the data visualization controls  We know that performance is crucial for line-of-business applications. Therefore, we always make sure that RadControls can help you achieve unmatched performance and this has always been our number one priority. RadControls achieve unbeatable performance through UI and Data Virtualization, Data Sampling and built-in Load On Demand features. Several of the major controls in the bundles have been enhanced with UI virtualization support Scheduler, CoverFlow and Book. As a part of Q1 2010 we also want to bring an unparalleled visual richness to your applications. To achieve that we have done a major rework of all our themes. We used a uniform templating approach across all controls, streamlined naming conventions for resources and delivered a much more consistent look of the controls along the way. RadControls for WPF bundle has been enriched with two new controls Map and Book.   Another new control has been included in the Q1 2010 release. However, it continues to be in a CTP stage. This is the Transition control. We decided that this is the better way to proceed as we will need some more input from our community on how exactly to develop this control further. Therefore, we will be regularly blogging on the development progress so that we can clearly indicate the direction, in which the control is evolving and gather your feedback on whether this is the best direction. Our Charting controls for Silverilght and WPF have been advanced with major new features such as Data Sampling, Zooming and Scrolling, Automatic SmartLables positioning, Sorting and Filtering and many more. The new built-in paging of the GridView control now allows you to page through your data, thus resulting in an event faster and more responsive grid that can easily handle enormously large datasets. Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Regular Expression Transformation

    The regular expression transformation exposes the power of regular expression matching within the pipeline. One or more columns can be selected, and for each column an individual expression can be applied. The way multiple columns are handled can be set on the options page. The AND option means all columns must match, whilst the OR option means only one column has to match. If rows pass their tests then rows are passed down the successful match output. Rows that fail are directed down the alternate output. This transformation is ideal for validating data through the use of regular expressions. You can enter any expression you like, or select a pre-configured expression within the editor. You can expand the list of pre-configured expressions yourself. These are stored in a Xml file, %ProgramFiles%\Microsoft SQL Server\nnn\DTS\PipelineComponents\RegExTransform.xml, where nnn represents the folder version, 90 for 2005, 100 for 2008 and 110 for 2012. If you want to use regular expressions to manipulate data, rather than just validating it, try the RegexClean Transformation. The component is provided as an MSI file, however for 2005/200 you will have to add the transformation to the Visual Studio toolbox by hand. This process has been described in detail in the related FAQ entry for How do I install a task or transform component?, just select Regular Expression Transformation in the Choose Toolbox Items window. Downloads The Regular Expression Transformation is available for SQL Server 2005, SQL Server 2008 (includes R2) and SQL Server 2012. Please choose the version to match your SQL Server version, or you can install multiple versions and use them side by side if you have more than one version of SQL Server installed. Regular Expression Transformation for SQL Server 2005 Regular Expression Transformation for SQL Server 2008 Regular Expression Transformation for SQL Server 2012 Version History SQL Server 2012Version 2.0.0.87 - SQL Server 2012 release. Includes upgrade support for both 2005 and 2008 packages to 2012. (5 Jun 2012) SQL Server 2008Version 2.0.0.87 - Release for SQL Server 2008 Integration Services. (10 Oct 2008) SQL Server 2005 Version 1.1.0.93 - Added option for you to choose AND or OR logic when multiple columns have been selected. Previously behaviour was OR only. (31 Jul 2008) Version 1.0.0.76 - Installer update and improved exception handling. (28 Jan 2008) Version 1.0.0.41 - Update for user interface stability fixes. (2 Aug 2006) Version 1.0.0.24 - SQL Server 2005 RTM Refresh. SP1 Compatibility Testing. (12 Jun 2006) Version 1.0.0.9 - Public Release for SQL Server 2005 IDW 15 June CTP (29 Aug 2005) Screenshots  

    Read the article

  • The difference

    So with the CTP tools available, weve been building a few apps, just to get a feel for the tools and whats supported in the framework.  Whats been great is that everything is fairly familiar and consistent, largely to do with the .net framework and Microsofts focus on providing good tools.  Weve produced mobile applications, mostly in concept form, for Windows Phone Classic, iPhone and Android but never so quickly and not of such high quality and visual impression.  I attribute some of this obviously to our familiarity to the Microsoft platform and tools.  Though when you look at the designs our team has produced, it becomes clear that this is not just another mobile application container.                                                            The Metro design language implores content prominence with fluid motion and transitions, with a crisp font and easily organized features and services placement.  In addition to a purposeful right edge tease, where the intent is for users to discover new premium content and services.   The concept that enables this is called hubs, building application with hubs changes your thinking from a single mobile application task, to thinking creatively about a mobile experience. Its engaging to think of the other brands and industry verticals that will take advantage of this core feature.  Combine this with Windows Phone 7 live tiles, more on that later, and you have a recipe for a solid mobile services platform.                                                              This so much more fun and liberating than my icon on a gridDid you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Does Windows 8 RTM Support VB6 (SP6) Runtime files? If so, which ones?

    - by user51047
    Basically, I'm trying to find out which of the following files come packaged with the Windows 8 RTM (that is, the final version). Just to be clear, we're not wanting to know if any of the runtime files (listed below) are or were included with any of the previous versions (Beta, CTP, RS etc) or releases of Windows 8 - we are just interested in this compatibility question as far as Windows 8 RTM (Final Version) is concerned. In addition, if possible, we would also like to know which of the below files (if any) come shipped and registered with the Windows 8 RT (on ARM) version. As far as the ARM version is concerned, you're welcome to base your answer on the latest version of Windows 8 RT (on ARM) that is available at the date and time your answer is posted. (This will also serve to future-proof this question as additional releases or versions of Windows 8 and Windows 8 RT on ARM come out). Here are the list of files (which are basically the VB6 SP6 runtime files): File name Version Size Asycfilt.dll 2.40.4275.1 144 KB (147,728 bytes) Comcat.dll 4.71.1460.1 21.7 KB (22,288 bytes) Msvbvm60.dll 6.0.97.82 1.32 MB (1,386,496 bytes) Oleaut32.dll 2.40.4275.1 584 KB (598,288 bytes) Olepro32.dll 5.0.4275.1 160 KB (164,112 bytes) Stdole2.tlb 2.40.4275.1 17.5 KB (17,920 bytes) Of course, the most important file in there is MSVBVM60.DLL, so if you cannot provide details for all files relating to both Windows Releases, then basing the answer on as many of the files possible would also be useful. Thank you for reading and for your anticipated assistance in putting this question/answer on record.

    Read the article

  • CakePHP 1.3 and Uploadifive/Uploadify - Change Upload Filename to a random string

    - by CaboONE
    I have somehow implemented UPLOADIFIVE in my CakePHP application. Everything seems to work great including uploading multiple files and inserting the correct information in the Database. Based on the following code, I would like to UPLOAD AND SAVE EVERY FILE WITH A RANDOM NAME TAKING INTO ACCOUNT THE CURRENT DATE OR SOMETHING SIMILAR. How could I accomplish this? In my Photos Controller I have the following function: // This function is called at every file upload. It uploads the file onto the server // and save the corresponding image name, etc, to the database table `photos`. function upload() { $uploadDir = '/img/uploads/photos/'; if (!empty($_FILES)) { debug($_FILES); $tempFile = $_FILES['Filedata']['tmp_name'][0]; $uploadDir = $_SERVER['DOCUMENT_ROOT'] . $uploadDir; $targetFile = $uploadDir . $_FILES['Filedata']['name'][0]; // Validate the file type $fileTypes = array('jpg', 'jpeg', 'gif', 'png'); // Allowed file extensions $fileParts = pathinfo($_FILES['Filedata']['name'][0]); // Validate the filetype if (in_array($fileParts['extension'], $fileTypes)) { // Save the file move_uploaded_file($tempFile,$targetFile); $_POST['image'] = $_FILES['Filedata']['name'][0]; $this->Photo->create(); if ($this->Photo->save($_POST)) { $this->Session->setFlash($targetFile, 'default', array('class' => 'alert_success')); $this->redirect(array('action' => 'index')); } } else { // The file type wasn't allowed //echo 'Invalid file type.'; $this->Session->setFlash(__('The photo could not be saved. Please, try again.', true)); } } } In my View file - admin_add.ctp I have added the following function $('#file_upload').uploadifive({ 'auto' : false, 'uploadScript' : '/photos/upload', 'buttonText' : 'BROWSE FILES', 'method' : 'post', 'onAddQueueItem' : function(file) { this.data('uploadifive').settings.formData = { 'photocategory_id' : $('#PhotoPhotocategoryId').val() }; } }); <input type="file" name="file_upload" id="file_upload" />

    Read the article

  • CakePHP's list problem

    - by jun
    Hi there. I have this table in my DB: Group - ID-Name - 1 -abc - 2 -def - 3 -ghi Pages - id-group_id-name - 1 -1 -home - 2 -1 -about us Now I wanted to make a select box that groups them by 'group' using: function add() { $this->set('pages', $this->Page->find('list', array('fields' => array('Page.id', 'Page.name', 'Page.group_id')))); } In my add.ctp: echo $form->input('group_id', array('options' => $pages)); The output: <select name="data[Page][id]" id="PageId"> <optgroup label="1"> <option value="1">Home</option> <option value="2">About Us</option> </optgroup> </select> I wanted the optgroup to display the actual group name not the group id like: <select name="data[Page][id]" id="PageId"> <optgroup label="abc"> <option value="1">Home</option> <option value="2">About Us</option> </optgroup> </select> I have tried this one: $this->Page->find('list', array('conditions' => 'Group.id = Page.id', 'fields' => array('Page.id', 'Page.name', 'Group.name'))); But 'Group.id' and 'Group.name' is unknown. Thanks!

    Read the article

  • CakePHP form $options['options']

    - by James
    Hey! Total CakePHP noob here. This is sort of a two fold question. In a view that is used for adding user objects I would like to use a drop down (selection) field in the form. Each user belongs to a group so when I add a user I want a drop down that contains all of the groups that the user could possibly join. Currently the group_id field is a textfield. I know how to force it to be a selection field, but I don't know how to populate the selection with the names of the groups programmatically. The Current method: echo $form->input('group_id', array( '1' => 'NameOfGroup1', '2' => 'NameOfGroup2', '3' => 'NameOfGroup3') ); I want to generate the options array programmatically though. echo $form->input('group_id', $this->Group->find('list')); This doesn't work though. I get an error: Undefined property: View::$Group [APP/views/users/add.ctp, line 8] To me this means that I don't have access to the Group object from inside my user view. How can I accomplish this? Again, I want to do it programmatically so that it updates as I add groups or remove them.

    Read the article

  • Convert ADO.Net EF Connection String To Be SQL Azure Cloud Connection String Compatible!?

    - by Goober
    The Scenario I have written a Silverlight 3 Application that uses an SQL Server database. I'm moving the application onto the Cloud (Azure Platform). In order to do this I have had to setup my database on SQL Azure. I am using the ADO.Net Entity Framework to model my database. I have got the application running on the cloud, but I cannot get it to connect to the database. Below is the original localhost connection string, followed by the SQL Azure connection string that isn't working. The application itself runs fine, but fails when trying to retrieve data. The Original Localhost Connection String <add name="InmZenEntities" connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl; provider=System.Data.SqlClient; provider connection string=&quot; Data Source=localhost; Initial Catalog=InmarsatZenith; Integrated Security=True; MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> The Converted SQL Azure Connection String <add name="InmZenEntities" connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl; provider=System.Data.SqlClient; provider connection string=&quot; Server=tcp:MYSERVER.ctp.database.windows.net; Database=InmarsatZenith; UserID=MYUSERID;Password=MYPASSWORD; Trusted_Connection=False; MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> The Question Anyone know if this connection string for SQL Azure is correct? Help greatly appreciated.

    Read the article

  • Convert C# Silverlight App To AZURE CLOUD Platform?!?!

    - by Goober
    The Scenario I've been following Brad Abrams Silverlight tutorial on his blog.... I have tried following Brads "How to deploy your app to the Cloud" tutorial however i'm struggling with it, even though it is in the same context as the first tutorial.... The Question Is the application structure essentially the same as the original "non-cloud based version"!? If not, which parts are different? (I get that there is a Cloud Service project added to the solution) - but what else?! Connection String Issue In my "Non-Cloud based application", I make use of the ADO.Net Entity Framework to communicate with my database. The connection string in my web.config file looks like: <add name="InmZenEntities" connectionString="metadata=res://*/InmZenModel.csdl|res://*/InmZenModel.ssdl|res://*/InmZenModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=CHASEDIGITALWS3;Initial Catalog=InmarsatZenith;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /></connectionStrings> However However the connection string that I get from SQL AZURE looks like: Server=tcp:k12ioy1rsi.ctp.database.windows.net;Database=master;User ID=simongilbert;Password=myPassword;Trusted_Connection=False; So how do I go about merging the two when I move the "non-cloud based application" to THE CLOUD?! Any help regarding converting a silverlight application to a cloud service and deploying it would be greatly appreciated

    Read the article

  • How to Persist URL parameters when CakePHP form validation fails

    - by am2605
    Hi, I'm new to cakephp and trying to write a simple app with it, however I'm stuck with some form validation issues. I have a model named "Person" which hasMany "PersonSkill" objects. To add a "PersonSkill" to a person, I have set it up to call a url like this: http://localhost/myapp/person_skills/add/person_id:3 I have been passing through the person_id because I want to display the name of the person we are adding the skills for. My issue is if the validation fails, the person_id parameter is not persisted to the next request, so the person's name is not displayed. The add method on the controller looks like this: function add() { if (!empty($this->data)) { if ($this->PersonSkill->save($this->data)) { $this->Session->setFlash('Your person has been saved.'); $this->redirect(array('action' => 'view', 'id' => $this->PersonSkill->id)); } } else { $this->Person->id = $this->params['named']['person_id']; $this->set('person', $this->Person->read()); } } In my person_skill add.ctp I set a hidden field which holds the person_id, eg: echo $form->input('person_id', array('type'=>'hidden','value'=>$person['Person']['id'])); Is there a way to persist the person_id url parameter when form validation fails, or is there a better way to do this that I'm missing completely? Any advice would be greatly appreciated.

    Read the article

  • set a default saving data in a selection box in HABTM model

    - by vincent low
    here is my problem which in my system. my system allow user to add event, which include date, time, places. In the other hand, user are allow to choose the "Event sharing to" some of other user. So i successful to created and share to other user, when the user login which are being choose to share with the event, he is able to view for that particular event. But the problem is, when user add the event, he must choose for his own name also in the select box. If not he will be unable to read the event that he had created. So i need to save a default data to my model, which is whenever the user got choose the sharing event or not, it also will save the data to his user id. here is my code for select box, what can i edit and do to let it set a default saving value which is always save with the user own data?? input('User',array( 'label' = 'Select Related Potential', 'options' = $users, //'id'='user', 'style'='width:250px;height:100px', //'selected' = $ownUserId )); ? i try to solve by adding 1 more row to the add.ctp, but the permission just set to the own user who created it, the other user i choose is unable to read. $form-input('User',array( 'label' = 'Select Related Potential', 'options' = $users, //'id'='user', 'style'='width:250px;height:100px', 'selected' = $ownUserId )); $form-input('User',array('type'='hidden','value'=$ownUserId));

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >