Search Results

Search found 20065 results on 803 pages for 'practice problems'.

Page 83/803 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • jquery validation problems

    - by CoffeeCode
    to custom validate an input i wrote a script: function cardNumberCheck(value, element) { var res = false; $.get("/CaseHistories/ValidateCardNumber", { caseHistoryId: $('#CaseHistory_Id').val(), cardNumber: $('#CaseHistory_CardNumber').val() }, function(data) { res = data }); //alert(res) => works fine return true/false return res; } $.validator.addMethod("cardValidate", cardNumberCheck, "invalid"); if ($('#CaseHistory_CardNumber').is("form *")) { //<= check if elem is in a form $('#CaseHistory_CardNumber').rules("add", { required: true, cardValidate: true, messages: { required: "*", cardValidate: "invalid" } }); } EDIT: the required rule works fine, but my validation method doesn't dispalt the message. and the submit works even if the elements data havent passed the cardNumberCheck validation whats not right here?

    Read the article

  • c++ webservice having problems with Mozilla Firefox browser

    - by prasanna
    Hi , About Problem:- We have a webservice written in c++.And we use cgi scripts in HTML pages to run our own exe which will output HTML. With IE i am not seeing any problem. But With Mozilla FireFox 3.0 there is error showing up as " You have chosen to open gefebt.exe which is a : Application from http:\3.212.219.180\test Would you like to save this file" Also i did some investigation :- i have created a virtual directory using IIS where when i click hyperlink i have made gefebt.exe to execute. With IIS there is no problem untill Execute Permissions is set to "Scripts and Executables" . If i select scripts i could see the same message in IE and mozilla plugin. At the same time i not seeing any difference with the code of Webservice. The way we are reffering the executable in HTML is href=gefebt.exe?xyz.bclInvoke xyz.bcl - I have also tries with IFrames and frames .

    Read the article

  • Problems with http://wall.plasm.it/examples/example-the-wall/ - Images

    - by wolfau
    It is probably piece of cake for You, but I'm in the black hole now and I don't know what is the problem with The Wall. I would like to do something as www.wall.plasm.it/examples/example-the-wall/. Please - look at: www.megainstal.pl/ there is not any images. Could You help with fix it? I will be really grateful for any help/information. Short story: 1) I download the files from github: https://github.com/plasm/the-wall 2) I changed only 3 files: 01-wall.css, index.html, 01-wall.js (case: basic) 3) in 01-wall.js I declared images: var a = new Element("img[src=../../img/middle/"+counterFluid+".jpg]"); 4) images that are: 1 to 76.jpg Could you point me to where I making a mistake? If You going to see source files - I zip that's all in the one file: files.zip S. from Poland Thank You in advance!

    Read the article

  • Parallel For Loop - Problems when adding to a List

    - by Kevin Crowell
    I am having some issues involving Parallel for loops and adding to a List. The problem is, the same code may generate different output at different times. I have set up some test code below. In this code, I create a List of 10,000 int values. 1/10th of the values will be 0, 1/10th of the values will be 1, all the way up to 1/10th of the values being 9. After setting up this List, I setup a Parallel for loop that iterates through the list. If the current number is 0, I add a value to a new List. After the Parallel for loop completes, I output the size of the list. The size should always be 1,000. Most of the time, the correct answer is given. However, I have seen 3 possible incorrect outcomes occur: The size of the list is less than 1,000 An IndexOutOfRangeException occurs @ doubleList.Add(0.0); An ArgumentException occurs @ doubleList.Add(0.0); The message for the ArgumentException given was: Destination array was not long enough. Check destIndex and length, and the array's lower bounds. What could be causing the errors? Is this a .Net bug? Is there something I can do to prevent this from happening? Please try the code for yourself. If you do not get an error, try it a few times. Please also note that you probably will not see any errors using a single-core machine. using System; using System.Collections.Generic; using System.Threading.Tasks; namespace ParallelTest { class Program { static void Main(string[] args) { List<int> intList = new List<int>(); List<double> doubleList = new List<double>(); for (int i = 0; i < 250; i++) { intList.Clear(); doubleList.Clear(); for (int j = 0; j < 10000; j++) { intList.Add(j % 10); } Parallel.For(0, intList.Count, j => { if (intList[j] == 0) { doubleList.Add(0.0); } }); if (doubleList.Count != 1000) { Console.WriteLine("On iteration " + i + ": List size = " + doubleList.Count); } } Console.WriteLine("\nPress any key to exit."); Console.ReadKey(); } } }

    Read the article

  • Problems initializing a final variable in Java

    - by froadie
    I keep running into slight variations of a problem in Java and it's starting to get to me, and I can't really think of a proper way to get around it. I have an object property that is final, but dynamic. That is, I want the value to be constant once assigned, but the value can be different each runtime. So I declare the class level variable at the beginning of the class - say private final FILE_NAME;. Then, in the constructor, I assign it a value - say FILE_NAME = buildFileName(); The problem begins when I have code in the buildFileName() method that throws an exception. So I try something like this in the constructor: try{ FILE_NAME = buildFileName(); } catch(Exception e){ ... System.exit(1); } Now I have an error - "The blank final field FILE_NAME may not have been initialized." This is where I start to get slightly annoyed at Java's strict compiler. I know that this won't be a problem because if it gets to the catch the program will exit... But the compiler doesn't know that and so doesn't allow this code. If I try to add a dummy assignment to the catch, I get - "The final field FILE_NAME may already have been assigned." I clearly can't assign a default value before the try-catch because I can only assign to it once. Any ideas...?

    Read the article

  • IPhone memory problems...

    - by jAmi
    Hi, I am working on an App that is already been made but Memory Management was not considered in the development stages. So what can I do to keep the App memory usage low as soon as I get a memory warning? Is there any general tool or some piece of code that I can use to release any unused memory?

    Read the article

  • Problems using Hibernate and Spring in web application

    - by user628480
    Hi.I'm having NullPointerException trying to getCurrentSession() java.lang.NullPointerException servlets.ControlServlet.doPost(ControlServlet.java:46) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) I use Tomcat 5.5 index.jsp page: <%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title></title> </head> <body> <%@ page import="java.util.List" %> <%@ page import="data.Singer" %> <jsp:useBean id="singer" class="data.Singer" scope="session"/> <jsp:setProperty name="singer" property="*" /> <form action="ControlServlet" method="POST"> <form method=“POST”> Name:<br /> <input type=“text” name="name" /><br /> Type:<br /> <input type=“text” name="type" /><br /> <input type="submit" name="Add song" value="Add song"> <input type="submit" name="save" value="Save" /><br><br> <input type ="submit" name="values" value="Get values" > </form> </body> </html> web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>webproject</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/beans.xml, /WEB-INF/conf.xml, /WEB-INF/singers.hbm.xml, /WEB-INF/songs.hbm.xml, /WEB-INF/singerbeans.xml, /WEB-INF/songbeans.xml</param-value> </context-param> <servlet> <servlet-name>context</servlet-name> <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>test</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>*.*</url-pattern> </servlet-mapping> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/beans.xml, /WEB-INF/conf.xml, /WEB-INF/singers.hbm.xml, /WEB-INF/songs.hbm.xml, /WEB-INF/singerbeans.xml, /WEB-INF/songbeans.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>2</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet> <description> </description> <display-name>ControlServlet</display-name> <servlet-name>ControlServlet</servlet-name> <servlet-class>servlets.ControlServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ControlServlet</servlet-name> <url-pattern>/ControlServlet</url-pattern> </servlet-mapping> </web-app> ControlServlet.java public class ControlServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Autowired private SingerDao singerdao; public SingerDao getSingerDao() { return singerdao; } public void setSingerDao(SingerDao singerdao) { this.singerdao = singerdao; } public ControlServlet() { super(); // TODO Auto-generated constructor stub } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getParameter("values") != null) { response.getWriter().println(singerdao.getDBValues()); } } } and SingerDao.java public class SingerDao implements SingerDaoInterface { @Autowired private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public List getDBValues() { Session session = getCurrentSession(); List<Singer> singers = session.createCriteria(Singer.class).list(); return singers; } private org.hibernate.classic.Session getCurrentSession() { return sessionFactory.getCurrentSession(); } public void updateSinger(Singer singer) { Session session = getCurrentSession(); session.update(singer); } public Singer getSinger(int id) { Singer singer = null; Session session = getCurrentSession(); singer = (Singer) session.load(Singer.class, id); return singer; } public void deleteSinger(Singer singer) { Session session = getCurrentSession(); session.delete(singer); } public void insertRow(Singer singer) { Session session = getCurrentSession(); session.save(singer); } } In simple Java Project it works fine.I think sessionFactory doesn't autowires,but why? Thanks all.

    Read the article

  • Problems uploading different file types in codeigniter

    - by Drew
    Below is my script that i'm using to upload different files. All the solutions I've found deal only with multiple image uploads. I am totally stumped for a solution on this. Can someone tell me what it is i'm supposed to be doing to upload different files in the same form? Thanks function do_upload() { $config['upload_path'] = './uploads/nav'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '2000'; $this->load->library('upload', $config); if ( ! $this->upload->do_upload('userfile')) { $error = array('error' => $this->upload->display_errors()); return $error; } else { $soundfig['upload_path'] = './uploads/nav'; $soundfig['allowed_types'] = 'mp3|wav'; $this->load->library('upload', $soundfig); if ( ! $this->upload->do_upload('soundfile')) { $error = array('error' => $this->upload->display_errors()); return $error; } else { $data = $this->upload->data('userfile'); $sound = $this->upload->data('soundfile'); $full_path = 'uploads/nav/' . $data['file_name']; $sound_path = 'uploads/nav/' . $sound['file_name']; if($this->input->post('active') == '1'){ $active = '1'; }else{ $active = '0'; } $spam = array( 'image_url' => $full_path, 'sound' => $sound_path, 'active' => $active, 'url' => $this->input->post('url') ); $id = $this->input->post('id'); $this->db->where('id', $id); $this->db->update('NavItemData', $spam); return true; } } } Here is my form: <?php echo form_open_multipart('upload/do_upload');?> <?php if(isset($buttons)) : foreach($buttons as $row) : ?> <h2><?php echo $row->name; ?></h2> <input type="file" name="userfile" size="20" /><br /> <input type="file" name="soundfile" size="20" /> <input type="hidden" name="oldfile" value="<?php echo $row->image_url; ?>" /> <input type="hidden" name="id" value="<?php echo $row->id; ?>" /> <br /><br /> <label>Url: </label><input type="text" name="url" value="<?php echo $row->url; ?>" /><br /> <input type="checkbox" name="active" value="1" <?php if($row->active == '1') { echo 'checked'; } ?> /><br /><br /> <input type="submit" value="submit" /> </form> <?php endforeach; ?> <?php endif; ?>

    Read the article

  • Django caching seems to be causing problems

    - by Issy
    Hey guys, i have just implemented the Django Cache Local Memory back end in some my code, however it seems to be causing a problem. I get the following error when trying to view the site (With Debug On): Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 279, in run self.result = application(self.environ, self.start_response) File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 651, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 245, in __call__ response = middleware_method(request, response) File "/usr/lib/python2.6/dist-packages/django/middleware/cache.py", line 91, in process_response patch_response_headers(response, timeout) File "/usr/lib/python2.6/dist-packages/django/utils/cache.py", line 112, in patch_response_headers response['Expires'] = http_date(time.time() + cache_timeout) TypeError: unsupported operand type(s) for +: 'float' and 'str' I have checked my code, for caching everything seems to be ok. For example, i have the following in my middleware. MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', ) My settings for Cache: CACHE_BACKEND = 'locmem://' CACHE_MIDDLEWARE_SECONDS = '3600' CACHE_MIDDLEWARE_KEY_PREFIX = 'za' CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True And some of my code (template tag): def get_featured_images(): """ provides featured images """ cache_key = 'featured_images' images = cache.get(cache_key) if images is None: images = FeaturedImage.objects.all().filter(enabled=True)[:5] cache.set(cache_key, images) return {'images': images} Any idea what could be the problem, from the error message below it looks like there's an issue in django's cache.py?

    Read the article

  • Problems with .net and toolbar, menu & status bar rendermode (blue) and standard form (grey)

    - by Andrew White
    Hiya, I'm a bit of a newbie to .NET so please ignore my ignorance. If you look at the above image (a complete prototype, ignore black bits :)) you will see lovely menus, toolbars & statusbars all using windows XP render mode and in a funky blue. Look at the form, labels, checkboxes and other buttons and you see horrible old school windows grey. These components don't have a render mode. My question: is there any way to show everything in XP style or do I have to chose new components? Thx. A.

    Read the article

  • Problems with Json Serialize Dictionary<Enum, Int32>

    - by dbemerlin
    Hi, whenever i try to serialize the dictionary i get the exception: System.ArgumentException: Type 'System.Collections.Generic.Dictionary`2[[Foo.DictionarySerializationTest+TestEnum, Foo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not supported for serialization/deserialization of a dictionary, keys must be strings or object My Testcase is: public class DictionarySerializationTest { private enum TestEnum { A, B, C } public void SerializationTest() { Dictionary<TestEnum, Int32> data = new Dictionary<TestEnum, Int32>(); data.Add(TestEnum.A, 1); data.Add(TestEnum.B, 2); data.Add(TestEnum.C, 3); JavaScriptSerializer serializer = new JavaScriptSerializer(); String result = serializer.Serialize(data); // Throws } public void SerializationStringTest() { Dictionary<String, Int32> data = new Dictionary<String, Int32>(); data.Add(TestEnum.A.ToString(), 1); data.Add(TestEnum.B.ToString(), 2); data.Add(TestEnum.C.ToString(), 3); JavaScriptSerializer serializer = new JavaScriptSerializer(); String result = serializer.Serialize(data); // Succeeds } } Of course i could use .ToString() whenever i enter something into the Dictionary but since it's used quite often in performance relevant methods i would prefer using the enum. My only solution is using .ToString() and converting before entering the performance critical regions but that is clumsy and i would have to change my code structure just to be able to serialize the data. Does anyone have an idea how i could serialize the dictionary as <Enum, Int32>? I use the System.Web.Script.Serialization.JavaScriptSerializer for serialization.

    Read the article

  • Problems with blocking reads using libudev on Linux

    - by Steve Hawkins
    We are using the following routine (on Linux, with libudev) to read data from a PIC microcontroller configured as a USB HID device. The data is sent only when a button connected to the PIC microcontroller is pressed or released. The routine is missing messages from the PIC controller, and I suspect that this is because the call to poll below is not behaving as it should. The call to poll will reliably block for 1 second util the first message is read. As soon as the first message is read, the call to poll returns immediately instead of blocking for 1 second (1000 milliseconds) like it should. I have worked around this problem by closing and re-opening the device after each read. This makes poll behave correctly, but I think that closing and re-opening the device may be the reason for the lost messages. bool PicIo::Receive (unsigned char* picData, const size_t picDataSize) { static hiddev_report_info hidReportInfo; static hiddev_usage_ref_multi hidUsageRef; if (-1 == PicDeviceDescriptor()) { return false; } // Determine whether or not there is data available to be read pollfd pollFd; pollFd.fd = PicDeviceDescriptor(); pollFd.events = POLLIN; int dataPending = poll (&pollFd, 1, 1000); if (dataPending <= 0) { return false; } // Initialize the HID Report structure for an input report hidReportInfo.report_type = HID_REPORT_TYPE_INPUT; hidReportInfo.report_id = 0; hidReportInfo.num_fields = 64; if (-1 == ioctl(PicDeviceDescriptor(), HIDIOCGREPORT, &hidReportInfo)) { return false; } // Initizlize the HID Usage Reference for an Input report hidUsageRef.uref.report_type = HID_REPORT_TYPE_INPUT; hidUsageRef.uref.report_id = 0; hidUsageRef.uref.field_index = 0; hidUsageRef.uref.usage_index = 0; hidUsageRef.num_values = 64; if (-1 == ioctl(PicDeviceDescriptor(), HIDIOCGUSAGES, &hidUsageRef)) { return false; } // Transfer bytes from the usage report into the return value. for (size_t idx=0; (idx < 64) && (idx < picDataSize); ++idx) { picData[idx] = hidUsageRef.values[idx]; } return true; } The function PicDeviceDescriptor() does checking on the device to make sure that it is present. Here are the pertinent details of the PicDeviceDescriptor function, showing how the device is begin opened. int PicIo::PicDeviceDescriptor(int command) { struct stat statInfo; static int picDeviceDescriptor = -1; string picDevicePath = "/dev/usb/hiddev0"; if ((-1 != picDeviceDescriptor) && (CLOSE == command)) { close (picDeviceDescriptor); picDeviceDescriptor = -1; } else if ((-1 != picDeviceDescriptor) && (-1 == fstat(picDeviceDescriptor, &statInfo))) { // Handle the case where the PIC device had previously been detected, and // is now disconnected. close (picDeviceDescriptor); picDeviceDescriptor = -1; } else if ((-1 == picDeviceDescriptor) && (m_picDevice.IsConnected())) { // Create the PIC device descriptor if the PIC device is present (i.e. its // device node is present) and if the descriptor does not already exist picDeviceDescriptor = open (picDevicePath.c_str(), O_RDONLY); } return picDeviceDescriptor; } I'm sure that I'm doing something wrong, but I've Googled the issue and cannot seem to find any relevant answers. Any help would be very much appreciated -- Thx.

    Read the article

  • Apache Rewrite problems with my blog

    - by roacha
    Hey Guys, I am having a hard time getting the rewrite rule setup correctly for my website&blog. Here is the current line in Apache's virtual host: RewriteRule ^/(?:blog|apc|_em|phpsecinfo|blog/)/ - [L] I am able to access my URL at www.domainname.com/blog/ But I am unable to access it at www.domainname.com/blog (without the ending /) How can I edit my Rewrite rule so that I can reach the blog without the ending / ? Thanks

    Read the article

  • global std::unordered_map com server init problems

    - by PrettyFlower
    I want to have a static global std::unordered_map in the cpp of my entry point for my COM server. relevant header code: typedef unordered_map<HWND,IMyInterface*> MyMapType; relevant body: static MyMapType MyMap; void MyFunction(HWND hWnd, IMyInterface* pObj){ MyMap[HWND] = pObj; } HINSTANCE g_hInstModule = NULL; BOOL WINAPI DllMain ( __in HINSTANCE hInstDLL, __in DWORD fdwReason, __in LPVOID lpvReserved ) { if( fdwReason == DLL_PROCESS_ATTACH ) { g_hInstModule = hInstDLL; return true; } else if( fdwReason == DLL_PROCESS_DETACH ) { return true; } return false; } MyCoClass::MyCoClass() { DRM_Refcount = 1; } HRESULT STDMETHODCALLTYPE MyCoClass::InitMyCoClass() { CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); //replace with make window code MyFunction(hWnd,ISomeInterface); return S_OK; } The only way I can get this to work is be making a map_type pointer and creating an instance of map_type on the heap and pointing at it with the global pointer. :/ WHY?

    Read the article

  • While loop problems

    - by Luke
    I have put together the following code, the problem is that each while loop is only returning one set of data. $result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date"); $i = 1; echo "<table cellspacing=\"10\" style='border: 1px dotted' width=\"300\" bgcolor=\"#eeeeee\">"; while ($row = mysql_fetch_assoc($result)) { $date=date("F j Y", $row['date']); echo $date; echo " <tr> <td>Fixture $i - Deadline on $date</td> </tr> "; $result = mysql_query("SELECT * FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' AND date = '$row[date]' ORDER BY date"); while ($row = mysql_fetch_assoc($result)) { extract ($row); echo " <tr> <td>$home_user - $home_team V $away_user - $away_team</td> </tr> "; } $i++; } echo "</table>"; I should get many dates, and then each set of fixture below. At the moment, the first row from the first while loop is present, along with the data from the second while loop. However, it doesn't continue? Any ideas where I can correct this? Thanks

    Read the article

  • ASP.Net Form Databound problems

    - by Jason Bitman
    I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great. I have an ImageButton controlwhich has an OnClick Event set to grab all of the data from the form. Unfortunately, when I click the button, it seems as though the page is reloading first, and THEN is executes the OnClick call. The data that was hand-entered, or hard-coded seems to be pulled fine from the controls it was entered in, but anything that was pulled from a datasource is not able to be read. Any ideas. this is the last hurdle in a project that I have been working on for 6 months. I want to go home... Thank you so much in advance. Jason

    Read the article

  • more problems with the LAG function is SAS

    - by SAS_learner
    The following bit of SAS code is supposed to read from a dataset which contains a numeric variable called 'Radvalue'. Radvalue is the temperature of a radiator, and if a radiator is switched off but then its temperature increases by 2 or more it's a sign that it has come on, and if it is on but its temperature decreases by 2 or more it's a sign that it's gone off. Radstate is a new variable in the dataset which indicates for every observation whether the radiator is on or off, and it's this I'm trying to fill in automatically for the whole dataset. So I'm trying to use the LAG function, trying to initialise the first row, which doesn't have a dif_radvalue, and then trying to apply the algorithm I just described to row 2 onwards. Any idea why the columns Radstate and l_radstate come out completely blank? Thanks everso much!! Let me know if I haven't explained the problem clearly. Data work.heating_algorithm_b; Input ID Radvalue; Datalines; 1 15.38 2 15.38 3 20.79 4 33.47 5 37.03 ; DATA temp.heating_algorithm_c; SET temp.heating_algorithm_b; DIF_Radvalue = Radvalue - lag(Radvalue); l_Radstate = lag(Radstate); if missing(dif_radvalue) then do; dif_radvalue = 0; radstate = "off"; end; else if l_Radstate = "off" & DIF_Radvalue > 2 then Radstate = "on"; else if l_Radstate = "on" & DIF_Radvalue < -2 then Radstate = "off"; else Radstate = l_Radstate; run;

    Read the article

  • Problems with noobs putting my GA code into their sites

    - by dclowd9901
    I don't mean for the title to be derogatory, but this is a rather frustrating problem, and I'm looking for a good workaround, given a language barrier involved. I have a site set up for a plugin I wrote, and, rather than use the site's resources to write their own code, I've had people simply rip the code from the samples on the site. Normally, this wouldn't be any issue at all, but they are also taking my Google Analytics instantiation, so my Analytics data is getting very skewed by incorporating visitation data from their websites. I've been able to contact the English-speaking site owners with little issue. The problem lies in the Japanese language sites that are yanking the code. I have no idea how to ask them to take down the analytics portion. Long-term, I'm providing a package that streamlines the learning-to-use process, but in the meantime, what can I do about this language barrier? Is there a way around this problem that I haven't thought of?

    Read the article

  • Problems manipulating strings through a stdcall to a dll

    - by ibiza
    I need to create a C++ dll that will be called from another program through stdcall. What is needed : the caller program will pass an array of string to the dll and the dll should change the string values in the array. The caller program will then continue to work with these string values that came from the dll. I made a simple test project and I am obviously missing something... Here is my test C++ dll : #ifndef _DLL_H_ #define _DLL_H_ #include <string> #include <iostream> struct strStruct { int len; char* string; }; __declspec (dllexport) int __stdcall TestFunction(strStruct* s) { std::cout << "Just got in dll" << std::endl; std::cout << s[0].string << std::endl; //////std::cout << s[1].string << std::endl; /* char str1[] = "foo"; strcpy(s[0].string, str1); s[0].len = 3; char str2[] = "foobar"; strcpy(s[1].string, str2); s[1].len = 6; */ //std::cout << s[0].string << std::endl; //std::cout << s[1].string << std::endl; std::cout << "Getting out of dll" << std::endl; return 1; } #endif and here is a simple C# program that I am using to test my test dll : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace TestStr { class Program { [DllImport("TestStrLib.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)] public static extern int TestFunction(string[] s); static void Main(string[] args) { string[] test = new string[2] { "a1a1a1a1a1", "b2b2b2b2b2" }; Console.WriteLine(test[0]); Console.WriteLine(test[1]); TestFunction(test); Console.WriteLine(test[0]); Console.WriteLine(test[1]); Console.ReadLine(); } } } And here is the output produced : a1a1a1a1a1 b2b2b2b2b2 Just got in dll b2b2b2b2b2 Getting out of dll a1a1a1a1a1 b2b2b2b2b2 I have some questions : 1) Why is it outputting the element in the second position of the array rather than in the first position?? 2) If I uncomment the line commented with ////// in the dll file, the program crashes. Why? 3) Obviously I wanted to do more things in the dll (the parts in /* */) than what it does right now, but I am blocked by the first 2 questions... Thanks for all your help

    Read the article

  • MVC routing problems - url generation

    - by roncansan
    Hi, I what to create a url that looks like website.com/sea/season/23/team Here is the MapRoute routes.MapRoute( "SeaTeam", "sea/season/{seasonId}/team/{action}/{name}", new { controller = "Team", action = "Index", name = UrlParameter.Optional} ); The Html.ActionLink looks like @Html.ActionLink("Add Team", "Index", "SeaTeam", new { seasonId = seasons.id }, null) But its generating the following url <a href="/SeaTeam?seasonId=1">Add Team</a> Any insights? Thanks...

    Read the article

  • Problems installing RMagick with Paperclip in Rails 3

    - by Smickie
    Hi, I'm trying to use paperclip in rails and when I'm doing the "bundle install" I'm getting the following error: Can't install RMagick 2.13.1. Can't find Magick-config in /usr/local/mysql/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/seanhinton/.rvm/bin What I'm wondering is how do I install RMagick (is that what I need?) on my machine (it's OSX 10.6)? Cheers!

    Read the article

  • Problems with display of UTF-8 encoded content from a DB

    - by LookUp Webmaster
    Dear members of the Stackoverflow community, We are developing a web application using the Zend Framework, and we are facing some encoding issues that we hope you might help us solve. The situation goes something like this: There are certain tables on a MySQL database that need to be displayed as html. Because the site is designed using the Spanish language, the database contains some characters like "á" or "ñ". Our internal policy is to set all the encodings as UTF-8, including all the databases and the tables. The problem is, that when we retrieve the content from the DB, some characters are displayed as question marks. We are out of ideas. These are all the things that we have already tried and double-checked: 1. The SQL file from which we load all the data is properly UTF-8 encoded. 2. The SQL is loaded through phpmyadmin (which is configured as UTF-8), and the resulting tables are displayed properly. 3. The netbeans environment used for coding is also set as UTF-8. The weird thing is that all the content that is hard-coded either as php or html is displayed properly. Only the values that are extracted from the database have issues. Any ideas? Thank you very much.

    Read the article

  • Source code versioning with comments (organizational practice) - leave or remove?

    - by ADTC
    Before you start admonishing me with "DON'T DO IT," "BAD PRACTICE!" and "Learn to use proper source code control", please hear me out first. I am fully aware that the practice of commenting out old code and leaving it there forever is very bad and I hate such practice myself. But here's the situation I'm in. A few months ago I joined a company as software developer. I had worked in the company for few months as an intern, about a year before joining recently. Our company uses source code version control (CVS) but not properly. Here's what happened both in my internship and my current permanent position. Each time I was assigned to work on a project (legacy, about 8-10 years old). Instead of creating a CVS account and letting me check out code and check in changes, a senior colleague exported the code from CVS, zipped it up and passed it to me. While this colleague checks in all changes in bulk every few weeks, our usual practice is to do fine-grained versioning in the actual source code itself (each file increments in versions independent from the rest). Whenever a change is made to a file, old code is commented out, new code entered below it, and this whole section is marked with a version number. Finally a note about the changes is placed at the top of the file in a section called Modification History. Finally the changed files are placed in a shared folder, ready and waiting for the bulk check-in. /* * Copyright notice blah blah * Some details about file (project name, file name etc) * Modification History: * Date Version Modified By Description * 2012-10-15 1.0 Joey Initial creation * 2012-10-22 1.1 Chandler Replaced old code with new code */ code .... //v1.1 start //old code new code //v1.1 end code .... Now the problem is this. In the project I'm working on, I needed to copy some new source code files from another project (new in the sense that they didn't exist in destination project before). These files have a lot of historical commented out code and comment-based versioning including usually long or very long Modification History section. Since the files are new to this project I decided to clean them up and remove unnecessary code including historical code, and start fresh at version 1.0. (I still have to continue the practice of comment-based versioning despite hating it. And don't ask why not start at version 0.1...) I have done similar something during my internship and no one said anything. My supervisor has seen the work a few times and didn't say I shouldn't do such clean-up (if at all it was noticed). But a same-level colleague saw this and said it's not recommended as it may cause downtime in the future and increase maintenance costs. An example is when changes are made in another project on the original files and these changes need to be propagated to this project. With code files drastically different, it could cause confusion to an employee doing the propagation. It makes sense to me, and is a valid point. I couldn't find any reason to do my clean-up other than the inconvenience of a ridiculously messy code. So, long story short: Given the practice in our company, should I not do such clean-up when copying new files from project to project? Is it better to make changes on the (copy of) original code with full history in comments? Or what justification can I give for doing the clean-up? PS to mods: Hope you allow this question some time even if for any reason you determine it to be unfit in SO. I apologize in advance if anything is inappropriate including tags.

    Read the article

  • More XML Problems - Undeclared Entity 'nbsp'

    - by Gogster
    I'm getting the error: Line 49: xml = r.ReadToEnd(); Line 50: Line 51: System.Xml.Linq.XDocument xmlDoc = System.Xml.Linq.XDocument.Parse(xml); Line 52: Line 53: var query = from p in xmlDoc.Descendants("member") On my XML. When I run the code to generate the XML in an empty page, it runs without error, if I call the code within my webpage it throws this error. The only 'nbsp' on the page is a doctype declaration at the top of the XSLT: <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> I'm at a loss as to where this error is coming from and I am looking for suggestions please! Thanks.

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >