Posts

Showing posts from February, 2010

c - mDNSResponder not compiling out of the box on Maverick -

this morning downloaded lastest mdnsresponder apple opensource repository . opened xcode project (mdnsresponder-544/mdnsmacosx) , tried compile, few files missing: #include <corefoundation/cfxpcbridge.h> in bonjourevents.c not found. #include <dispatch/private.h> in dns-sd.c not found (but compiles gcc, i'm ok that) other errors... i running xcode 5.1 on osx 10.9.2, command line tool installed. i attaching output of xcodebuild: $ xcodebuild --- xcodebuild: warning: directory /users/kas/downloads/mdnsresponder-544/mdnsmacosx contains legacy project 'mdnsresponder.pbproj' - ignoring , using 'mdnsresponder.xcodeproj'. === build target bonjourevents of project mdnsresponder default configuration (development) === check dependencies compilec build/mdnsresponder.build/development/bonjourevents.build/objects-normal/x86_64/bonjourevents.o bonjourevents.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler cd /users/adsada/dow

string - Can someone explain this C code? -

can explain reverse sentence code me? how first , second looping works? what's point of each of them? main(){ char arr[255], *p; printf("enter string: "); gets(arr); for(p=arr; *p!='\0'; p++); for(p--; p>=arr; p--){ printf("%c",*p); } } input: i love output: uoy evol the code printing in reverse input array. for(p=arr; *p!='\0'; p++); sets p last (relevant) element of array (the null character) for(p--; p>=arr; p--){ printf("%c",*p); } starts last (none null) character , prints each 1 last first. question you: what happens if input array longet 255 chars? (answer below) buffer overflow

android - Boosting bluetooth audio / realising how does it work -

i want boost audio output on bluetooth on android device (xperia z1 running 4.4), can't find file output level designed. audio devices defined , configured in mixer_paths.xml speaker, anc headphones, headphones, various mic's etc. bluetooth there, looks weird me... http://screenshu.com/static/uploads/temporary/dy/k8/1z/pfrpai.jpg -screenshot of that it looks nothing defined regarding volumes or anything... idea bluetooth audio receiver sending it's own signal defines max volume on sync device, allright if it's way(i'm guessing - let me know if i'm wrong) there has way work-around that. any ideas?

html - Figured borders for text input with css -

Image
i need style text input the requiremets are: fluid width (stretches container width) border color changes on focus border color changes on error is there simple way css? what i've come quite complex, requires js , works not smoothly - <div class="inpt"><input type="text" /></div> jquery(".inpt").delegate("*", "focus blur", function() { var elem = jquery(this); var elem2 = jquery(this).parent(); settimeout(function() { elem2.toggleclass("focused", elem.is(":focus")); }, 0); }); http://jsfiddle.net/4skv9/ i had wrap input in div , style div using images on :before , :after :active doesn't work div in case , had toggle class script. i feel there must simple solution i'm missing. can suggest better? this solution uses jquery detect focus on <input> , add/remove .focused class on parent container. both left , right arrrows m

c# - The view found at was not created when Razor error occurs -

i use mvc4 mono 3.2.3 , notice if create error in razor cshtml file: @for(int = 0; < 8aaaa; i++) following error occurs: system.invalidoperationexception view 'index' or master not found or no view engine supports searched locations. following locations searched: ... i remember on windows there's smart razor compilation error message. how enable such feature under mono platform? related question: mvc5 autofac: view found @ not created in windows, razor files compiled individually , maybe better support design type error checking. with mono runtime of .net, views group compiled controller , 1 razor syntax error, none of views under controller compiled. means views don't exist , throw "view not found" error. i doubt if there setting can behavior on windows .net runtime.

sql - Zend2 combine tablegateway array -

i'm new zend2, , want combine 2 tablegateway objects i have 2 tables: prices , sizes. every price has multiple sizes. want join these tables array, can list prices sizes in it. for example: array( 1 => array( 'price' => 45, 'description' => 'lorem ipsum', 'sizes' => array( 1 => '16', 2 => '17', 3 => '20', 4 => '21' ) ), 2 => array( 'price' => 50, 'description' => 'lorem ipsum', 'sizes' => array( 1 => '34', 2 => '12', 3 => '21', 4 => '50' ) ) ) my pricestable.php: public functi

Write C array contain binary data to file -

c 1 language not know :) , question may silly of you. array contain file (style.css), listed part of it, question how write file? using linux - slackware. static const char data_style_css[] = { 0x20, 0x31, 0x30, 0x30, 0x25, 0x29, 0x3b, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x31, 0x70, 0x78, 0x20, 0x23, 0x32, 0x34, 0x37, 0x42, 0x45, 0x36, 0x3b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x23, 0x46, 0x46, 0x46, 0x3b, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x31, 0x33, 0x70, 0x78, 0x3b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x33, 0x30, 0x70, 0x78, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x33, 0x30, 0x70, 0x78, 0x3b, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x30, 0x7d, 0 }; thanks in advance #include<stdio.h> int main() { static const char data_style_css[] = { 0x20, 0x31

javascript - PHP Page content loads from cache when loading same page multiple times -

i displaying shopping cart products reading session variables. if product added in page1 , setting session array variable. after navigating page2 loading session content display product in shopping cart in page2 . then if add product in page2 going page1 , page1 not showing refreshed content, instead takes content page1 cache. but when f5 or ctrl+f5, works fine... i want page not load cache everytime when visit if same page. here code: <?php echo "<script> $(document).ready(function() {"; echo "add1('".$session_variable."')"; echo "});</script>"; ?> <script> add1(item) { document.getelementbyid('itemname').value=item; } <script> edit: navigate page 1 page2 using onclick event below.. <a onclick="window.location='page2.php'" style="text-decoration:none">page2</a><br> <a onclick="window.location='

node.js - What is the difference between mocha and Selenium? -

i started using node.js , looking testing framework. i found : mocha selenium i understand mocha 1 write tests in js while selenium, 1 has write tests lower level languages c#. apart there selenium can mocha can't? what use mocha have itself? mocha , selenium both deal testing software solve different problems. mocha test running framework. tell mocha tests have , tests want run , mocha run tests , report passed , failed. mocha provides test running framework. you'll typically want use assertion library it, chai . have test suites libraries providing testing support mocha chai. viable use-case. selenium library controlling browsers. major part of scope testing browser-based software. however, can used scraping web sites. selenium can mocha cannot do, itself. conversely selenium not test running framework. selenium has no facilities dedicated delimiting tests , running specific tests. have rely on test running framework mocha delimit 1 test anothe

TCPDF I can't get the html from another page like index.php?something=something -

i struggling create pdf file tcpdf dynamically generated page. my problem i've got logging session , when accessing file gets credentials if you're not logged in. so bit collecting html is: $curl_handle=curl_init(); curl_setopt($curl_handle, curlopt_url,'http://www.domain.com/subdir/index.php?something=ref'); curl_setopt($curl_handle, curlopt_connecttimeout, 2); curl_setopt($curl_handle, curlopt_returntransfer, 1); curl_setopt($curl_handle, curlopt_useragent, 'your application name'); $html = curl_exec($curl_handle); curl_close($curl_handle); so i've got after running it, 'http error 401: - unauthorised'. i hope explanation makes sense. any appreciated! i had same issue while working pdf using tcpdf in curl curlopt_useragent tcpdf below. curl_setopt($curl_handle, curlopt_useragent, 'tcpdf'); i commented line , try generate pdf , worked. i know not proper way worked me.

visual studio - C++ sending vector object between client and server -

i'm new c++ , have never worked vectors or server/clients before. have client , server can send char messages 1 other. 1 problem can send individual words across. if sees space put next thing on new line. need able send objects client. without weird spacing issues i have vector contains objects example have 1 called: vector<employees> staff; has print method: void printvector(const vector<employees>&); my question how can send vector or use printvector method show/print/cout on both server , client (through sending somehow). here segment server.cpp file if (sconnect = accept(slisten, (sockaddr*)&addr, &addrlen)) { cout << "connection received!" << endl << endl << "sending file" << endl << endl; (;; sleep(10)) { char* message = new char[256]; zeromemory(message, 256); cin >> message;

Android: How to write to a certain line, Java -

hello guys , thanks, i wondering how write line in java android. here write method: public void savelesson(int lessons2, int problem2, int mlessons2, int mproblem2, string checkaccuracy) { string newline = system.getproperty("line.separator"); final string saved = new string(lessons2 + newline + problem2 + newline + mlessons2 + newline + mproblem2 + newline + checkaccuracy); fileoutputstream fout = null; try { // catches ioexception below fout = openfileoutput("lessonstore.properties", context.mode_private); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } outputstreamwriter osw = new outputstreamwriter(fout); // write string file try { osw.write(saved); /* ensure * written out , close */ osw.flush(); osw.close(); } catch (ioexception e) {

Explicitly hide a base function in C++ -

c++11 introduced useful specifier override explicitly override base virtual function. explicit hiding ? for example, consider code: struct a: b { void f(); } if there virtual void b::f() code cause implicit overriding function. if there non-virtual void b::f() code cause hiding function. that is, meaning of code depends on existence , virtuality of void b::f() . question. how explicitly hide base function? want error if try hide virtual function. such override guard ensure there is virtual base function same prototype, need guard ensure there no virtual base function same prototype. epic fail example: #include <stdio.h> struct b { void f() {printf("hello\n");} void g() {f();} }; struct a: b { void f() {g();} }; int main() { a; a.f(); return 0; } the program print "hello". if make b::f() virtual program cause segmentation fault (infinite recursion). may real problem if b class third-party ,

actionscript 3 - How to create internal ctor in ActionScript3 -

i want create internal ctor class in actionscript3 make immutable. want builder class allow create instances of immutable class. try find answer in adobe's actionscrtip 3 specification not explain happen when no public namespace (accessible) define ctor. immutable object: package { public class immutable { private var _value1:int; private var _value2:int; private var _value3:int; public function immutable(value1:int, value2:int, value3:int) { _value1 = value1; _value2 = value2; _value3 = value3; } public function value1():int { return _value1; } public function value2():int { return _value2; } public function value3():int { return _value3; } } } as access modifiers, internal default . the internal attribute similar default access control in java, although in java there no explicit name le

Detect template change in Meteor -

i'm looking make element flash on screen when underlying collection updated. it seems me make have equivalent of template.my_template.rendered = function(){} fired every time template updated. ideally, function not fire first time template rendered. this seems such obvious use case, missing something? for meteor < 0.8 you should use template.mytemplate.created first time. docs template.mytemplate.rendered fired everytime there change including first time. if want limit second time , changes after (i'm guessing want), have write custom logic. there no meteor api supports that. for meteor-0.8 it seems api underwent backwards incompatible changes in meteor-0.8. there elegant way achieve described adaptation new meteor rendered callback here. bascially should modify whatever function attaching variables inside template's javascript calling helper function once. example, var rendercount = 1; var myhelper = function () { console.log("

Why will this jQuery only work once? -

i have container supposed change style , display different messages depending on event triggers. message displaying part work, while style change once weird reason, @ other attempts change style, stay same. this first , 1 works entirely $('#feedback_message_signup_final').css({"visibility": "visible", "color": "#347c17", "left": "27.5%"}); $('#feedback_message_signup_final').html('В данный момент вы инициализировали регистрацию на проекте \'Фаворит\'.<br> В настоящее время сервис распространяется лишь на три города: Актобе, Алматы и Астану.<br> Мы обязательно будем работать над расширением зоны действия нашего проекта.<br> Надеемся, что процесс регистрации будет для вас легким и интерактивным.'); one of subsequent ones. of them display message, not break string accordingly, nor css changed in accordance function.. if (data=='false'){ $('

Prolog member function -

i trying return true if object in obj false otherwise. built in member function not give me true or false. gives me obj shown. how make return true or false ? member(communicator,obj). obj = [communicator|_g3422]. from comments sounds you're not following how prolog works @ prompt. if enter this: ?- obj = [communicator, gun]. obj = [communicator, gun]. and ends in period, prolog satisfy query instantiating obj [communicator, gun] , show final solution: obj = [communicator, gun]. . at point, expression done, , obj no longer has value after solution found. subsequent call member/2 shows this: ?- member(communicator, obj). obj = [communicator|_g51] ; what need instantiate obj in same logical clause: ?- obj = [communicator, gun], member(communicator, obj). obj = [communicator, gun] ; false. ?- note comma, , in prolog. prolog succeeded , found 1 solution ( obj = [communicator, gun] , then, after enter ; find more solutions, finds no more , displays

matlab - Accessing specific rows of a sparse matrix -

i have sparse matrix of size 20 millionx20million in matlab. want around 40000 specific rows matrix. if do new_data = data_original(index,:) where index consists of rows interested in, takes ever. how can efficiently? matlab seems use coordinate list (coo) format sparse matrices. in matlab's coo format, elements sorted column indices first raw indices among elements of same column indices. thus, every time specify element row index, matlab has search entire indices of sparse matrix elements right row indices. it faster if can load original matrix transpose, access columns of sparse matrix, i.e. new_data = data_transpose_of_original(:,index) however, don't transpose original matrix inside matlab, take longer. or can create own sparse matrix format. compressed sparse row (csr) format fast row-wise access. in conclusion, if can change format of sparse matrix outside matlab (take transpose of original matrix, or make csr format , create matlab funct

php - How to call an elgg module action via url -

im new elgg, requirement create elgg plugin import contact gmail,yahoo , msn. i imported contacts in joomla. when create elgg plugin , oauth call url given invitefriends/gmailcallback or direct call like mod/invitefriends/actions/gmailcallback.php its not working. in first case return form token missing tried add form token dynamically below. $ts = time(); elgg_register_action('invitefriends/gmailcallback', true, elgg_get_plugins_path() . 'invitefriends/actions/gmailcallback.php?__elgg_token='.generate_action_token($ts).'&__elgg_ts='.$ts); but still same error. tried access module file directly works fine ,but problem didn't $_session['oauth_token_secret'] session variable not getting, set in default view , have proper value unable session in action file in direct call method. iam not sure in elgg standard, please advice me solve problem thanks in advance.. don

mysql - Sum records when counter increases -

i displaying records need sum cost sumcost counter increases particular group of records. appreaciate simple sql code. e.g. group| items | cost | sumcost| counter ----------------------------------------- cars | opel | 50 | 50 | 1 cars | toyota| 60 | 110 | 2 cars | kia | 40 | 150 | 3 laps | acer | 30 | 30 | 1 laps | hp | 45 | 75 | 2 laps | compaq| 20 | 95 | 3 , on.... want that, e.g. group (cars) displaying records, should sum cost of each car item , display sum/total in sumcost column. sumcost of opel 50, sumcost of toyota (cost of opel , toyota i.e. 50+60=110) , of kia (opel cost + toyota cost + kia cost => 50+60+40=150) etc here ask, exactly: select if(t.counter=1, @sum:=0,null) _, @sum:=@sum+t.cost sum, t.* t; sqlfiddle sqlfiddle without counter, group changing i review question , find useful answer here same solution sum counting: select *, (select sum(cost) sometbl counter t.groups =

html - How to make an image in a div appear using Javascript -

how make image in div fade in or pop after a amount of seconds using javascript? have researched none of answers on here seem apply me. thank you do need this: <script> settimeout(function(){document.getelementbyid('image').style.display = 'block' ? 'none' : 'block'}, 5000) </script> <div> <div id='image' style='display:none'> here should image </div> </div> you can see in action here : http://jsfiddle.net/wub8t/

swing - Java Craps Game Crashes -

i trying finish java craps game using gui, every time hit "play craps" , program freezes up, , doesn't compute. i'm assuming it's problem game logic, can out? thanks! import javax.swing.*; import java.awt.*; import java.awt.event.*; public class mcgovernjavaprogrammingassignment8bcrapsgui extends jframe { private static final int width=400; private static final int height=300; // declare jframe components: private jbutton jbutplaycraps, jbutclear, jbutexit; private playbuttonhandler playhandler; private clearbuttonhandler clearhandler; private exitbuttonhandler exithandler; private jscrollpane scrollingresult; private jtextarea jtaoutput; private jpanel jpnltop = new jpanel(); private jpanel jpnlcenter = new jpanel(); private jpanel jpnlbottom = new jpanel(); // constructor public mcgovernjavaprogrammingassignment8bcrapsgui() { //set title , size: settitle("matthew mcgovern - java craps game!"); setsize(width, height);

python - Understanding simulation termination -

this part of simulation describes program termination. please me understand how part of simulation work lost. code below: while time_elapsed < end_time : event=birth () +death () +infection() choice=random.random()*event choice -= birth() time_elapsed += random.expovariate(event) if choice < 0 : do_birth() continue choice -= death() if choice < 0: do_death() continue i've rearranged make more obvious happening: # @ each time-step until sim ends while time_elapsed < end_time : # # decide random event occur # # cumulative probability = (chance of birth) + (chance of death) + (chance of infection) event = birth() + death() + infection() # choose value in [0..cum_prob) choice = random.random() * event # interpret value: # if 0 <= value < (chance of birth) => birth # if (chance of birth) <= value < (chance of birth) + (chance of death)

html - PHP GeoIP loop error -

i'm using php redirection script, gives me continues loop error default redirection code <?php // ccr.php - country code redirect require_once('geoplugin.class.php'); $geoplugin = new geoplugin(); $geoplugin->locate(); $country_code = $geoplugin->countrycode; switch($country_code) { case 'us': header('location: http://www.domain.com/en'); exit; case 'fr': header('location: http://www.domain.com/fr'); exit; case 'be': header('location: http://www.domain.com/fr'); exit; default: // exceptions header('location: http://www.domain.com'); exit; } ?> the reason you're stuck in loop script executed on every page on every page-load. you working sessions, convenient way set flag there have checked user: <?php //... // if flag not set if( ! isset($_session['checkedgeoip']) ) { // set flag here don't need set after each case. // set requests during session , // a

python - Django/Wagtail some images upload error 500 -

Image
am using wagtail (django variant cms) in virtualenv, on fastcgi + apache + shared hosting. when uploading images via built-in wagtail image uploader, images work , compile correctly whilst uploads cause 500 internal server error. have tried looking pattern in types of images cause error can't spot similarities. i able upload various jpgs, gifs, pngs, sizes varied 88kb 236kb, largest dimensions 1000px x 950px the files causing errors variety of jpgs, gifs, pngs. cannot upload bigger 300kb, although files 100kb or less cause 500 error. uploading via django-admin causes same issues. the images work when upload through sftp , cpanel there's no problem there. wagtail uses pillow image handling. i'm not sure begin looking this. pillow or django error? i'd suspect web server setting limit on request sizes - we've encountered similar things when deploying on nginx, imposes 1 mb limit on requests out-of-the-box. (for nginx, relevant setting c

SDL OpenGL in C++, Texture Shader missing the texture -

i trying create first opengl shader experiencing difficulties when trying add texture cube object. is sharp eyed enough spot error? code might have lots of errors, , grateful if points them out, interested in why rotating cube gray , not colorful. (i have skipped error handling keep source code size low, sorry that) * *edit found out missed uv settings, still gray cube though ... #include <windows.h> #include <sdl.h> #include <gl/glew.h> #include <gl/glu.h> #include <gl/glut.h> #include <math.h> #include <string> using namespace std; void initall(); void setupbox(); void mainloop(); unsigned int generatetexture(); void handle_inputs(); void updatescreen(); void clean_up(); int scrwidth, scrheight, flags; bool bquit = false; float angle = 0.0f; gluint tex_box, tex_norm; std::string vertex_source, fragment_source;

Stream PCM audio File via ezstream to icecast -

i know if can stream pcm audio file via ezstream icecast : my ezstream config file : <ezstream> <url>http://127.0.0.1:8000/myradio</url> <sourcepassword>hackme</sourcepassword> <format>mp3</format> <filename>c:\users\hp\downloads\ezstream-0.5.6-win32\test\playlist.txt</filename> <stream_once>1</stream_once> <svrinfoname>aaa</svrinfoname> <svrinfourl>http://test.ma</svrinfourl> <svrinfogenre>software developpement</svrinfogenre> <svrinfodescription>dddd</svrinfodescription> <svrinfobitrate>128</svrinfobitrate> <svrinfochannels>2</svrinfochannels> <svrinfosamplerate>44100</svrinfosamplerate> <svrinfopublic>1</svrinfopublic> <reencode> <enable>1</enable> <encdec> <format>mp3</format> <match>.mp3</match> <encode>lame -r -s

c# - Should I unregister from TransactionScope TransactionCompleted event? -

generally when registering events in .net, practice unregister them when object no longer needed avoid memory leak. what case using transactionscope's transactioncompleted event? consider following code snippet: using (var scope = new transactionscope(transactionscopeoption.required)) { transaction.current.transactioncompleted += ontransactioncompleted; // scope.complete(); } looking when should unregister 'transactioncompleted' event, if @ end of using statement, guaranteed event handler executed? other option unregister @ event handler itself, i'm not sure transactionscope won't started till then. when transactioncompleted event raised? can sure raised when scope object finish disposal? (leave 'using' block) i don't see reference in msdn document nor in source code . if @ end of using statement, guaranteed event handler executed? no, because might nested scope. there 1 transaction active @ time , mana

python - How do I use get_or_insert in GAE? -

according documentation have pass in first key, , shall pass in properties initialise, model saved. of done in form of **kwargs. the definition seems this: def _get_or_insert(*args, **kwds): this way intended use it, yet throws exception: record1, is_created = record.get_or_insert(record_key, {'record_date' : event1.date_time, 'user' : user.key}) the model defined as: class record(ndb.model): user = ndb.keyproperty(kind=user) record_date = ndb.dateproperty(required=true) exception: file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/google/appengine/ext/ndb/model.py", line 3396, in _get_or_insert_async cls, name = args # these must positional. valueerror: many values unpack any advice? kwargs should passed key/value pairs. try like: record1, is_created = record.get_or_insert(record_key, record_date = event1.date_time, user

c - Manually doing soft-float add -

i need write program in c takes 2 floating point numbers , produces sum output using int, pointers , malloc(). no other data type. (single precision) , i'm helpless. tip: floating point number x 2 integers: mantissa m , exponent e such x = m * 2^e . should started. good read: what every programmer should know floating-point arithmetic edit: understood question exercise understand floating point numbers. maybe i'm wrong…

javascript - Attempting to parse or assign JSON response: Response is read as [object Object] -

this question has answer here: how return response asynchronous call? 21 answers using flickr api, javascript/jquery, , ajax, have follow code: function getrequest(arguments) { var requestinfo; $.ajax({ type: 'get', url: flickrurl + '&'+ arguments + '&jsoncallback=jsoncallback', async: false, jsonpcallback: 'jsoncallback', datatype: 'jsonp', success: function (json) { requestinfo = json; //parse attempt requestinfo = $.parsejson(json); //old method return json; } }); return requestinfo; } when response received , attempt assign json (the response) data variable, requestinfo, (or if straight 'return json' line) error ind

php - Ajax call after submit does not call the right action/controller in Yii -

in following jquery script, use 3 functions, create, update , save comments. when create new record, create function called , if click save, record saved. if refresh page , wants update record, works. (update save functions) but when want update after create/save without refreshing page, function save called instead of update/save. i need unbind events, not work me. save triggered click , inside it, submit event linked element. i read somewhere it not practice solution read trigger submit event click function, tried reloads page want avoid because i'm using ajax. edit i put trace , can see when want update after create/save, call save method not go inside method, not go update method either. url called contains save update call parameters. /blog/index.php/save... my understanding in mvc pattern, controller method render view. since last view rendered after create/save done save action controller, submit done after call controller view rendered. an

R compare mutual Twitter Followers in edge list -

i new stackoverflow , still rather new r , social network analysis... i want network analysis of group of politicians on twitter , compare lists of friends , followers. i have original list of 89 politicians on twitter, have downloaded friends , followers using loop twitter , roauth. based on download have created edge list containing 243'090 edges looks this: source target 1 chris_chasp aloisgmuer 2 danimh72 aloisgmuer 3 pellissier aloisgmuer 4 annekoch5 andreacaroniar 5 silvangis andreacaroniar ... i network analysis gephi using original 89 users nodes, nodes list looks this: id label party postition 1 aloisgmuer alois gmür cvp nationalrat 2 andreacaroniar andrea caroni fdp nationalrat 3 barthassat luc barthassat cvp nationalrat ... however, additionally compare friends , followers of original 89 users not heir connections e

vba - With Excel, trying to find genuine used range from external HTA -

i've been using command: lastrow = activesheet.usedrange.rows.count but usedrange property can inaccurate. i'm looking alternative. found great tip explaining method: lastrow = cells.find("*", searchorder:=xlbyrows, searchdirection:=xlprevious).row this works treat in excel. however, i'm running code hta, need convert line, , i'm struggling. question --- please can offer guidance on how convert simple code hta-compatible one? out of interest, try circumvent problem, tried writing routine in way understand. result works , slow. here giggles: set objexcel = getobject(,"excel.application") wb = "test.xlsx" objexcel.workbooks(wb).activate wbactivesheet = objexcel.workbooks(wb).activesheet.name 'determine rows , columns in range of first xls thenumrow = objexcel.workbooks(wb).sheets(wbactivesheet).usedrange.rows.count thenumcol = objexcel.workbooks(wb).sheets(wbactivesheet).usedrange.columns.coun

css - Text On top of darkened transparent background -

so earlier, trying figure out how darken image transparency using css when figured out, new question came how place text on that? have far... http://jsfiddle.net/pxu6j/3/ <h1> appreciated </h1> use css positioning draw content (such text) on other content.

ios - Shake gesture and prepare for seuge - Unbalanced calls to begin/end appearance transitions -

i have uitabelviewcontroller (mainviewctrl), if user select cell, new uiviewcontroller (detailviewctrl) been pushed "scene", detail data regarding selected cell. - pretty simple stuff. if user shakes phone, (detailviewctrl) been showed random detail data. here prepareforseque code: - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"detailviewseque"]) { int i; if ([sender iskindofclass:[uitableviewcell class]]){ uitableviewcell *cell = (uitableviewcell*)sender; nsindexpath *indexpath = [self.minifigstableview indexpathforcell:cell]; = indexpath.row; }else{ = arc4random() % [self.collectionofdata count]; } deatilviewcontroller *dest = [segue destinationviewcontroller]; dest.data = [self.collectionofdata objectatindex:i]; } } the code pretty simple, nothing fancy. problem is,

sql - Storing and managing related data -

i trying organize , search data visualize links between them. format best store these links? for example, if have bunch of students , add them class, how automatically add class each student? or other way if student adds 5 classes, how automatically add student rosters?

c++ - Libcurl+QtCreator+debian -

i newbie on linux, have lot of trouble it. i want use curl in qt project (c++). created project, write in main.cpp #include <curl/curl.h> int main( void ){ curl *curl; /* first step, init curl */ curl = curl_easy_init(); if (!curl) { return -1; } return 0; } i tried compile code, have 1 error: undefined reference 'curl_easy_init()' realise, qt creator wants know path library. open test.pro file , append: includepath += /usr/lib/x86_64-linux-gnu/ libs += /usr/lib/x86_64-linux-gnu/libcurl.a libs += /usr/lib/x86_64-linux-gnu/libcurldll.a and error: libcurlldll.a no such file or dirrectory. definetly haven't library, try install/reinstall types of libcurl , doesn't work. sites, tried search information: http://www.cplusplus.com/forum/general/89488/ http://curl.haxx.se/libcurl/using/apps.html https://stackoverflow.com/ please, redirect me simple guide "how use libcurl in qt creator on debian

php - How to add a jQuery Listener for 2 events? -

i have event in table if clicked function fires, want same function fire if item on dropdown select option selected. my working code table td if clicked is: $('td[id^="tblcell"]').click(function() { ... ... ... }); how can add code first line same function executues if select changed? something like: $('td[id^="tblcell"]').click(function() or ('select[id^="selectlist"]').onchange(function() { but doesn't work due syntax error... correct way code this? (if possible). i using php , latest jquery. thanks simply put code function , call in 2 seperate handlers. $('td[id^="tblcell"]').click(dostuff); $('select[id^="selectlist"]').on('change', dostuff); function dostuff(event) { // code }

c++ - Eye Blinking Detection -

some warnings appear in terminal during running: opencv error: assertion failed(s>=0) in setsize, file /home/me/opencv2.4/modules/core/src/matrix.cpp, line 116 the program compiled without error , executes, problem eye roi size changes when user moves closer/farther away webcam, due changing of size, warning appears. managed solve these warnings setting eye roi size equal eye template size. however, ends program fails classify user's eyes open/close because minval obtained 0 . method used opencv template matching . alternatively, fix distance webcam , fix eye template size avoid warning. every time warning appears, program fails classify open/close eyes. program doesn't work because mistakenly classifies open eyes closed , vice versa. questions: is there alternative identify open , close eyes other template matching? any ideas how improve program in classification of blinking? any working example know in opencv c/c++ api can classify open , close eyes , c