Posts

Showing posts from January, 2011

node.js - CityHash in Javascript -

i'm looking use cityhash64 javascript. found this node module can't figure out how make independent of node, possible? my intention use webrowser (firefox, chrome, safari, ie) addon. you can use murmurhash instead. https://github.com/garycourt/murmurhash-js cityhash has higher throughput , more complex, murmurhash has lower latency short keys , relatively simple. both more adequate sort of hashing needs might have.

Hibernate: ManytoOne - how many object? -

i have database many object (for example "ad"), every ad belongs 1 "category". relationship manytoone. fetch ads , eager option in every ad reference category object. question is: if several ads same category, each category created unique object or references point 1 same object? if ad1 , ad2 both belong same category c1 , loaded in same hibernate session, both have reference same category object c1.

angularjs - Unable to access scope property in directive -

i'm building combobox plugin in angular, , i'm @ point i'm getting sorts of weird behaviors can't figure out. here's 1 of them: i have 1 directive (called linksedit) contains within comboboxes. in link function of linksedit directive, set following array: scope.levels = [ { 'id': 'link', 'value': 'link'}, { 'id': 'affiliate', 'value': 'affiliate'}, { 'id': 'partner', 'value': 'partner'}, ]; in directive, have combobox directive, passing levels value: <combobox data="levels" value="cb_value" search="data.level" strict></combobox> and combobox have isolate scope: scope: { 'data': '=data', 'search': '=search', 'value': '=value', } i have code in combobox sets default value of combobox based on data.level is. linksedit directive called once (with

Difference between basis path testing and full path testing? -

looking @ them, both seem exact same thing: finding possible paths in cfg. there difference between them? what path testing? path testing structural testing method involves using source code of program in order find every possible executable path. helps determine faults lying within piece of code. method designed execute or selected path through computer program. any software program includes, multiple entry , exit points. testing each of these points challenging time consuming. in order reduce redundant tests , achieve maximum test coverage, basis path testing used. what basis path testing? the basis path testing same, based on white box testing method, defines test cases based on flows or logical path can taken through program. basis path testing involves execution of possible blocks in program , achieves maximum path coverage least number of test cases. hybrid of branch testing , path testing methods. the objective behind basis path testing defines number of i

java - Google play supported devices 0 with pdfbox-android -

have problem already-published application on google play. the application in store, no 1 can download, because of error supported devices 0 . i did refactor project, removed unnecessary manifest. compiled new apk, , again "supported devices 0". i use pdfbox-android-1.8.8.jar. if remove pdfbox project, "supported devices 7700". i build project eclipse. what mean? manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.firm.project" android:versioncode="3" android:versionname="1.01" > <uses-sdk android:minsdkversion="15" android:targetsdkversion="21"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.camera"/> <application android:name=&quo

text mining - Modifying corpus by inserting codewords using Python -

i have corpus (30,000 customer reviews) in csv file (or txt file). means each customer review line in text file. examples are: this bike amazing, brake poor this ice maker works great, price reasonable, bad smell ice maker the food awesome, water rude i want change these texts following: this bike amazing positive, brake poor negative this ice maker works great positive , price reasonable positive, bad negative smell ice maker the food awesome positive, water rude negative i have 2 separate lists (lexicons) of positive words , negative words. example, text file contains such positive words as: amazing great awesome very cool reasonable pretty fast tasty kind and, text file contains such negative words as: rude poor worst dirty slow bad so, want python script reads customer review: when of positive words found, insert "positive" after positive word; when of negative words found, insert "negative" after positive word. her

spatial index - Undefined reference to libspatialindex functions in C++ -

i'm getting started libspatialindex. ran through instructions install @ http://libspatialindex.github.io/install.html , installed ok on ubuntu following commands (except couldn't find autogen.sh mentions). ./configure make sudo make install then made simple program test follows (based on https://github.com/libspatialindex/libspatialindex/wiki/simple-tutorial ) #include <spatialindex/capi/sidx_api.h> using namespace spatialindex; int main(int argc, char* argv[]) { char* pszversion = sidx_version(); } and compile follows: g++ -lspatialindex spatial.cpp -o spatial and gives me error: /tmp/ccack3p4.o: in function `main': spatial.cpp:(.text+0xa): undefined reference `sidx_version' collect2: ld returned 1 exit status i've tried many different things such using cmake instead , installing different folder no luck. ideas? edit: added namespace spatialindex above , tried following, still not luck: g++ -c -o spatial.o spatial.cpp g++ -o sp

c# - How to count bytes of data stored inside a DataTable -

assume have datagridview bound datatable. there simple yet realiable way determine total size of stored data (in bytes) inside datatable? if want number of cells, can multiplying columns rows: int cells = tbl.columns.count * tbl.rows.count; if want size in bytes, try serializing datatable , measuring size, won't 100% accurate, since add boilerplate.

javascript - Regex for Arrays within an Array -

i have array of arrays (call outer array arr1) numerous values inner arrays. trying validate inner arrays have following format elements arr1[1] provided example (the other elements of arr1, i.e. arr1[2], arr1[3], arr1[4], etc. of same format arr1[1] = ['item1', 'item2', 'item3', 'item4', 'item5']: item 1 - "abcdef" (variable number of letters) item 2 - "abcdef" (variable number of letters) item 3 - "abcdef" (variable number of letters) or "abcdef asdf" (variable number of letters separated 1 whitespace character) item 4 - "12345678" (eight digits) item 5 - "123 456 7890" (telephone number 3 digits followed 3 digits followed 4 digits 2 whitespace characters shown) here snippet of have far (not sure how second line works - got different thread): function f(s) { var s2 = (""+s).replace(/\d/g, ''); var m = s2.match(/^(\d{3})(\d{3})(\d{4})$/); } thanks

sql - Tuples in NoSQL the same as RDBMS? -

i know rdbms have concept of tuples (that are, understand, unordered rows of data). i learned nosql databases use key value stores or tuples store data. if both nosql , rdbms use tuples, have same definition? if do, differentiate rdbms , nosql database uses tuples store data? the different nosql database use different methods store data. nosql database couchdb, store data json file not have predefined schema while nosql oracle nosql use both tuple storage(tableapi) , json (key/value api) store data. while have tuples in oracle nosql, have defined schema fields values can changes. say have field store array of data. define filed while creating table not need inform length of array field. if have person table, need store 4 different address person person1 , person has 2 different address. in nosql, can store these parenttable.childtable, without defining how many addresses person has. person1 ---> 4 different address (dynamic) person2 ---> 2 different addre

javascript - Sencha cmd 5 minify issue -

i trying minify sencha 5 project sencha cmd, failed. sencha generate app -ext demoapp ./demoapp then try minify app, typing sencha app build production for blank project, minify success, can run in local web server. change existing project have been created, add 1 button display popup window (and information displayed xtype "displayfield"). before minified & after add 1 button display popup, works normal (tested in browser, click button, popup , information showed correctly). after minified, doesn't work, get http://localhost/test/sencha/demoapp/widget/displayfield.js?_dc=1429726459576 404 not found. "networkerror: 404 not found - http://localhost/test/sencha/demoapp/widget/displayfield.js?_dc=1429726459576 " is weird? if change xtype "displayfield" "textfield" works normal, or if change "button" , change fieldlabel text, works! anyone have succesfull minify sencha 5 sencha cmd? sencha cmd ver

How to do custom validation in JavaScript -

i have function works input prevent customers inputting p.o. box address field. input works has inline onkeypress event, input need run function on doesn't (and can't access it). my question how incorporate correct event listener function runs on inaccessible input? my js fiddle here: http://jsfiddle.net/zqqs9/4/ function killpobox(id) { var idvalue = document.getelementbyid('v65-onepage-shipaddr1').value; if (id == 'v65-onepage-shipaddr1') { function runval() { if (idvalue.substr(0,4).touppercase() === "po b" || idvalue.substr(0,5) === "p.o. ") { alert("usa light cannot ship p.o. boxes. please enter street address."); } } setinterval(runval(),1); } } <!-- practice input works --> 1. <input type="text" class="quantity" name="v65-onepage-shipaddr1" id="v65-onepage-shipaddr1" onkeypress="killpobox(this.name)"

drop down menu - putting divider/line for dropdown in _settings.scss in Foundation -

yesterday, playing _settings.scss fille , accidentally added divider(a 1 pixel line) in between values of dropdown. today, can't figure out is. just decided write new class using border-top

osx - How to stop xcode debugger from mangling filesystem NSURLs on OS X? -

i trying write mac app converts files. stuck @ beginning because app cannot open local files, @ least while running in debugger. use nsopenpanel create valid file nsurl: “file:///volumes/seagate_1tib/projects/dataskunk/wasteproduct.xml” but somewhere in xcode, or debugger or whatever, gets mangled into "/users/charlweed/library/developer/xcode/deriveddata/dataskunk-ghkiumvdkopxarhavynetidlqxio/build/products/debug/file:/volumes/bigdrive/dataskunk/wasteproduct.xml" reading file fails "no such file or directory error". how prevent mangling during development? for example, gives error, no matter file chosen: let fileresult = openfiledialog("choose file", message:"message") let xmlinfileurlopt: nsurl? = nsurl.fileurlwithpath(fileresult) if let xmlinfileurl = xmlinfileurlopt { var xmlfileerror: nserror? if !xmlinfileurl.checkpromiseditemisreachableandreturnerror(&xmlfileerror){ println("\(xmlfileerror

css - progress element transparent background -

i have <progress> bar , want color track linear-gradient . effect want achieve though having portions of transparent, styled way progress[value]::-webkit-progress-bar { background-image: linear-gradient( right, red 33%, rgba(0,0,0,0) 33%, rgba(0,0,0,0) 66%, yellow 66%, yellow 100%); } this renders grey bar in 33% 66% portion, instead of plain transparent. i've tried using value transparent not seem work. still solid default color. here fiddle: http://jsfiddle.net/0jayslzu/ is possible apply transparency track of progress element? short answer background-image: should background: long answer have progress[value]::-webkit-progress-bar { background-image: linear-gradient( right, red 33%, rgba(0,0,0,0) 33%, rgba(0,0,0,0) 66%, yellow 66%, yellow 100%); } it should progress[value]::-webkit-progress-bar { background: linear-gradient( right, red 33%, rgba(0,0,0,0) 33%, rgba(0,0,0,0) 66%, yellow 66%, yellow 100%); }

javascript - Intl.js polyfill/shim with webpack? -

i'm using react-intl webpack , need intl shim support safari , ie, don't want load browsers support intl spec . the polyfill pretty huge (900kb), how can ensure gets loaded in browsers don't support already? there few things need do. make sure require intl/intl loads core library , not of associated countries. reduce size of library from around 900kb around 150kb. use webpack's require.ensure or require([]) functions dynamically require intl.js when needed. create separate bundle intl.js file, loaded on as-needed basis. lib/shim.js // shim intl needs loaded dynamically // callback when we're done represent // kind of "shimready" event module.exports = function(callback) { if (!window.intl) { require(['intl/intl'], function(intl) { window.intl = intl; callback(); }); } else { settimeout(callback, 0); // force async } }; app.js var shimready = require('l

Python random number excluding one variable -

is possible create variable random number except 1 number stored in variable? for example: import random x = raw_input("number: ") y = random.randint(1,6) so variable x never y try this: import random x = int(raw_input("number(1-6): ")) # note made x int while true: y = random.randint(1, 6) if x != y: break

windows - RabbitMQ on WindowsServer 2012 R2 crashes on start -

i'm trying run rabbitmq on windows server 2012 r2 machine, keeps crashing. here's see when running "rabbitmqctl status": c:\program files (x86)\rabbitmq server\rabbitmq_server-3.5.1\sbin>rabbitmqctl status status of node 'rabbit@mymachinename' ... error: unable connect node 'rabbit@mymachinename': nodedown diagnostics =========== attempted contact: ['rabbit@mymachinename'] rabbit@mymachinename: * unable connect epmd (port 4369) on mymachinename: address (cannot connect host/port) current node details: - node name: 'rabbitmq-cli-6880@mymachinename' - home dir: c:\users\myname - cookie hash: l9d52tpzwbcgggpy6qps3g== c:\program files (x86)\rabbitmq server\rabbitmq_server-3.5.1\sbin> here's see in logs (after long series of apparently successful "progress report" entries): =crash report==== 22-apr-2015::11:57:24 === crasher: initial call: rabbit_epmd_monitor:init/1 pid: <0.165.0> r

html - Bootstrap CSS Style Issue -

Image
i trying figure out how adjust of bootstrap css styling fix issue running into. i using page header class create title consistent across pages. on page working on, there more information add right side of page within header. anytime try appear above line, goes below or in middle , line doesnt seem move. fiddle: http://jsfiddle.net/rka18lze/ <div class="container"> <div class="page-header"> <h3 class="text-info">a page header here</h3> </div> <div class="row"> <div class="col-md-4 col-md-offset-8 text-right"> <h5 class="text-info">owner: <a href="#" target="_blank">bob smith</a></h5> <h5 class="text-info">type: desktop</h5> <h5 class="text-info">status: active</h5> </div> </div> </div> here example of trying accomplish: is the

c# - Multiple TempData variables passed to same action -

i'm creating asp.net web application using mvc , entity framework. have 2 different success messages passing index action when user clocks in or clocks out. success message print correctly when user clocks in, not when user clocks out reason. the actions similar , used of same conventions can't figure out why 1 print , not. i've tried debugging , there no red flags , updates in database should. not possible pass multiple tempdata variables same action? here relevant code: controller // get: timeclocks public actionresult index() { viewbag.clockinsuccess = tempdata["clockinsuccess"]; viewbag.clockoutsuccess = tempdata["clockoutsuccess"]; return view(); } [httppost] public actionresult clockin(timeclock timeclock) { if(db.timeclocks.tolist().count == 1) { modelstate.addmodelerror("existserror", "you clocked in at" + timeclock.clockin);

sorting - Ordered lattice point enumeration -

setup: let ei orthogonal basis n-dimensional euclidean space, suppose ei has irrational (l1) norm. let l set of points obtained taking linear combinations of ei coefficients in natural numbers (including zero). order points in l first l1-norm , lexicographically. question: there efficient algorithm producing points in l in increasing order pre-defined bound? note not want produce points , sort them, rather want walk lattice in order. observation: easy if ei orthonormal basis. instance, problem solved here . in principle similar work here, determining radii iterate on hard solving enumeration problem, isn't useful. how this: let l₁ , l₂ lists of vectors, l₁ list of visited/processed lattice vectors , l₂ list of lists of vectors visited next. set l₁={ } , l₂ = {[0]}, 0 zero-vector. let v smallest vector of first list in l₂. visit/process vector v. add list l={v+e₁,...,v+e n } l₂, such lists sorted smallest element. generate v+e i long norm smaller predefi

makefile - Multi-line define in GNU make -

i'm trying make sense out of multi-line define directive of gnu make , cannot. example: define 1 2 endef all: @echo w=$(word 1,$(a)) running make produces result have expected least: w=1 make: 2: command not found make: *** [all] error 127 it appears part of $(a) has spilled outside $(word) function. is bug or intended behavior? if "spill" intentional, how works? p.s. gnu make v3.81 on linux/x64 the $(word) function splitting on spaces. not whitespace, spaces. there no spaces in a macro nothing gets split. add trailing space on 1 line or leading space on 2 line , expected behaviour. this consistent across gnu make 3.81, 3.82, 4.0, , 4.1 in quick testing here. the reason see "spill" called because of how define expanded. expanded literally, newline , all. (think template expansion.) so make expands define call $(word 1,...) expands result (the whole define including newline) recipe template , ends 2 lines executes r

c++ - No viable overloaded operator for references a map -

i trying use map can make tag names reference number. when try , use it, in code error (6 in total every time reference map): src/main.cpp:25:45: error: no viable overloaded operator[] type 'std::map<std::string, std::string>' const char* idcs = node.child_value(tagmap[3]); this code: #include "pugi/pugixml.hpp" #include <iostream> #include <string> #include <map> int main() { pugi::xml_document doca, docb; std::map<std::string, pugi::xml_node> mapa, mapb; std::map<std::string, std::string> tagmap {{"1", "data"}, {"2", "entry"}, {"3", "id"}, {"4", "content"}}; if (!doca.load_file("a.xml") || !docb.load_file("b.xml")) { std::cout << "can't find input files"; return 1; } (auto& node: doca.child(tagmap[1]).children(tagmap[2])) { co

html5 - Corner design in css -

Image
this question has answer here: ribbon “3d” effect 1 answer i have image , wondering how design. how design highlighted borders in css , html. use couple of pseudo elements , create triangles borders position them absolutely sit want. more information on pseudo elements example div{ background:#999; height:300px; position:relative; width:100px; } div::before,div::after{ content:""; left:100px; position:absolute; } div::before{ border-bottom:20px solid #333; border-right:20px solid transparent; top:0; } div::after{ border-top:20px solid #333; border-right:20px solid transparent; bottom:0; } <div></div>

python - Why would an io.BytesIO stream close when passed as an argument? -

i have django app user posts file. view grabs file, passes threaded function , processes it. problem is, io.bytesio stream gets closed before can read , can't figure out why gets closed. i'm processing excel files using xlrd library. excel files uploaded, stream stays open close. don't understand what's going on under hood figure out why. i'm asking debugging advice. can't provide full code i've outlined code path looks below. my django view grabs file post request: ufile = request.files['upload-file'].file ufile instance of io.bytesio . have function copies stream named temporary file @contextmanager def temp_input_file(file_): temp = tempfile.namedtemporaryfile(delete=false) shutil.copyfileobj(file_, temp) temp.close() yield temp.name os.unlink(temp.name) this contextmanager decorated function used little later. next step create thread process uploaded file: job.run_job( method=process_excel_file, uploaded_fil

random - srand() range not as intended c++ -

i trying generate random 9 digit numbers reason number 1000*****. feel srand good, else must going on? int ssn = (rand() % 899999999) + 100000000; it appears rand_max considerably less nine-digit number. put: values generated rand() small purposes. you'll need use different rng.

entity framework - The operation cannot be completed because the DbContext has been disposed - LifestylePerWcfOperation -

i have wcf web service encountering concurrency issues. load small @ moment, expected increase great amount in next few days. the overall setup wcf, entity framework 6, dependency injection (castle windsor), unitofwork & repository pattern. i setup stress test hits service in parallel , can recreate concurrency errors such as.... an error reported while committing database transaction not determined whether transaction succeeded or failed on database server. the changes database committed successfully, error occurred while updating object context. objectcontext might in inconsistent state. inner exception message: acceptchanges cannot continue because object's key values conflict object in objectstatemanager. make sure key values unique before calling acceptchanges. the property 'id' part of object's key information , cannot modified. from research i've done, looks should injecting dbcontext lifestyleperwcfoperation. it's being done lifestyle

How to count multiple checked checkbox in each row of a table in jsp -

i have multiple check-boxes in each row of table in "jsp" page , want count number of checked check-boxes in each row of table , display it's counter corresponding each row on same page. i don't have ideas on how it. if using jquery, attach change event check-boxes , count number of checked items in each row. once count, can display ever like. $('input[type="checkbox"]').change(function() { $('#checkboxtable tr').each(function() { var count = $(this).find(':checkbox:checked').length; $(this).find('.cbcount').html(count + ' checkboxes checked.'); }); }); here working fiddle see how works.

java - Upgraded to AppCompat v22.1.0 and now getting "removing attribute" error -

Image
i've upgraded app use appcompat v22.1.0 , i'm getting following exception appcompat layout xml file: removing attribute http://schemas.android.com/apk/res/android:layout_marginend <imageview> removing attribute http://schemas.android.com/apk/res/android:textalignment <android.support.v7.internal.widget.dialogtitle> removing attribute http://schemas.android.com/apk/res/android:layoutdirection <linearlayout> i upgraded version v1.8 of jdk , not work either. see discussion on https://code.google.com/p/android/issues/detail?id=164673 you have couple of options: set preferences > android > build > build output normal or silent . verbose causing problem. force sdk build tools 21.1.2 appcompat project in project.properties, see https://github.com/dandar3/android-support-v7-appcompat/blob/master/project.properties you can have many sdk build tools installed, can specify version per project or otherwise pick latest.

Not able to read all folders & files available in azure storage container using c#? -

i using below code read files available in azure : private const string account = "testaccount"; private const string key = "i1ymjhk1pp10kbxu4mnuaxxnsupk3usn8b85ttsunxzo+wlz+uybfl/mckd8q7yqaa=="; private const string url = "http://testaa.blob.core.windows.net/contractattachments/201503/20150302110215315197/20150331114910310626/test%20-%20copy%20-%20file.txt"; private const string containername = "testfiles"; private const string blobname = "file1"; static void main(string[] args) { // storage storagecredentialsaccountandkey creds = new storagecredentialsaccountandkey(account, key); cloudblobclient blobstorage = new cloudblobclient(url, creds); //get blob container cloudblobcontainer blobcontainer = blobstorage.getcontainerreference(containername); blobcontainerpermissions permissions = new blobcontainerpermissions(); permis

pci - How can a PCIe card dma data into CPU ram? -

this in reference this answer given similar dma/pci question. gathered answer pc not have dma capable of transferring data to/from pci card, , pci card must provide dma capabilites. have received similar answers colleagues saying, "a two-way dma needs on fpga (referring pci card) enable burst transfers to/from cpu memory." my understanding when pc receives read request, needs fulfill read request creating return packet data requested. so, if card requests page of data (4096 bytes), pc needs return packet 4096 bytes. how card's dma reach across bus , use it's dma fill needed packet this answer suggests? i think there might misunderstanding here. card not "reach across" bus use dma function in pc. the card bus master. can directly read , write entire memory of pc, cpu can. pc memory system point of view, there no difference between card or main cpu in pc. both bus masters. both can perform reads , writes memory. bursts of 4096 bytes no

php - Form 'submit' button always ending with error -

i've created simple contact form using this sample css-tricks . worked great until customised contactthanks.php page (confirmation of successful form submission). every time user hits 'submit', redirected error page. live page: alookat.org/contact.html (feel free test form). the following contactengine.php broke things after edited it. removed telephone input , replaced website. re-orded inputs. <?php $emailfrom = "info@example.com"; $emailto = "my.personal.email.was.here.for.testing@gmail.com"; $subject = "thanks contacting us"; $name = trim(stripslashes($_post['name'])); $email = trim(stripslashes($_post['email'])); $website = trim(stripslashes($_post['website'])); $message = trim(stripslashes($_post['message'])); // validation $validationok=true; if (!$validationok) { print "<meta http-equiv=\"refresh\" content=\"0;url=error.htm\">"; exit; } // pre

sockets - Windows 7 firewall and port 7000 -

i try make php websocket. found liblary/example http://www.sanwebe.com/2013/05/chat-using-websocket-php-socket - working on localhost, in laptop/computer in same network not. i know problem windows 7 firewall on server. if setup exception port 7000 tcp send , incoming data - not anything. if turn off firewall, example link works - form remote (i set router). i have configured in firewall exception ftp server, ports 21 , 20 - works correctly. any ideas? khinked, problem number port 7000, after turn off windows firewall ok, works correctly. update: 23-04-2015 00:12 i don't understand, when setup port 8080 websocket, working, don't know why? you can use netstat -a -b on computer before start program listening on port 7000. here example pc java installed. proto local address foreign address state tcp 0.0.0.0:7000 mypc:0 listening [java.exe] tcp 0.0.0.0:8000 mypc:0 listenin

java - Revert decoded html string back to encoded string wihout losing tags -

i wanna convert decoded html charsequence normal form. can't find way it. in example, after converting back, got "text" in both variable b , c. should include bold tag. charsequence = html.fromhtml("<b>text</b>"); string b = html.escapehtml(a); // b "text", cannot convert "<b>text</b>" string c = textutils.htmlencode(a); // same b by way, need use charsequence decoded html. no string. encoded html, type ok.

c++ - Qt4 undefined reference to `QAbstractVideoSurface::QAbstractVideoSurface(QObject*)' in Ubuntu 14.04 -

i have seen 2 related questions: undefined reference `strlwr' undefined reference in qt4 but none of them solved mine. error title said , there same 76 errors in total: /videowidgetsurface.cpp:15: error: undefined reference `qabstractvideosurface::qabstractvideosurface(qobject*)' i use qt4.8.6 , qtcreator3.3.2 , ubuntu14.04(i386) . the .pro file this: qt += core gui multimediakwidgets widgets greaterthan(qt_major_version, 4): qt += widgets target = test1 template = app sources += main.cpp \ videowidgetsurface.cpp \ videoplayer.cpp \ videowidget.cpp headers += \ videowidgetsurface.h \ videoplayer.h \ videowidget.h i tried qt += core gui multimedia didn't work , version of qt4 doesn't include qtmultimedia module. this example of qt official tutorial. ideas? in advance. qt += multimedia this works on qt5. for qt4 should that: config += mobility mobility = multimedia see example .

debugging - C++: Do I need GCC and GDB with the same version to debug -

i developing in c++ on windows mingw. have debugging problems @ moment. i must use , old version of gcc (4.4). wondering if possible compile old gcc , debug new gdb? what link between 2 of them? thanks! (any pointers regarding debugger crashes appreciated too! know need sure use debug dlls) gdb , gcc separate programs -- separate source bases (with bit of shared code, though not much), separate maintainers, different release schedules, , different version numbers. share bit of culture , of course there coordination. gdb reasonably backward compatibility. keeps workarounds bugs in debuginfo emitted older versions of gcc , other compilers. means can upgrade gdb while keeping same gcc version. the reverse, though, not case. new version of gcc emits debug info older gdb cannot understand. in situation must upgrade gdb well. in limited situations can pass compatibility flag gcc ask downgraded debug info, isn't possible. and, since simple upgrade gdb, migh

javascript - Replacing a href link using jQuery .attr -

i'm trying change content of href using jquery. i've found number of answers on site, , trying use 1 implement it: how change href hyperlink using jquery i have wrapped in if statement this: if(window.location.href == "http://test.com/home.aspx"){ $("a[href='https://www.surveymonkey.com/s/tester123']").attr('href', 'https://www.surveymonkey.com/s/tester234'); } i've put console logs in place , show line of code being reached, , this: $("a[href='https://www.surveymonkey.com/s/tester123']") is returning correct link. href value never replaced when check page source. i'm using http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js?build=7111092 i'm bit stuck on how debug issue is, can spot it? stupid mistake! --edit-- i have checked using inspect element , it's not been replaced unfortunately. also @vohuman , @roxxypoxxy info on not being able see change unless

python 2 and python 3 __cmp__ -

when use code in python 2 works fine while python 3 gives me error class point: def __init__(self,x,y): self.x=x self.y=y def dispc(self): return ('(' +str(self.x)+','+str(self.y)+')') def __cmp__(self,other): return ((self.x > other.x) , (self.y > other.y)) .................................................................... shubham@shubham-vpcea46fg:~/documents/programs$ python3 -i classes.py >>> p=point(2,3) >>> q=point(3,4) >>> p>q traceback (most recent call last): file "<stdin>", line 1, in <module> typeerror: unorderable types: point() > point() >>> shubham@shubham-vpcea46fg:~/documents/programs$ python -i classes.py >>> p=point(2,3) >>> q=point(3,4) >>> p>q false >>> ................................................................... in python 3 gives e

java - Visualiser in MATSim -

i master's student in transportation , trying use matsim traffic simulation. using linux , eclipse ide.. completed steps upto running sample project java application. http://matsim.org/node/599#startvisualizer but want visualise data using visualiser mentioned there..but no steps given how launch visualiser jar file.. 3.4. start visualizer bluntly says launch visulaiser..i don't know java..but tried launch visualiser java -jar via-app-1.5.1.jar but ends could not find main class: com.senozon.via.via. the linux distribution of via should come shell script (simply called via . run that: ./via to start visualizer.

java - check our package in stacktrace -

i have stack trace array below stacktraceelement[] stacktrace = e.getstacktrace(); from stack trace below need first line of mypackage. org.apache.cxf.jaxrs.client.abstractclient.checkclientexception(abstractclient.java:522) @ org.apache.cxf.jaxrs.client.clientproxyimpl.dochainedinvocation(clientproxyimpl.java:544) @ org.apache.cxf.jaxrs.client.clientproxyimpl.invoke(clientproxyimpl.java:205) @ $proxy94.run(unknown source) @ com.mypackage.service.bankbridgeservicetest.test(bankbridgeservicetest.java:507) com.mypackage.service.bankbridgeservicetest.test(bankbridgeservicetest.java:102) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) i wrote code like for(stacktraceelement stacktraceelement : stacktrace){ if(!stacktraceelement.isnativemethod()) { system.out.println(stacktrace.tostring()) break; } } but

Can't get ModelForm to show in template - Django -

i have been trying form show 8hours no luck. have read every question on site , others , didn't resolve problem. models.py class quote(models.model): first_name = models.charfield(verbose_name=('first name'), max_length=35, null=true,blank=true) last_name = models.charfield(verbose_name=_('last name'), max_length=35,null=true,blank=true) forms.py class quoteform(forms.modelform): class meta: model = quote fields = '__all__' views.py def get_quote(request): if request.method == 'post': form = quoteform(request.post or none) if form.is_valid(): #form.save() # process data in form.cleaned_data required # ... # redirect new url: return httpresponseredirect('/testing/thank-you/') else: form = quoteform() return render(request, 'request-for-quote.html', {'form': form}) urls.py urlpatterns =

Separate webapp for custom components in Moqui -

i have read in many places "you want create own runtime directory , keep in own source repository...". can tell me how that? if don't want lose of ootb components? currently planning have separate webapp custom developed components. let's say, want have "ootb" mount point ootb components , blank "" mount point custom developed components. how should that? have tried without success: <webapp-list> <webapp name="webroot" http-port="8080" https-enabled="false"> <root-screen host=".*/ootb" location="component://webroot/screen/webroot.xml"/> </webapp> <webapp name="customroot" http-port="8080" https-enabled="false"> <root-screen host=".*" location="component://customroot/screen/customroot.xml"/> </webapp> </webapp-list> if not work 1 other solution can think of have

selenium - Will the Implicit wait will move on if findElement action is complete? -

implicit wait : if wait set, wait specified amount of time each findelement / findelements call. throw exception if action not complete. assume set implicit wait 10 secs. question selenium move on next step if findelement action complete before 10 secs? yes . setting implicit wait causes driver object to wait set time if element looking not found immediately . driver object keeps polling dom every 500 milliseconds until finds element or time-out expires. this explanation official selenium documentation page : an implicit wait tell webdriver poll dom amount of time when trying find element or elements if not available. default setting 0. once set, implicit wait set life of webdriver object instance. so, answer question in short, yes continues executing next steps finds element(s) looking for. may understand case simple experiment @sircapsalot has shown in answer.

c++ - Rendering a QGraphicsScene to QImage results in objects being placed on a side of QImage -

Image
my qgraphicsscene quite large, , qgraphicsview fit small portion of it. i print/save qgraphicsscene outputview::outputview(qwidget *parent) : qgraphicsview(parent) {...} void outputview::savetoimage() { qimage image(scene()->scenerect().size().tosize(), qimage::format_mono); image.fill(qt::transparent); qpainter painter(&image); render(&painter); image.save("output.png"); } of course experimenting, placing objects in center of viewport... the saved image contains objects, location of objects on left side of image input: output: (screenshot windows photo viewer) it seems image created correct size, viewport contents rendered - top left corner of viewport on top left corner of image, leaving rest of image empty. why happening ? doing wrong ? update: trying fitinview(scene()->scenerect()); results in viewport showing entire image, zoomed ... saved image still contains viewport (only tiny) and answ

javascript - Is it possible to download a file using PrimeFaces RemoteCommand? -

i have page table has optional columns user can hide , show. when user chooses download content of table via link @ bottom of table, want send them content of displayed columns. in order need use remote command since regular commandlink not accept js parameters tell server columns being displayed. my problem file not being downloaded. when debug, sever method , go through whole process completely, when return browser see content of file in network tab in chrome, file not being downloaded , instead page being refreshed. if put return false after invoke command, see file in network tab in chrome, , page not refresh nothing happens. tried use onsuccess or oncomplete events, not seem work expect. can done using jsf or have write servlet this? here code: link <h:commandlink value="download data" onclick="invokedownload();return false;" /> the invoke js method: var invokedownload = function() { var columnlabels = getvisiblecolumns().tostrin

xml - XmlSerializer c++ Deserialize with multiple namespaces -

i having following problem, concerning xmlserializer of microsoft (c++) , deserialization process. ds:signature not desiarialized , undentified value. can spot mistake? code follows: xml following: <?xml version="1.0" encoding="utf-8"?> <test xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <aa> <version>0.1.1</version> </aa> <bb> <cc> <id>134324321421</id> <ds:signature> <ds:signedinfo> <ds:canonicalizationmethod algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315#withcomments"/> <ds:signaturemethod algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> <ds:reference id="1" type="" uri="something"> <ds:transforms>