Search Results

Search found 323 results on 13 pages for 'loc nhan'.

Page 4/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Mustache.js render technique

    - by PanosJee
    Hello everyone, i am trying to use mustache.js to render some JSON in the browser. What i want to do is: <li> <span class="label">Location: </span> {{#locations}} {{.}}<span class="social-small-size "></span> {{/locations}} </li> The locations is a js array [["Pendéli, Attiki, Greece", "facebook"], ["Greece", "linkedin"]] Initially i tried to use {{%IMPLICIT-ITERATOR iterator=loc}} in my attempt to split the data in the view. So i the actual rendering code was {{loc[0]}}<span class="social-small-size {{loc[1}}"></span> But that did n t work altough the loop worked and i got 2 spans but without any content. I think the PRAGMA is what I need but I didn 't figure it out. Any hints ? :)

    Read the article

  • Why is SwiftMailer throwing "Internal Server Error"?

    - by Josamoto
    I am using Symfony + SwiftMailer and getting the following error from SwiftMailer: 500 | Internal Server Error | Swift_TransportException Expected response code 220 but got code "", with message "" and can't figure out why. I am using hMailServer on my local machine, and have setup my factories.yml file (as I'm using Symfony) as follows: mailer: class: sfMailer param: logging: %SF_LOGGING_ENABLED% charset: %SF_CHARSET% delivery_strategy: realtime transport: class: Swift_SmtpTransport param: host: splodge.loc port: 25 encryption: ~ username: ~ password: ~ I'm using the following code to send: $message = $this->getMailer()->compose( 'noreply@splodge.loc', 'info@splodge.loc', 'Reset Password', 'Message' ); $result = $this->getMailer()->send($message); Has anyone had an issue like this before? I have found that sometimes, and very randomly, the send goes through, but every other time, I get the above error message. So constantly refreshing the page that sends the mail, fails unpredictably, and as the code sometimes works, it's kinda hard to figure out what's wrong. Any help will be highly appreciated!

    Read the article

  • How do I pass W3 validation for Google checkout url?

    - by Dinesh
    When I do validate the page in W3 validation, I got few errors with below code, <input type="image" name="Google Checkout" alt="Fast checkout through Google" src="https://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=xxxxxxxxx&w=168&h=44&style=white&variant=text&loc=en_US" / Errors are as follows, 1.cannot generate system identifier for general entity "w" 2.reference to entity "w" for which no system identifier could be generated 3.general entity "h" not defined and no default entity 4.reference to entity "h" for which no system identifier could be generated 5.general entity "style" not defined and no default entity 6.reference to entity "style" for which no system identifier could be generated 7.general entity "variant" not defined and no default entity 8.reference to entity "variant" for which no system identifier could be generated 9.general entity "loc" not defined and no default entity 10.reference to entity "loc" for which no system identifier could be generated This is the only errors comes from the URL; is there way to pass W3 validation for this URL.

    Read the article

  • Reading in Russian characters (Unicode) using a basic_ifstream<wchar_t>

    - by Mark
    Is this even possible? I've been trying to read a simple file that contains Russian, and it's clearly not working. I've called file.imbue(loc) (and at this point, loc is correct, Russian_Russia.1251). And buf is of type basic_string<wchar_t> The reason I'm using basic_ifstream<wchar_t> is because this is a template (so technically, basic_ifstream<T>, but in this case, T=wchar_t). This all works perfectly with english characters... while (file >> ch) { if(isalnum(ch, loc)) { buf += ch; } else if(!buf.empty()) { // Do stuff with buf. buf.clear(); } } I don't see why I'm getting garbage when reading Russian characters. (for example, if the file contains ??? ??? ???, I get "??E", 5(square), K(square), etc...

    Read the article

  • Empty namespace using Linq Xml

    - by porum
    I'm trying to create a sitemap using Linq to Xml, but am getting an empty namespace attribute, which I would like to get rid of. e.g. XNamespace ns = "http://www.sitemaps.org/schemas/sitemap/0.9"; XDocument xdoc = new XDocument(new XDeclaration("1.0", "utf-8", "true"), new XElement(ns + "urlset", new XElement("url", new XElement("loc", "http://www.example.com/page"), new XElement("lastmod", "2008-09-14")))); The result is ... <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url xmlns=""> <loc>http://www.example.com/page</loc> <lastmod>2008-09-14</lastmod> </url> </urlset> I would rather not have the xmlns="" on the url element. I can strip it out using Replace on the final xdoc.ToString(), but is there a more correct way?

    Read the article

  • Creating Dynamic variables from json response

    - by c0mrade
    My JSON response looks like this : {"sample":[{"id":"2","name":"branch name"},{"id":"3","name":"branch name 2"}]} My function looks like this : function getJSONObjects(){ $.getJSON("http://localhost/api/branches", function(data){ $.each(data.sample, function(i,item){ var loc = "branch"; eval("var " + loc + item.id + "=123;"); alert(loc + item.id); }); }); } The idea is to create branch + id object so I can do something with it(create marker on a map), so I tried to assign it any value to see if this was working. I wanted both branch2 and branch3 to alert 123 so I have something to start with. But currently this alerts branch2 and branch3 instead of 123. I have little experience with creating dynamic variables/objects can someone tell me what I'm doing wrong or maybe another approach towards solving this?

    Read the article

  • Why is JSON outputting out of order?

    - by dcp3450
    I'm am trying to get a list of weather information for 8 locations. I'm using a weather API that accepts longitude and latitude and spits back json output with the weather info for that location. I feed the coords in order 0-7 but when json processes the data it comes back in a seemingly random order. I assume it's because some process faster than others and json is outputing what it gets back as it gets it. The output is correct, only the order is wrong. var loc = null; var body = ""; var campuses = new Array(8); campuses[0] = "34.47242,-84.42489,1"; campuses[1] = "33.81488,-84.62048,2"; campuses[2] = "34.27502,-84.46976,3"; campuses[3] = "33.92987,-84.55065,4"; campuses[4] = "34.03433,-84.46723,5"; campuses[5] = "34.08362,-84.67115,6"; campuses[6] = "33.91124,-84.82634,7"; campuses[7] = "34.10409,-84.51804,8"; function getWeather(campusArray) { body += '<p class="topTitle">Campus Weather</p>'; var cSplit = new Array(); cSplit = campusArray.split(','); var loc = "http://www.worldweatheronline.com/feed/weather.ashx?q="+cSplit[0]+","+cSplit[1]+"&format=json&num_of_days=2&key=0a05fff921162948110401&callback=?"; $('#content').html('asdf'); $.getJSON(loc,function(js) { var data = js.data; var humidity = data.current_condition[0].humidity; var tempF = data.current_condition[0].temp_F; var iconDESC = data.current_condition[0].weatherDesc[0].value; var iconURL = data.current_condition[0].weatherIconUrl[0].value; var windDir = data.current_condition[0].winddir16Point; var windSpeed = data.current_condition[0].windspeedMiles; var tempMaxF = data.weather[0].tempMaxF; var tempMinF = data.weather[0].tempMinF; body += '<p class="title">'+cSplit[2]+'</p>'+ '<span class="body">'+tempF+ ' '+windSpeed+ '<img src="'+iconURL+'" /></span>'; $('#content').html(body); }); } getWeather(campuses[0]); getWeather(campuses[1]); getWeather(campuses[2]); getWeather(campuses[3]); getWeather(campuses[4]); getWeather(campuses[5]); getWeather(campuses[6]); getWeather(campuses[7]); I have also tried it as $.ajax var loc = null; var body = ""; var campuses = new Array(8); campuses[0] = "34.47242,-84.42489,1"; campuses[1] = "33.81488,-84.62048,2"; campuses[2] = "34.27502,-84.46976,3"; campuses[3] = "33.92987,-84.55065,4"; campuses[4] = "34.03433,-84.46723,5"; campuses[5] = "34.08362,-84.67115,6"; campuses[6] = "33.91124,-84.82634,7"; campuses[7] = "34.10409,-84.51804,8"; function getWeather(campusArray) { body += '<p class="topTitle">Campus Weather</p>'; var cSplit = new Array(); cSplit = campusArray.split(','); var loc = "http://www.worldweatheronline.com/feed/weather.ashx?q="+cSplit[0]+","+cSplit[1]+"&format=json&num_of_days=2&key=0a05fff921162948110401&callback=?"; $.ajax({ url: loc, async: true, dataType: "json", success: function(js) { var data = js.data; var humidity = data.current_condition[0].humidity; var tempF = data.current_condition[0].temp_F; var iconDESC = data.current_condition[0].weatherDesc[0].value; var iconURL = data.current_condition[0].weatherIconUrl[0].value; var windDir = data.current_condition[0].winddir16Point; var windSpeed = data.current_condition[0].windspeedMiles; var tempMaxF = data.weather[0].tempMaxF; var tempMinF = data.weather[0].tempMinF; body += '<p class="title">'+cSplit[2]+'</p>'+ '<span class="body">'+tempF+ ' '+windSpeed+ '<img src="'+iconURL+'" /></span>'; $('#content').html(body); } }); } getWeather(campuses[0]); getWeather(campuses[1]); getWeather(campuses[2]); getWeather(campuses[3]); getWeather(campuses[4]); getWeather(campuses[5]); getWeather(campuses[6]); getWeather(campuses[7]); EDIT: example of json output: { "data": { "current_condition": [ {"cloudcover": "100", "humidity": "93", "observation_time": "04:04 PM", "precipMM": "0.0", "pressure": "1009", "temp_C": "2", "temp_F": "36", "visibility": "8", "weatherCode": "116", "weatherDesc": [ {"value": "Mist" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0006_mist.png" } ], "winddir16Point": "WNW", "winddirDegree": "290", "windspeedKmph": "7", "windspeedMiles": "4" } ], "request": [ {"query": "Lat 34.47 and Lon -84.42", "type": "LatLon" } ], "weather": [ {"date": "2011-01-06", "precipMM": "9.3", "tempMaxC": "7", "tempMaxF": "45", "tempMinC": "2", "tempMinF": "35", "weatherCode": "113", "weatherDesc": [ {"value": "Sunny" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ], "winddir16Point": "WNW", "winddirDegree": "293", "winddirection": "WNW", "windspeedKmph": "20", "windspeedMiles": "13" }, {"date": "2011-01-07", "precipMM": "0.0", "tempMaxC": "6", "tempMaxF": "44", "tempMinC": "0", "tempMinF": "31", "weatherCode": "116", "weatherDesc": [ {"value": "Partly Cloudy" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png" } ], "winddir16Point": "WNW", "winddirDegree": "286", "winddirection": "WNW", "windspeedKmph": "25", "windspeedMiles": "16" } ] }}

    Read the article

  • anonymous type and multiple properties

    - by ognjenb
    I have this error: An anonymous type cannot have multiple properties with the same name. Whether this can be resolved with alias ie, whether an alias exists in LINQ var device_query = from d in DevicesEntities.device join dt in DevicesEntities.devicetype on d.DeviceTypeId equals dt.Id join l in DevicesEntities.location on d.Id equals l.DeviceId join loc in DevicesEntities.locationname on l.LocationNameId equals loc.Id where l.DeviceId == d.Id select new { d.Id, d.DeviceTypeId, d.SerialNumber, d.FirmwareRev, d.ProductionDate, d.ReparationDate, d.DateOfLastCalibration, d.DateOfLastCalibrationCheck, d.CalCertificateFile, d.Notes, d.TestReportFile, d.WarrantyFile, d.CertificateOfOriginFile, d.QCPermissionFile, d.Reserved, d.ReservedFor, d.Weight, d.Price, d.SoftwareVersion, dt.Name, dt.ArticleNumber, dt.Type, l.StartDate, //AS LastStartDate, l.LocationNameId, loc.Name //in this line I have problem };

    Read the article

  • Creating Google sitemap.xml , is it okay for the images to be wrapped in url tags?

    - by AzizAG
    I'm using a tool to generate the sitemap.xml file for me, it started to crawl my website, got the pages and all images, but when exporting it, I review the xml(to make sure nothing is wrong) and I noticed that the images in my website are wrapped in url tags(I think it should be in image tags). See this: <url><loc>http://mywebsite.com/images/12.jpg</loc><lastmod>2012-05-23T13:39:02+00:00</lastmod><changefreq>weekly</changefreq><priority>0.50</priority></url> Shouldn't it be wrapped in image tag?(just like videos wrapped in video tag) Thanks.

    Read the article

  • Magento Default Sitemap.xml

    - by chipShot
    Is the default magento sitemap.xml optimized as is for ecommerce products? I'm thinking about adding image links as well. Is it worth time investing in this for SEO gains? <url> <loc> http://demo.com/product.html </loc> <lastmod>2011-08-03</lastmod> <changefreq>always</changefreq> <priority>1.0</priority> </url>

    Read the article

  • Are there new flexible texteditors? [closed]

    - by RParadox
    Vi(m) and Emacs are almost 40 years old. Why are they still the standard, and what attempts have been made at coming up with a new flexible editor? Are there any features which can not be built into vim/emacs? My question is similar to this one: Time to drop Emacs and vi? No one had a suggestion, which surprises me. I would have thought that the core of a texteditor is very small and that people brew their own. Perhaps nobody wants to deal with supporting all the modes? Edit to clarify my question: Instead of writing modes and scripts I ask myself, why there is not a much lightweight project, which lets people custom the editor more directly? Vim has 365395 LOC (C lines all included), Emacs 1.5 million LOC. Why is there a project with say 50k LOC, which is the core, why people can use more freely? Perhaps there is such project, I haven't looked very far. I thought about putting together modules from Vim myself and experimenting with some ideas. The core of editing shouldn't be more than 10k? Vim has a lot optimizations which is really an overkill nowadays. Basically I'm looking for a code base for my own editor and Vi/Emacs are I believe not intended to be used in this way. Bill Joy said the following about vi. http://web.cecs.pdx.edu/~kirkenda/joy84.html The fundamental problem with vi is that it doesn't have a mouse and therefore you've got all these commands. In some sense, its backwards from the kind of thing you'd get from a mouse-oriented thing. I think multiple levels of undo would be wonderful, too. But fundamentally, vi is still ed inside. You can't really fool it. Its like one of those pinatas - things that have candy inside but has layer after layer of paper mache on top. It doesn't really have a unified concept. I think if I were going to go back - I wouldn't go back, but start over again.

    Read the article

  • jQuery line 67 saying "TypeError: 'undefined' is not a function."

    - by dfdf
    var dbShell; function doLog(s){ /* setTimeout(function(){ console.log(s); }, 3000); */ } function dbErrorHandler(err){ alert("DB Error: "+err.message + "\nCode="+err.code); } function phoneReady(){ doLog("phoneReady"); //First, open our db dbShell = window.openDatabase("SimpleNotes", 2, "SimpleNotes", 1000000); doLog("db was opened"); //run transaction to create initial tables dbShell.transaction(setupTable,dbErrorHandler,getEntries); doLog("ran setup"); } //I just create our initial table - all one of em function setupTable(tx){ doLog("before execute sql..."); tx.executeSql("CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY,title,body,updated)"); doLog("after execute sql..."); } //I handle getting entries from the db function getEntries() { //doLog("get entries"); dbShell.transaction(function(tx) { tx.executeSql("select id, title, body, updated from notes order by updated desc",[],renderEntries,dbErrorHandler); }, dbErrorHandler); } function renderEntries(tx,results){ doLog("render entries"); if (results.rows.length == 0) { $("#mainContent").html("<p>You currently do not have any notes.</p>"); } else { var s = ""; for(var i=0; i<results.rows.length; i++) { s += "<li><a href='edit.html?id="+results.rows.item(i).id + "'>" + results.rows.item(i).title + "</a></li>"; } $("#noteTitleList").html(s); $("#noteTitleList").listview("refresh"); } } function saveNote(note, cb) { //Sometimes you may want to jot down something quickly.... if(note.title == "") note.title = "[No Title]"; dbShell.transaction(function(tx) { if(note.id == "") tx.executeSql("insert into notes(title,body,updated) values(?,?,?)",[note.title,note.body, new Date()]); else tx.executeSql("update notes set title=?, body=?, updated=? where id=?",[note.title,note.body, new Date(), note.id]); }, dbErrorHandler,cb); } function init(){ document.addEventListener("deviceready", phoneReady, false); //handle form submission of a new/old note $("#editNoteForm").live("submit",function(e) { var data = {title:$("#noteTitle").val(), body:$("#noteBody").val(), id:$("#noteId").val() }; saveNote(data,function() { $.mobile.changePage("index.html",{reverse:true}); }); e.preventDefault(); }); //will run after initial show - handles regetting the list $("#homePage").live("pageshow", function() { getEntries(); }); //edit page logic needs to know to get old record (possible) $("#editPage").live("pageshow", function() { var loc = $(this).data("url"); if(loc.indexOf("?") >= 0) { var qs = loc.substr(loc.indexOf("?")+1,loc.length); var noteId = qs.split("=")[1]; //load the values $("#editFormSubmitButton").attr("disabled","disabled"); dbShell.transaction( function(tx) { tx.executeSql("select id,title,body from notes where id=?",[noteId],function(tx,results) { $("#noteId").val(results.rows.item(0).id); $("#noteTitle").val(results.rows.item(0).title); $("#noteBody").val(results.rows.item(0).body); $("#editFormSubmitButton").removeAttr("disabled"); }); }, dbErrorHandler); } else { $("#editFormSubmitButton").removeAttr("disabled"); } }); } Dats my code, awfully long, huh? Well anyways I got most of it from here, however I get an error on line 67 saying "TypeError: 'undefined' is not a function.". I'm using Steroids (phonegap-like) and testing dis on an iPhone simulator. I'm sure it uses some cordova for the database work. Thank you for your help :-)

    Read the article

  • Strange difference in bash behavior across systems

    - by pinkie_d_pie_0228
    I have two systems, an Ubuntu computer and an Android tablet. I have built and configured bash for Android to be used in adb, so it's the same version as my Ubuntu bash, and they use mostly the same bashrc and configuration, and the same exact options set by shopt. However, there is a slight difference in that the Android bash behaves as I expect when I I try to tab-complete something using a variable in it, but the Ubuntu bash doesn't. #Android ls $HOME/loc<tab> => ls $HOME/local #As expected Basically, the variable is taken into account when completing. But then #Ubuntu ls $HOME/loc<tab> => ls \$HOME/loc #Undesired behavior. The list of options is as follows, and is the same in both builds of bash. autocd:checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:histappend:interactive_comments:progcomp:promptvars:sourcepath What can be making the Ubuntu version escape the $ instead of using it for completion as in the Android build? What can I do to make both work the same way? Any help will be greatly appreciated.

    Read the article

  • Various GPS Android Functionality Questions..

    - by Tyler
    Hello - I have a few questions (so far) with the the LocationManager on Android and GPS in general.. Feel free to answer any number of the questions below, and I appreciate your help in advance! (I noticed this stuff doesn't appear to be documented very well, so hopefully these questions will help others out too!) 1) I am using the following code, but I think there may be extra fluff in here that I do not need. Can you tell me if I can delete any of this? LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener locationListener = new MyLocationListener(); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener); LocationProvider locationProvider = lm.getProvider("gps"); Location currentLocation = lm.getLastKnownLocation(locationProvider.getName()); 2) Is there a way to hold off on the last step (accessing "getLastKnownLocation" until after I am sure I have a GPS lock? What happens if this is called and GPS is still looking for signal? 3) MOST importantly, I want to ensure I have a GPS lock before I proceed to my next method, so is there a way to check to see if GPS is locked on and getLastKnownLocation is up to date? 4) Is there a way to 'shut down' the GPS listener once it does receive a lock and getLastKnownLocation is updated? I don't see a need to keep this running for my application once I have obtained a lock.. 5) Can you please confirm my assumption that "getLastKnownLocation" is updated frequently as the receiver moves? 6) In my code, I also have a class called "MyLocationListener" (code below) that I honestly just took from another example.. Is this actually needed? I assume this updates my location manager whenever the location changes, but it sure doesn't appear that there is much to the class itself! private class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location loc) { if (loc != null) { //Toast.makeText(getBaseContext(), "Location changed : Lat: " + loc.getLatitude() + " Lng: " + loc.getLongitude(), Toast.LENGTH_SHORT).show(); } } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } }

    Read the article

  • Order Multidimensional Arrays PHP

    - by ronsandova
    Hi everyone I have some problem to order an array by a field of this, here i leave the example foreach($xml as $site){ echo '<div><a href="'.$site->loc.'">'.$site->loc.'</a>' .$site->padre.'</div>'; } Some times the filed $site->padre is empty but i'd like to order by $site->padre alphabetical i saw example with usort but i don't understand how to work it. Thanks in advance. Cheers

    Read the article

  • read ArrayList elements

    - by Jessy
    Why it print the wrong output? ArrayList<String> loc = new ArrayList<String>(); This arraylist stored the value of: [topLeft, topLeft, topLeft, bottomLeft, topLeft, bottomLeft, topLeft, topLeft, Left, topLeft] the firs index 0 is = topLeft if(loc.get(1)=="topLeft") System.out.println("same") else { System.out.println("not same") } This program print the wrong output not same instead of same

    Read the article

  • Can't figure out where race condition is occuring

    - by Nik
    I'm using Valgrind --tool=drd to check my application that uses Boost::thread. Basically, the application populates a set of "Book" values with "Kehai" values based on inputs through a socket connection. On a seperate thread, a user can connect and get the books send to them. Its fairly simple, so i figured using a boost::mutex::scoped_lock on the location that serializes the book and the location that clears out the book data should be suffice to prevent any race conditions. Here is the code: void Book::clear() { boost::mutex::scoped_lock lock(dataMutex); for(int i =NUM_KEHAI-1; i >= 0; --i) { bid[i].clear(); ask[i].clear(); } } int Book::copyChangedKehaiToString(char* dst) const { boost::mutex::scoped_lock lock(dataMutex); sprintf(dst, "%-4s%-13s",market.c_str(),meigara.c_str()); int loc = 17; for(int i = 0; i < Book::NUM_KEHAI; ++i) { if(ask[i].changed > 0) { sprintf(dst+loc,"A%i%-21s%-21s%-21s%-8s%-4s",i,ask[i].price.c_str(),ask[i].volume.c_str(),ask[i].number.c_str(),ask[i].postTime.c_str(),ask[i].status.c_str()); loc += 77; } } for(int i = 0; i < Book::NUM_KEHAI; ++i) { if(bid[i].changed > 0) { sprintf(dst+loc,"B%i%-21s%-21s%-21s%-8s%-4s",i,bid[i].price.c_str(),bid[i].volume.c_str(),bid[i].number.c_str(),bid[i].postTime.c_str(),bid[i].status.c_str()); loc += 77; } } return loc; } The clear() function and the copyChangedKehaiToString() function are called in the datagetting thread and data sending thread,respectively. Also, as a note, the class Book: struct Book { private: Book(const Book&); Book& operator=(const Book&); public: static const int NUM_KEHAI=10; struct Kehai; friend struct Book::Kehai; struct Kehai { private: Kehai& operator=(const Kehai&); public: std::string price; std::string volume; std::string number; std::string postTime; std::string status; int changed; Kehai(); void copyFrom(const Kehai& other); Kehai(const Kehai& other); inline void clear() { price.assign(""); volume.assign(""); number.assign(""); postTime.assign(""); status.assign(""); changed = -1; } }; std::vector<Kehai> bid; std::vector<Kehai> ask; tm recTime; mutable boost::mutex dataMutex; Book(); void clear(); int copyChangedKehaiToString(char * dst) const; }; When using valgrind --tool=drd, i get race condition errors such as the one below: ==26330== Conflicting store by thread 1 at 0x0658fbb0 size 4 ==26330== at 0x653AE68: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/libstdc++.so.6.0.8) ==26330== by 0x653AFC9: std::string::_M_replace_safe(unsigned int, unsigned int, char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.8) ==26330== by 0x653B064: std::string::assign(char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.8) ==26330== by 0x653B134: std::string::assign(char const*) (in /usr/lib/libstdc++.so.6.0.8) ==26330== by 0x8055D64: Book::Kehai::clear() (Book.h:50) ==26330== by 0x8094A29: Book::clear() (Book.cpp:78) ==26330== by 0x808537E: RealKernel::start() (RealKernel.cpp:86) ==26330== by 0x804D15A: main (main.cpp:164) ==26330== Allocation context: BSS section of /usr/lib/libstdc++.so.6.0.8 ==26330== Other segment start (thread 2) ==26330== at 0x400BB59: pthread_mutex_unlock (drd_pthread_intercepts.c:633) ==26330== by 0xC59565: pthread_mutex_unlock (in /lib/libc-2.5.so) ==26330== by 0x805477C: boost::mutex::unlock() (mutex.hpp:56) ==26330== by 0x80547C9: boost::unique_lock<boost::mutex>::~unique_lock() (locks.hpp:340) ==26330== by 0x80949BA: Book::copyChangedKehaiToString(char*) const (Book.cpp:134) ==26330== by 0x80937EE: BookSerializer::serializeBook(Book const&, std::string const&) (BookSerializer.cpp:41) ==26330== by 0x8092D05: BookSnapshotManager::getSnaphotDataList() (BookSnapshotManager.cpp:72) ==26330== by 0x8088179: SnapshotServer::getDataList() (SnapshotServer.cpp:246) ==26330== by 0x808870F: SnapshotServer::run() (SnapshotServer.cpp:183) ==26330== by 0x808BAF5: boost::_mfi::mf0<void, RealThread>::operator()(RealThread*) const (mem_fn_template.hpp:49) ==26330== by 0x808BB4D: void boost::_bi::list1<boost::_bi::value<RealThread*> >::operator()<boost::_mfi::mf0<void, RealThread>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, RealThread>&, boost::_bi::list0&, int) (bind.hpp:253) ==26330== by 0x808BB90: boost::_bi::bind_t<void, boost::_mfi::mf0<void, RealThread>, boost::_bi::list1<boost::_bi::value<RealThread*> > >::operator()() (bind_template.hpp:20) ==26330== Other segment end (thread 2) ==26330== at 0x400B62A: pthread_mutex_lock (drd_pthread_intercepts.c:580) ==26330== by 0xC59535: pthread_mutex_lock (in /lib/libc-2.5.so) ==26330== by 0x80546B8: boost::mutex::lock() (mutex.hpp:51) ==26330== by 0x805473B: boost::unique_lock<boost::mutex>::lock() (locks.hpp:349) ==26330== by 0x8054769: boost::unique_lock<boost::mutex>::unique_lock(boost::mutex&) (locks.hpp:227) ==26330== by 0x8094711: Book::copyChangedKehaiToString(char*) const (Book.cpp:113) ==26330== by 0x80937EE: BookSerializer::serializeBook(Book const&, std::string const&) (BookSerializer.cpp:41) ==26330== by 0x808870F: SnapshotServer::run() (SnapshotServer.cpp:183) ==26330== by 0x808BAF5: boost::_mfi::mf0<void, RealThread>::operator()(RealThread*) const (mem_fn_template.hpp:49) ==26330== by 0x808BB4D: void boost::_bi::list1<boost::_bi::value<RealThread*> >::operator()<boost::_mfi::mf0<void, RealThread>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf0<void, RealThread>&, boost::_bi::list0&, int) (bind.hpp:253) For the life of me, i can't figure out where the race condition is. As far as I can tell, clearing the kehai is done only after having taken the mutex, and the same holds true with copying it to a string. Does anyone have any ideas what could be causing this, or where I should look? Thank you kindly.

    Read the article

  • How to define 'Attached property' as 'SelectedValuePath' in ComboBox?

    - by SpudCZ
    Hi, I have a problem with binding in ComboBox. I'd like to bind ComboBox items to ListView columns and as a selected value return value of attached property defined on the selected column. In example bellow you can see working sample that displays width of selected column. If you try to change SelectedValuePath in ComboBox into (loc:SampleBehavior.SampleValue) you get binding error: BindingExpression path error: '(u:SearchableListView.SearchMemberPath)' property not found on 'object' ''GridViewColumn' <Window x:Class="Problem_Sample1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:loc="clr-namespace:Problem_Sample1" WindowStartupLocation="CenterScreen" Title="Window1" Height="300" Width="300"> <DockPanel> <ComboBox DockPanel.Dock="Top" x:Name="combobox" ItemsSource="{Binding Path=View.Columns, ElementName=listview}" DisplayMemberPath="Header" SelectedValuePath="Width"> </ComboBox> <StatusBar DockPanel.Dock="Bottom"> <TextBlock> <TextBlock Text="Selected column (value): " /> <TextBlock Text="{Binding Path=SelectedValue, ElementName=combobox}" /> </TextBlock> </StatusBar> <ListView x:Name="listview"> <ListView.View> <GridView> <GridViewColumn Header="Name" Width="101" loc:SampleBehavior.SampleValue="201" /> <GridViewColumn Header="Surname" Width="102" loc:SampleBehavior.SampleValue="202" /> </GridView> </ListView.View> </ListView> </DockPanel> </Window>   SampleBehavior.cs using System.Windows; using System.Windows.Controls; namespace Problem_Sample1 { public static class SampleBehavior { public static readonly DependencyProperty SampleValueProperty = DependencyProperty.RegisterAttached( "SampleValue", typeof (int), typeof (SampleBehavior)); [AttachedPropertyBrowsableForType(typeof(GridViewColumn))] public static int GetSampleValue(GridViewColumn column) { return (int)column.GetValue(SampleValueProperty); } [AttachedPropertyBrowsableForType(typeof(GridViewColumn))] public static void SetSampleValue(GridViewColumn column, int value) { column.SetValue(SampleValueProperty, value); } } }   Thanks for any help or suggestion.

    Read the article

  • Wicket @SpringBean doesn't create serializable proxy

    - by vinga
    @SpringBean PDLocalizerLogic loc; When using above I receive java.io.NotSerializableException. This is because loc is not serializable, but this shouldn't be problem because spring beans are a serializable proxies. On the page https://cwiki.apache.org/WICKET/spring.html#Spring-AnnotationbasedApproach is written: Using annotation-based approach, you should not worry about serialization/deserialization of the injected dependencies as this is handled automatically, the dependencies are represented by serializable proxies What am I doing wrong?

    Read the article

  • How to automate a monitoring system for ETL runs

    - by Jeffrey McDaniel
    Upon completion of the Primavera ETL process there are a few ways to determine if the process finished successfully.  First, in the <installation directory>\log folder,  there is a staretlprocess.log and staretl.html files. These files will give the output results of the ETL run. The staretl.html file will give a detailed summary of each step of the process, its run time, and its status. The .log file, based on the logging level set in the Configuration tool, can give extensive information about the ETL process. The log file can be used as a validation for process completion.  To automate the monitoring of these log files, perform the following steps: 1. Write a custom application to parse through the log file and search for [ERROR] . In most cases,  a major [ERROR] could cause the ETL process to fail. Searching the log and finding this value is worthy of an alert. 2. Determine the total number of steps in the ETL process, and validate that the log file recorded and entry for the final step.  For example validate that your log file contains an entry for Step 39/39 (could be different based on the version you are running). If there is no Step 39/39, then either the process is taking longer than expected or it didn't make it to the end.  Either way this would be a good cause for an alert. 3. Check the last line in the log file. The last line of the log file should contain an indication that the ETL run completed successfully. For example, the last line of a log file will say (results could be different based on Reporting Database versions):   [INFO] (Message) Finished Writing Report 4. You could write an Ant script to execute the ETL process and have it set to - failonerror="true" - and from there send results to an external tool to monitor the jobs, send to email, or send to database. With each ETL run, the log file appends to the existing log file by default. Because of this behavior, I would recommend renaming the existing log files before running a new ETL process. By doing this,  only log entries for the currently running ETL process is recorded in the new log files. Based on these log entries, alerts can be setup to notify the administrator or DBA. Another way to determine if the ETL process has completed successfully is to monitor the etl_processmaster table.  Depending on the Reporting Database version this could be in the Stage or Star databases. As of Reporting Database 2.2 and higher this would be in the Star database.  The etl_processmaster table records entries for the ETL run along with a Start and Finish time.  If the ETl process has failed the Finish date should be null. This table can be queried at a time when ETL process is expected to be finished and if null send an alert.  These are just some options. There are additional ways this can be accomplished based around these two areas - log files or database. Here is an additional query to gather more information about your ETL run (connect as Staruser): SELECT SYSDATE,test_script,decode(loc, 0, PROCESSNAME, trim(SUBSTR(PROCESSNAME, loc+1))) PROCESSNAME ,duration duration from ( select (e.endtime - b.starttime) * 1440 duration, to_char(b.starttime, 'hh24:mi:ss') starttime, to_char(e.endtime, 'hh24:mi:ss') endtime,  b.PROCESSNAME, instr(b.PROCESSNAME, ']') loc, b.infotype test_script from ( select processid, infodate starttime, PROCESSNAME, INFOMSG, INFOTYPE from etl_processinfo  where processid = (select max(PROCESSID) from etl_processinfo) and infotype = 'BEGIN' ) b  inner Join ( select processid, infodate endtime, PROCESSNAME, INFOMSG, INFOTYPE from etl_processinfo  where processid = (select max(PROCESSID) from etl_processinfo) and infotype = 'END' ) e on b.processid = e.processid  and b.PROCESSNAME = e.PROCESSNAME order by b.starttime)

    Read the article

  • glutPostRedisplay() does not update display

    - by A D
    I am currently drawing a rectangle to the screen and would like to move it by using the arrow keys. However, when I press an arrow key the vertex data changes but the display does refresh to reflect these changes, even though I am calling glutPostRedisplay(). Is there something else that I must do? My code: #include <GL/glew.h> #include <GL/freeglut.h> #include <GL/freeglut_ext.h> #include <iostream> #include "Shaders.h" using namespace std; const int NUM_VERTICES = 6; const GLfloat POS_Y = -0.1; const GLfloat NEG_Y = -0.01; struct Vertex { GLfloat x; GLfloat y; Vertex() : x(0), y(0) {} Vertex(GLfloat givenX, GLfloat givenY) : x(givenX), y(givenY) {} }; Vertex left_paddle[NUM_VERTICES]; void init() { glClearColor(1.0f, 1.0f, 1.0f, 0.0f); left_paddle[0] = Vertex(-0.95f, 0.95f); left_paddle[1] = Vertex(-0.95f, 0.0f); left_paddle[2] = Vertex(-0.85f, 0.95f); left_paddle[3] = Vertex(-0.85f, 0.95f); left_paddle[4] = Vertex(-0.95f, 0.0f); left_paddle[5] = Vertex(-0.85f, 0.0f); GLuint vao; glGenVertexArrays( 1, &vao ); glBindVertexArray( vao ); GLuint buffer; glGenBuffers(1, &buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer); glBufferData(GL_ARRAY_BUFFER, sizeof(left_paddle), NULL, GL_STATIC_DRAW); GLuint program = init_shaders( "vshader.glsl", "fshader.glsl" ); glUseProgram( program ); GLuint loc = glGetAttribLocation( program, "vPosition" ); glEnableVertexAttribArray( loc ); glVertexAttribPointer( loc, 2, GL_FLOAT, GL_FALSE, 0, 0); glBindVertexArray(vao); } void movePaddle(Vertex* array, GLfloat change) { for(int i = 0; i < NUM_VERTICES; i++) { array[i].y = array[i].y + change; } glutPostRedisplay(); } void special( int key, int x, int y ) { switch ( key ) { case GLUT_KEY_DOWN: movePaddle(left_paddle, NEG_Y); break; } } void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDrawArrays(GL_TRIANGLES, 0, 6); glutSwapBuffers(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(500,500); glutCreateWindow("Rectangle"); glewInit(); init(); glutDisplayFunc(display); glutSpecialFunc(special); glutMainLoop(); return 0; }

    Read the article

  • XMLHttpRequest leak in javascript. please help.

    - by Raja
    Hi everyone, Below is my javascript code snippet. Its not running as expected, please help me with this. <script type="text/javascript"> function getCurrentLocation() { console.log("inside location"); navigator.geolocation.getCurrentPosition(function(position) { insert_coord(new google.maps.LatLng(position.coords.latitude,position.coords.longitude)); }); } function insert_coord(loc) { var request = new XMLHttpRequest(); request.open("POST","start.php",true); request.onreadystatechange = function() { callback(request); }; request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); request.send("lat=" + encodeURIComponent(loc.lat()) + "&lng=" + encodeURIComponent(loc.lng())); return request; } function callback(req) { console.log("inside callback"); if(req.readyState == 4) if(req.status == 200) { document.getElementById("scratch").innerHTML = "callback success"; window.setTimeout("getCurrentLocation()",5000); } } getCurrentLocation(); //called on body load </script> What i'm trying to achieve is to send my current location to the php page every 5 seconds or so. i can see few of the coordinates in my database but after sometime it gets weird. Firebug show very weird logs like simultaneous POST's at irregular intervals. Here's the firebug screenshot: IS there a leak in the program. please help.

    Read the article

  • Segmentation fault on the server, but not local machine

    - by menachem-almog
    As stated in the title, the program is working on my local machine (ubuntu 9.10) but not on the server (linux). It's a grid hosting hosting package of godaddy. Please help.. Here is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { long offset; FILE *io; unsigned char found; unsigned long loc; if (argc != 2) { printf("syntax: find 0000000\n"); return 255; } offset = atol(argv[1]) * (sizeof(unsigned char)+sizeof(unsigned long)); io = fopen("index.dat","rb"); fseek(io,offset,SEEK_SET); fread(&found,sizeof(unsigned char),1,io); fread(&loc,sizeof(unsigned long),1,io); if (found == 1) printf("%d\n",loc); else printf("-1\n"); fclose(io); return 0; } EDIT: It's not my program. I wish I knew enough C in order to fix it, but I'm on a deadline. This program is meant to find the first occurrence of a 7 digit number in the PI sequence, index.dat contains an huge array number = position. http://jclement.ca/fun/pi/search.cgi

    Read the article

  • Segmentation Fault (C) occur on the server, but works on local machine

    - by menachem-almog
    As stated in the title, the program is working on my local machine (ubuntu 9.10) but not on the server (linux). It's a grid hosting hosting package of godaddy. Please help.. Here is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { long offset; FILE *io; unsigned char found; unsigned long loc; if (argc != 2) { printf("syntax: find 0000000\n"); return 255; } offset = atol(argv[1]) * (sizeof(unsigned char)+sizeof(unsigned long)); io = fopen("index.dat","rb"); fseek(io,offset,SEEK_SET); fread(&found,sizeof(unsigned char),1,io); fread(&loc,sizeof(unsigned long),1,io); if (found == 1) printf("%d\n",loc); else printf("-1\n"); fclose(io); return 0; }

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >