Posts

c - unable to use library build with gobject-introspection in python -

it's first question on stackoverflow. before start i'm sorry poor english i'm developing library "pocketvox". it's aim provide easy way use pocketsphinx (voice recognition) on linux system control it. the main project stored here https://github.com/benoitfragit/pocketvox i've coded in c , want give developers access in python. i've generated .gir , .typelib files. library name pocketvox , every files present i tried load if failed: from gi.repository import pocketvox i've set gi_typelib_path variable in order point folder containing typelib file nothing changed if has knowledge in gobject-introspection c/python, need resolve problem i found myself, ld_library_path not good

asp.net - Cannot Update Entity Using EF 6 - ObjectStateManager Error -

i'm trying update entity using entity framework version 6. i'm selecting entity database so... public t find<t>(object id) t : class { return this._dbcontext.set<t>().find(id); } and updating entity so.. public t update<t>(t entity) t : class { // primary key of entity object id = this.getprimarykeyvalue(entity); // original entry t original = this._dbcontext.set<t>().find(id); if (original != null) { // automatic stuff here (taken out example) // overwrite original property values new values this._dbcontext.entry(original).currentvalues.setvalues(entity); this._dbcontext.entry(original).state = entitystate.modified; // commit changes database this.save(); // return entity new property values return entity; } return default(t); } the getprimarykeyval...

mod rewrite - .htaccess error 500 on RewriteRule -

this line cause 500 error in apache : rewriterule ^(.*)$ /frontend/artist/artist.php?seo=$1 [qsa,l] here htaccess : <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_host} ^test\.fr [nc] rewriterule ^(.*)$ http://www.test.fr/$1 [l,r=301] rewriterule ^(.*)$ /frontend/artist/artist.php?seo=$1 [qsa,l] </ifmodule> any ideas why ? that's because you're creating infinite loop error. your rule match , execute on , on. example: http://www.test.fr/this/url/is/cool will rewritten to /frontend/artist/artist.php?seo=this/url/is/cool which rewritten because rule matches without exception. and on... solution to avoid behaviour, can add simple condition (check if it's existing file or not) <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{http_host} !^www\. [nc] rewriterule ^(.*)$ http://www.%{http_host}/$1 [l,r=301] rewritecond %{request_filename} !-f rewriterule ^(.*)$ /frontend/artist/artist.php?seo=$1 [qs...

javascript - Node Jquery Scraping Issue -

i trying run simple scrape on webpage, issue running can't seem bee selecting html elements scraper correctly. thought grabbing attributes correctly <li> , i'm getting undefined value each of object properties. i'm looking grab data-name , data-address , data-url values. scrape.js var request = require('request'); var cheerio = require('cheerio'); request('http://personalsite.com', function (error, response, html) { if (!error && response.statuscode == 200) { var $ = cheerio.load(html); $('li').each(function(i, element){ var li = $(this).contents(); var name = li.attr('name'); var address = li.attr('address'); var url = li.attr('url'); var metadata = { name : name, address : address, url : url }; console.log(metadata); }); } }); html: <li id="v1065" data-name=...

Matrix multiplication in C++ gives Runtime Error -

i'm using following c++ code matrix multiplication , runs fine size = 500. when size = 600 or above code fails. (runtime error) i ran on ideone.com ouputs "runtime error time: 0 memory: 3292 signal:11" and in local machine giving me error #include <cstdlib> #include<iostream> #include <stdio.h> #include <sys/time.h> using namespace std; class timer { private: timeval starttime; public: void start(){ gettimeofday(&starttime, null); } double stop(){ timeval endtime; long seconds, useconds; double duration; gettimeofday(&endtime, null); seconds = endtime.tv_sec - starttime.tv_sec; useconds = endtime.tv_usec - starttime.tv_usec; duration = seconds + useconds/1000000.0; return duration; } static void printtime(double duration){ printf("%5.6f seconds\n", duration); } }; using namespace std; const int size = 600; // size*size matrix void multiplymatricessequential(double a[...

php - Symfony2, difference between isValid() and $this->get('validator') -

i'm new in symfony2 , wish know what's difference of validate form between: $form->isvalid() and $this->get('validator')->validate($form->getdata()) using validation rules in validations.yml thank you! the validator, in case, checks object form bound. form::isvalid() method, besides, checks form status (whether form submitted, whether disabled).

cordova - Phonegap run android gives error -

i trying run basic hello-world app. totally frustrated can't find solution this. wrong? have tried these solutions still no luck. please me :'( c:\apps>phonegap create app3 [phonegap] create called options c:\apps\app3 com.phonegap.helloworld helloworld [phonegap] customizing default config.xml file [phonegap] created project @ c:\apps\app3 c:\apps>cd app3 c:\apps\app3>phonegap local run android [phonegap] adding android platform... creating cordova project android platform: path: platforms\android package: com.phonegap.helloworld name: helloworld android target: android-19 copying template files... running: android update project --subprojects --path "platforms\android" --target android-19 --library "cordovalib" resolved location of library project to: c:\apps\app3\platforms\android\cordovalib updated , renamed default.properties project.prope...