Search Results

Search found 18 results on 1 pages for 'dmin'.

Page 1/1 | 1 

  • Numpy modify array in place?

    - by User
    I have the following code which is attempting to normalize the values of an m x n array (It will be used as input to a neural network, where m is the number of training examples and n is the number of features). However, when I inspect the array in the interpreter after the script runs, I see that the values are not normalized; that is, they still have the original values. I guess this is because the assignment to the array variable inside the function is only seen within the function. How can I do this normalization in place? Or do I have to return a new array from the normalize function? import numpy def normalize(array, imin = -1, imax = 1): """I = Imin + (Imax-Imin)*(D-Dmin)/(Dmax-Dmin)""" dmin = array.min() dmax = array.max() array = imin + (imax - imin)*(array - dmin)/(dmax - dmin) print array[0] def main(): array = numpy.loadtxt('test.csv', delimiter=',', skiprows=1) for column in array.T: normalize(column) return array if __name__ == "__main__": a = main()

    Read the article

  • Can you work with SSJS on apache?

    - by DMin
    I just stumbled upon SSJS - Server Side JavaScript - It sounds very interesting but the information about it on the internet is very scant and contradictory. Do you know if this can be implemented on an Apache webserver? If yes, does this work by default or does something else need to be installed and if it does work by default how are the files to be named and executed. Thanks in advance :)

    Read the article

  • Proper web server setup

    - by DMin
    I just got myself a slicehost basic slice to play around with so I can learn how to setup web-servers. I have Ubuntu 10.04.2 installed on the server. I was able to successfully get the server up and running from scratch, these were the things I did - following this tutorial. I know this is probably just a starters tutorial, so, I was wondering if you guys can tell me what you like to do while setting up production servers. These are the steps that were followed : Update and Upgrade Ubuntu sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server Backup a copy of and edit apache2.conf Set : 'ServerTokens Full' to 'ServerTokens Prod''ServerSignature On' to 'ServerSignature Off' Backup php.ini and then Change “expose_php = On” to “expose_php = Off” Restart Apache Install Shorewall firewall Configure Shorewall to only accept HTTP and SSH connections(in the rules file) Enable shorewall on startup Add the website to the server : sudo usermod -g www-data root sudo chown -R www-data:www-data /var/www sudo chmod -R 775 /var/www I want make this CommunityWiki but can't seem to find the option to do it. Please feel free to add any feedback on the processes and things I am doing right/wrong. Much appriciated, thanks! :)

    Read the article

  • Create a timer countdown using hours, minutes & seconds from a future date

    - by Tommy Coffee
    I am using some code I found on the internet that creates a countdown from a certain date. I am trying to edit the code so that it only gives me a countdown from an hour, minute, and second that I specify from a future date. I cannot just have code that counts down from a specified time, I need it to countdown to a specified date in the future. This is important so that if the browser is refreshed the countdown doesn't start over but continues where left off. I will be using cookies so the browser remembers what future date was specified when it was first run. Here is the HTML: <form name="count"> <input type="text" size="69" name="count2"> </form> And here is the javascript: window.onload = function() { //change the text below to reflect your own, var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") function countdown(yr,m,d){ var theyear=yr; var themonth=m; var theday=d var today=new Date() var todayy=today.getYear() if (todayy < 1000) todayy+=1900; var todaym=today.getMonth() var todayd=today.getDate() var todayh=today.getHours() var todaymin=today.getMinutes() var todaysec=today.getSeconds() var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec futurestring=montharray[m-1]+" "+d+", "+yr var dd=Date.parse(futurestring)-Date.parse(todaystring) var dday=Math.floor(dd/(60*60*1000*24)*1) var dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1) var dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1) var dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1) if(dday==0&&dhour==0&&dmin==0&&dsec==1){ document.forms.count.count2.value=current return } else document.forms.count.count2.value= dhour+":"+dmin+":"+dsec; setTimeout(function() {countdown(theyear,themonth,theday)},1000) } //enter the count down date using the format year/month/day countdown(2012,12,25) } I am sure there is superfluous code above since I only need an hour, minute, and second that I would like to pass to the countdown() function. The year, month and day is unimportant but as I said this is code I am trying to edit which I found on the internet. Any help would be very appreciated. Thank you!

    Read the article

  • Suggest joomla html editor extension/software

    - by DMin
    I've started using Joomla 1.5 recently and am using the TinyMCE online WYSIWYG editor that comes with the package to edit articles. I tend to write direct html and javascript rather than use the WYSIWYG functions, I find that after the first time the changes are applied(page updated) most of your html becomes 4-5 separate big paragraphs. Its very hard to find stuff in there cause the content has no formatting -- eg: <p><span id="psy_ass_span" class="pink_heading">Psychometric Assessment</span></p> <div id="psy_ass_div" class="pink_box"><img class="img_right" src="templates/teamwork.jpg" border="0" /> <p><strong>Emporkommen</strong> uses <strong>Psychometric assessment</strong> as a tool in order to gain insight into a person’s personality and psychological thinking. It can help develop team spirit in t <script src="plugins/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js" type="text/javascript"></script> he workplace and assess an individual’s priorities.</p> Plus obviously there is no code highlighting in the editor so you can't figure out what is what. My question is, do you guys know of good(preferably non-commercial) extensions or other softwares or techniques that can make editing html code in Joomla 1.5 articles easier even after applying changes several times.

    Read the article

  • Making CSV from PHP - Carriage return won't work

    - by DMin
    Seems like a fairly simple issue but can't get it to work. I am getting the user to download a csv file(which works fine). Basically I can't get the carriage return to work. header("Content-type: text/x-csv"); header("Content-Disposition: attachment; filename=search_results.csv"); echo '"Name","Age"\n"Chuck Norris","70"'; exit; Result : Name     Age\n"Chuck Norris"    70 Tried : echo '"Name","Age",\n,"Chuck Norris","70"'; Result : Name     Age    \n    Chuck Norris    70 And echo '"Name","Age",\n\r,"Chuck Norris","70"'; Result : Name     Age    \n\r    Chuck Norris    70 Know what's going wrong?

    Read the article

  • What is your workflow when designing HTML/CSS layouts?

    - by DMin
    I have been working with PHP/MySQL as a hobby for close to a couple of years now, I have been working with photoshop for a very long time, I know CSS & HTML well enough to write without any reference, so, I would not consider myself someone who's very new at this. I have recently started developing websites professionally - (only person working on the project). I have seen the power of Joomla and how you can make a website ready for your customer in a matter of hours(if not minutes). I find it very hard to make layouts that remotely look like the themes on joomla. I find making even simple layouts a very cumbersome process and takes a lot of time to get a good enough output. I have a feeling I may not be using the right tools or workflow for the job. What I wanted to findout was, as part of the industry : How do, you, make your website when you do it from scratch? What are the tools that you use? What is your workflow? Just noted a few things I know already, for your reference(You can skip this if you like) I have seen the export for web for Photoshop that exports CSS - but (as far as I know) exports only absolutely positioned webpages so they need to be beaten and fixed if you want to use them for example for joomla. I have used the SiteGrinder plugin for Photoshop that exports HTML/CSS. It looks promising but haven't tried it extensively. One of the tools that save loads of time is FireBug. This makes it easy to edit html and css on the fly and get the page looking exactly as you want it. Recently stumbled upon fireworks. But haven't explored it much. Thanks! :)

    Read the article

  • Internet Explorer Rage?

    - by DMin
    I know Internet Explorer is a huge irritating thing for a lot of us - especially IE6. What is the most interesting/extreme thing you've done/fantasized-doing as a result of outrage for (re-)coding for Internet Explorer?

    Read the article

  • jQuery Children length of an ol

    - by DMin
    I am trying to count the child elements of an OL jQuery : $(document).ready(function(){ $("#my_select").change(function(){ alert($("#ol3").children.length); });}); HTML: <ol id="ol1"> <li class="2">Location 1-1</li> </ol> <ol id="ol2"> <li class="15">Location 2-1</li> <li class="20">Location 2-2</li> </ol> <ol id="ol3"> <li class="17">Location 3-1</li> <li class="16">Location 3-2</li> <li class="14">Location 3-3</li> </ol> I always get the number 2 no matter how many li are there under the ol. Know what's going on..?

    Read the article

  • If tables are so evil, why does joomla use tables for its layout?

    - by DMin
    When you create a template you don't use tables. but when joomla rendereds the page, there are at least 4 places where tables are used to structure the content. Does this tell you something about tables or the fact that the joomla community should invest more time and learn how to code css or just the fact that tables are needed when you don't know what css is going to be throw in later(which probably means they are of some use)?

    Read the article

  • Get the SEF URLs for articles in joomla

    - by DMin
    Hi, I use no-editor in joomla with SEF urls enabled. With no SEF enabled its easy to know the URL by just getting the ID of the article something like : Article 1 would be : http://www.abc.com/j15/index.php?option=com_content&view=article&id=1&Itemid=1 Now if I have SEF switched on I would get urls that look like: http://www.abc.com/j15/the-content.html Is there a way inside joomla where I can findout what the SEF URL for a particular page is? Currently I add these articles to a menu, then from the front-end I get the SEF URL and then use it. I know the process is a little dumb but I want to find-out if there is a better way inside joomla where you can get the SEF URL(using no-editor). Thanks! :)

    Read the article

  • Web app - Biometric system connection

    - by DMin
    Hi, I will be developing an application for a club where they will have visitors use biometric systems(finger print) or magnetic cards to mark their attendance. This application is planned as a web app, made using PHP/MySQL/Javascript. It does a lot of other things as well. What I wanted to find out is how is the interface between Biometric/Megnetic Card systems to a web app done? I've never worked on this and am hoping if someone who has experience with this can throw some light on this as to how this could be accomplished. Any pointers will be appreciated. (I'm afraid there's got to be some form of application installed on a pc that would interface with the hardware and probably makes calls to the web app. But, if there was a way to connect it to the web app directly, then the app would be easy to deploy to any location with minimal installation.) Thanks! :)

    Read the article

  • li + float crashes IE6

    - by DMin
    I know. The dreaded ugly browser we don't want to support, but, it seems it couldn't be simpler to crash this thing. The URL The images gallery is a Joomla Plugin(Sigplus) and works fine with all other standard browsers. In IE it was not showing correctly, all the images were showing in one line vertically one below the other. But the browser would not hang or crash and the gallery worked as well. This is a Joomla plugin and I didn't want to mess with how it works, so, for IE I added a simple rule in the header : <!--[if lt IE 7]> <style> li { float:left; margin-right:5px; } </style> <![endif]--> This fixed the issue and the gallery shows up as it should. But, as you scroll down, as you reach the last row of images IE hangs and crashes. I tried deleting the last 5 images thinking it was something to do with the images themselves. But now it hangs on the current last row and crashes. Know what it could be?

    Read the article

  • CI + Joomla 1.5

    - by DMin
    Hi, This is something that I just cooked up with Joomla and CodeIgniter(CI). I Wrote my database intensive application in CodeIgniter and frontend is Joomla. I'm using Jumi(Joomla Extention) so I can include the CI files inside joomla to basically insert the content generated by CI into Joomla articles. Problem is, you can't include CI files directly using JUMI from joomla because CI tends to route the pages so instead of seeing your joomla page with the CI content, you be redirected to the CI page itself. I did a little work around for this : Made an additional page that just basically does cURL to the CI page - gets the data and echos it out. From jumi, I include this cURL page instead. Couple of questions: I've seen at least a few posts that CI + Joomla is difficult to do(link). 1) Do you see any glaring security issues or possible performance issues? 2) Do you know of a better way to implement this? 3) What do you think of this? Do you think this is a good way to do this? There is one component out there that plugs CI with Joomla but it requires you to have a fresh CI install. It allows only one controller & the download link is down as well.

    Read the article

  • When i log on then i get annyoing cmd windows in windows7

    - by user191542
    I am using windows 7 on my office PC and that is linked with Active directory. I dont't know what happend if installed something few days ago many small softwares. I don't know if there was some virus or something but anti virus didn't tell anything. Now when i log ion then i keep getting many cmd screen opening and closing and i can't do anything. If i switch user and log with my admin acount then it also happens again witha dmin account. Now when again if i go back to old screen by switching user. then annoying cmd windows are not there. i want to know how can i fix that I managed to get print screen of that

    Read the article

  • MS Access "#Name?" in unbound field on SOME machines

    - by alkorya
    I have a datasheet form bound to table. I added 2 unbound fields and set their Control Source properties to user defined VBA functions: 1. ConcatRelated (http://allenbrowne.com/func-concat.html) 2. Custom function that returns a string: Public Function GetLowestSatatus(LookupField As String, JSAID As Integer) As String On Error Resume Next GetLowestSatatus = DLookup(LookupField, "JsaStatuses", "ID=" & DMin("StatusID", "Tasks", "JSAID =" & JSAID)) End Function It works fine on my and some other machines but there are machines I got "#Name?" in these 2 unbound fields. All machines configured identically. Any ideas? Thank you!

    Read the article

  • Running Teamsite User Admin tool IWUSERADM.exe from ASP.NET

    - by Narendra Tiwari
    It has really been a head scratching task for me. I 've tried many options but nothing worked. Finally I found a workaround on google to achive this by TaskScheduler. PROBLEM When we run Teamsite user administration command line tool IWUSERADM.exe though ASP.Net it gives following error: Application popup: cmd.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application. CAUSE No specific cause, it seems to be a bug, supposed to be resolved with this Microsoft patch http://support.microsoft.com/kb/960266. and there is nothing related to permission issue, y web application is impersonated with an administrator account. off course running a bat file from dmin account is a potential secury threat but for this scenario lets conifned our discussion to run the command line tool. RESOLUTION I have not tried this patch as I have not permitted to run this patch on server. Below are the steps to achive the requirement. 1/ Create a batch file which runs the IWUSERADM.exe.         echo - Add Teamsite User    CD E:\Appli\GN00\iw-home\bin    iwuseradm add-user %1 2/ Temporarily create a schedule task and run  the .bat file by scheduled task by ASP.Net code using TaskScheduler http://www.codeproject.com/KB/cs/tsnewlib.aspx. 3/ Here is the function: private int AddTeamsiteUser(string strBatchFilePath, string strUser) { //Get a ScheduledTasks object for the local computer. ScheduledTasks st = new ScheduledTasks(); // Create a task Task t; try{ t = st.CreateTask("~AddTeamsiteUser"); } catch { throw new Exception("Schedule Task ~AddTeamsiteUser already exist."); }    t.SetAccountInformation(yourLogin, yourPassword); //Set the account under which the task should run.  t.Save();  t.Run(); Thread.Sleep(2000); //for sync issue //Remove the scheduled task st.DeleteTask("~AddTeamsiteUser"); return t.ExitCode;   Below are few resources related to the above scenario:- - Task Scheduler Class Library for .NET  http://www.codeproject.com/KB/cs/tsnewlib.aspx - Run a .BAT file from ASP.NET  http://codebetter.com/blogs/brendan.tompkins/archive/2004/05/13/13484.aspx - TaskScheduler Class  http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.aspx - Application Hangs whle running iwuseradm.exe through ASP.Net  http://bytes.com/topic/asp-net/answers/733098-system-diagnostics-process-hangs     t.ApplicationName = strBatchFilePath; t.Parameters = strUser; t.Comment = "Adding user to Teamsite Application"

    Read the article

  • Listener error not connecting

    - by Sham
    I have two database running on Port No : 1521. When i m connecting to ORCL db it get's connected, but when i try to connect to another DB it gives me following error. ORA-12514: TNS:listener does not currently know of service requested in connect descriptor. My Listener: # listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0 \dbhome_1\network\admin\listener.ora # Generated by Oracle configuration tools. ADMIN_RESTRICTIONS_LISTENER = ON LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.1.1.1)(PORT = 1521)) ) ) ADR_BASE_LISTENER = C:\app\Administrator TNSNAMES.ora ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.1.1.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) PARIVARTAN = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.1.1.1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = Parivartan) ) ) Lsnrctl Result STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production Start Date 14-DEC-2012 14:22:51 Uptime 0 days 0 hr. 19 min. 31 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File C:\app\Administrator\product\11.2.0\dbhome_1\network\a dmin\listener.ora Listener Log File c:\app\administrator\diag\tnslsnr\127.1.1.1\listener\al ert\log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.1.1.1)(PORT=1521))) Services Summary... Service "orcl" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully Reply me soon....

    Read the article

1