Posts

Showing posts from September, 2015

python - Diffing two files while ignoring any missed lines -

i diffing 2 unsorted files , problem moment 1 of files gets line not present in other file, diff goes off. want write/print line not present , continue on. import re f1=open("file1","r") f2=open("file2","r") f=open("output","w") test_lines=f1.readlines() correct_lines=f2.readlines() test, correct in zip(sorted(test_lines), sorted(correct_lines)): if test.strip().split("(")[0].replace(" ","").strip() != correct.strip().split("(")[0].replace(" ","").strip() , test!="\n": print "oh no! expected %r; got %r." % (correct, test) else: towrite=correct + test f.write(towrite) else: len_diff = len(test_lines) - len(correct_lines) if len_diff > 0: print "test file had data." elif len_diff < 0: print "test file had little data." else: print "everythin...

Python How to get Scrapy Xpath data from Basic Table? -

<table> <br> <tr> <td width = 270><p align="left" style="margin-left: 0;"><b>info</b></p></td> <td><p> </p></td> </tr> <tr> <td width = 270><p align="left" style="margin-left: 10;">page&nbsp;count</p></td> <td><p> = 4 </p></td> </tr> ... trying response.xpath = 4 value table above. when inspecting element in chrome , pulling xpath way sill end [] value. tried: /html/body/table[1]/tr[2]/td[2] //table[2]/tr[2]/td[2] both fails. i'd td count text instead , following-sibling : //td[contains(p, "count")]/following-sibling::td/p/text() demo: $ scrapy shell index.html in [1]: response.xpath('//td[contains(p, "count")]/following-sibling::td/p/text()').extract() out[1]: [u' = 4 '] and if want extract ...

shader - How to create a texture alpha, with white and black colors only, in GLSL? -

Image
i looking reproduce glow effect tutorial , if understand well, convert first image "alpha texture" (black , white), , blur (rgb * a) texture. how possible create alpha texture, colors go white, , other go black? found : how render texture alpha? don't know how use these answers. thanks it appears misunderstanding diagram showing you. 1 texture, (a) shows rgb color , (b) shows alpha channel. (c) shows happens when multiply rgb a. alpha not "black , white", abstract concept , amounts range of values between 0.0 , 1.0 . human brain make sense out of it, interprets black ( 0.0 ) , white ( 1.0 ). in reality, alpha whatever want , unrelated color (though can used color). typically alpha channel generated post-process image filter, looks areas of texture above average luminance. in modern graphics engines hdr used , part of scene color bright displayed on monitor candidate glowing. intensity of glow derived how brighter lighting @ point mo...

sql server - best way to get iso into usa format -

trying convert date string usa format '20150316 16:28' '3/16/2015 4:28 pm' (note: 24hr format fine too) http://sqlfiddle.com/#!6/9eecb/862 the predefined format "g" give date time in format: select format(cast('20150316 16:20' datetime), 'g') update: select format( cast('20150316 16:20' datetime), 'd') + ' ' + format( cast('20150316 16:20' datetime), 'hh:mm') produces 3/16/2015 16:20 see these articles predefined , custom date time formats: https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx note these vary culture.

c++ - Hook function call linux mint -

some days ago wrote simple hook/detour patching single call instruction. worked on ubuntu 12.xyz (32bit), updated linux mint 17.1(32bit) , segmentation fault. i have 2 projects target project calls function named goodguy library project loaded dlopen() overwrites offset call instruction in target application before overwriting call instruction offset, modify protection of page by: mprotect(pageof(address),pagesize,prot_write|prot_exec|prot_read) this works fine (returns 0). when debug programm, crashs while trying write address of call: memcpy((void*)(address + 1),(void*)&calloffset,4); looks not allowed overwrite instructions, why ? i diabled alsr , used -z execstack -fno-stack-protector flags g++. do know how allow application write instructions ? thank you, alex edit sorry guys, here code: target application: #include <dlfcn.h> #include <stdio.h> #include <stdio.h> #include <iostream> void goodguy(); //full lib path ...

javascript - <button> JQuery onclick works only once -

i have button onclick event works fine here: // create function remove "popup-open" classes // function used in onclick attribute (function( $ ){ $.fn.popupclose = function() { $( "body" ).removeclass( "popup-open" ) $( ".overlay_btn" ).removeclass("popup-open"); return this; }; })( jquery ); // if <button> exists // onclick read button id value // add "popup-open" class span idvalue class, fadein effect if ( $( "button.popup" ).length ) { $("button.popup").click( function() { var btnid = $(this).attr('id'); $( "body" ).hide().addclass( "popup-open" ).fadein(100); $( "."+ btnid ).hide().addclass( "popup-open" ).fadein(200); } ); } if ( $( "button.link" ).length ) { $("button.link").click( function() { var btnformaction = $(this).attr(...

PHP - What Host name should we provide in websocket server file -

hello trying implemented chat application website. have uploaded files online server check chatting.the code works fine in localhost problem server.php don't run. running file through ssh terminal. think might have problem here $server = new phpwebsocket(); $server->bind('message', 'wsonmessage'); $server->bind('open', 'wsonopen'); $server->bind('close', 'wsonclose'); // other computers connect, need change lan ip or external ip, // alternatively use: gethostbyaddr(gethostbyname($_server['server_name'])) $server->wsstartserver('127.0.0.1', 9300); my server.php file residing in directory public_html/domain.com/websocket/server.php

converter - Converting .3DC + .DDS files into .OBJ + .MTL + .TGA -

how go @ converting .3dc + .dds files .obj + .mtl + .tga? this simple do, goes file format i'll using .3dc file. download 3d object converter, you'll have pay fee if want program convert object without removing every 5th quad or triangle. after you've done open , go menu , click batch convert. add file want convert change options suit , choose export .obj wavefront don't take other type of .obj file format. can find near end of list. convert file. , voila! if texture in dds format or whatever , want change tga, use online picture converter. after amend file.mtl , change correct texture should call to. and there go!

python - serialized json size is much more than pickled or original dictionary -

i want send python dictionary through network sockets. used ujson , json dumping dictionary result size original dictionary. original dictionary size around 1mb json size around 6mb , pickled result around 1mb i used asizeof pympler , builtin len function getting size of results. note dictionary contains binary data encoded base64 converting text data.

CSS text button won't position in the center no matter what -

i trying style css navigation bar. did before table, works fine, trying un-ordered list , styling whatever do, text not go middle of button. may see buttons in code below: jsfiddle.net/anidimitrovaaanidimitrova/tbh62k9q/ i tried with: - text-align: center; - vertical-align: middle; - position: absolute - float:center; thanks lot in advance ideas might have. .mainheader nav a:link, .mainheader nav a:visited{ color:#ab6f80; display: block; padding: 7px 20px; /* come here assign height */ height:71px; line-height:71px; } line-height added - work fine 1 line of text in link... http://jsfiddle.net/tbh62k9q/2/

javascript - Google Materials Charts (Scatter) not showing trendlines or tooltips -

i'm using google charts, materials charts running in ie v11, , when things trendlines , tooltips no longer work. same happens if add column {type: 'string', role: 'tooltip'}, nothing appears. if change 'packages':['scatter'] to 'packages':['corechart'] and google.charts.scatter(...); to google.visualization.scatterchart(...); then works listed in documentation. don't know missing here. below example of trendlines not working. i've searched other questions can't find answer. <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.1', {'packages':['scatter']}); google.setonloadcallback(drawchart); function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('date', 'date...

java - Customize the output of a monitor -

i creating program using java. within program have ability create output on predefined monitor. ubuntu 14.10 test system has 2 monitors connected through dvi. unity grabs both monitors desktop. how access these monitors? there way create connection through /dev/*? or have in java program? you can use graphicsenvironment list of graphicsdevices attached system. if want to, can generate "virtual" desktop, combining devices areas together, for example

javascript - "TypeError: undefined is not a function" -

i'm learning js on codecademy , i'm stuck in "switch" element part. the instructions are: "create own switch statement in editor. can like! make sure include @ least 3 cases , default." i "typeerror: undefined not function" i'm sure it's dumb can't figure out , tried searching no luck either. and here's code: // write code below! var console = prompt("what's favorite console?"); switch(console) { case "ps4": console.log("it's favorite too!"); break; case 'xone': console.log("good choice!"); break; case 'wii': console.log("i don't it."); break; default: console.log("that's not current gen console!"); }; you're redefining console in first line. console used to, example, print messages. solution problem rename: var console...

PHP Array - Return specific elements of array and display them on one line -

i'm ready go crazy one. can't seem figure out how print out elements of array , put results on 1 line (with specific output). here's array data (after running through foreach statement: array ( [hostname] => server01 [server_id] => 4 [disk_mountpoint] => / [disk_datetime] => 1426395600 [disk_device] => /dev/mapper/volgroup00-logvol00 [disk_capacity] => 15g [disk_used] => 5.3g ) array ( [hostname] => server01 [server_id] => 4 [disk_mountpoint] => /var [disk_datetime] => 1426395600 [disk_device] => /dev/mapper/volgroup01-logvol00 [disk_capacity] => 107g [disk_used] => 52g ) array ( [hostname] => server01 [server_id] => 4 [disk_mountpoint] => /opt [disk_datetime] => 1426395600 [disk_device] => /dev/mapper/volgroup02-logvol00 [disk_capacity] => 156g [disk_used] => 127g ) here's foreach statement: foreach ($storage_...

mysql - Why does SQL NOT EXISTS return 1 record of all NULL values -

sql fiddle on following: create table tbl( col1 int, col2 int, col3 int); insert tbl values(1,1,1); insert tbl values(1,1,1); select sum(col1) c1, sum(col2) c2, sum(col3)c3 tbl not exists ( select 2 c1, 2 c2, 2 c3 ) i expecting return 0 records. instead returns 1 record of null values. can tell me why? p.s. trying understand not exists behavior. it's not exists . not exists evaluates false , since select 2 c1, 2 c2, 2 c3 returns row. means query equivalent to: select sum(col1) c1, sum(col2) c2, sum(col3) c3 tbl 0 saying that, sum semantics. sum in empty set should return value, , value in case null . from mysql documentation : sum(expr) returns sum of expr. if return set has no rows, sum() returns null. sum() returns null if there no matching rows.

c - protect sem_wait() from signals using pthread_sigmask() -

i have library accesses hardware resource (spi) via 3rd party library. library, , in turn spi resource, accessed multiple processes need lock resource semaphores, lock functions below: static int spi_lock(void) { struct timespec ts; if (clock_gettime(clock_realtime, &ts) == -1) { syslog(log_err,"failed read clock: %s\n", spisem, strerror(errno)); return 3; } ts.tv_sec += 5; if (sem_timedwait(bcoms->spisem, &ts) == -1) { syslog(log_err,"timed out trying acquire %s: %s\n", spisem, strerror(errno)); return 1; } return 0; } static int spi_unlock(void) { int ret = 1; if (sem_post(bcoms->spisem)) { syslog(log_err,"failed release %s: %s\n", spisem, strerror(errno)); goto done; } ret = 0; done: return ret; } now problem library used in daemon , daemon stopped via kill signal. kill signal while holding semaphore lock , hence servers c...

When does Powershell honour default values when using $null splat parameters? -

consider following function: function f1{ param( $sb = {}, $s = '' ) if ($sb -isnot [scriptblock]) { 'scriptblock' } if ($s -isnot [string] ) { 'string' } } now invoke splat parameter: ps c:\> $splat = @{foo='bar'} ps c:\> f1 @splat as expected, nothing returned. try again $null splat parameter: ps c:\> $splat = $null ps c:\> f1 @splat scriptblock oddly, scriptblock returned. clearly, @ least [scriptblock] parameter, powershell not honoring default value when $null splat parameter used. powershell honor default value [string] . going on here? for types powershell honour default values when using $null splat parameters? here's demonstration understand what's happening $splat = @{foo='bar'} "$(&{$args}@splat)" -foo: bar when splat hash table, gets converted -key: value string pairs become parameters function. now try: $splat = $null ...

python - Vagrant, Flask — App not running on 10.10.10.10, 127.0.0.1 -

i'm running app on local box via vagrant. python/flask app launches , prints: * running on http://127.0.0.1:5000/ * restarting reloader i found https://github.com/makersquare/student-dev-box/wiki/using-vagrant-for-development#testing-web-based-applications-in-vagrant suggests vagrant apps run on 10.10.10.10 (not 127.0.0.1 ), when navigate ip address (port 5000), same result: "this webpage not available". question: app running, on ip address? can't seem find it. need modify configuration files? thanks in advance. there many ways how run flask web app on virtual machine (managed vagrant). think following approach quite flexible, because don't have deal different ip address. looks developing on host machine. there 2 things need configure. in vagranfile , need configure port forwarding. vagrant.configure(2) |config| # use default box config.vm.box = "ubuntu/trusty64" # forward port guest machine:5000 -> host machine:5000...

Ionic - routing issue/button link -

i'm writing first ionic app , hit little problem. i have tab interface has login screen, once login can select tabs, on 1 tab screen have list of items need click show further options, can't quite these links work, think ui-sref bit wrong... looking second pair of eyes! linking profile view i'm struggling with, below app.js routing , page links on below. app.js .state('login', { url: '/login', templateurl: 'templates/login.html', controller:'loginctrl' }) // setup abstract state tabs directive .state('tab', { url: "/tab", abstract: true, templateurl: "templates/tabs.html" }) .state('tab.profile', { url: '/profile', views: { 'profile': { templateurl: 'templates.tab.profile.html', controller: 'profilectrl' } } }) then list page: <ion-content has-header="true" padding="true" class="viewer-panel"> ...

node.js - How can I search a MongoDB of regexes for matches against a given string? -

i have mongo database accessing via mongoose , node.js. database contains series of items called machine . each machine has field stored string , represents regular expression. want take given string (provided user) , check against regular expressions in database find potential matches. know can search database via regex this: machines.find({subject: {$regex: hi}}).exec(function(err, results) { // stuff results }); but how can reverse of this? you can using $where : machines.find({ $where: 'new regexp(this.subject).test(' + '"' + string + '") === true' }) also hi greg

sparql - How to merge RDF subjects with same properties summing their values? -

given following triples: s1 nameproperty "bozo" s1 laughproperty "haha" s1 valueproperty "2.00"^^xml:double s2 nameproperty "clown" s2 laughproperty "hehe" s2 valueproperty "3.00"^^xml:double s3 nameproperty "bozo" s3 laughproperty "haha" s3 valueproperty "1.00"^^xml:double i'd merge subjects same name , laugh , sum values, result like: s1 nameproperty "bozo" s1 laughproperty "haha" s1 valueproperty "3.00"^^xml:double s2 nameproperty "clown" s2 laughproperty "hehe" s2 valueproperty "3.00"^^xml:double how perform sparql efficiency? (there no need retain subjects. can inserted long new 1 merged values shares same nameproperty , laughproperty .) it's helpful if provide data can run queries over. here's data analogous yours, can work with: @prefix xsd: <http://www.w3.org/2001/xmlschema#>. @prefix :...

oracle - pl/sql insert multiple rows using for loop variable seen as not declared -

i've following anonymous block declared variable: declare tst number(9) :=0; begin vcnt in 1..1000 loop tst := vcnt; insert samp_tab values(:tst,'a'); end loop; end; i want insert table value of counter row in every cycle of loop, using variable counter value in insert value. when execute code, oracle returns: bind variable "tst" not declared anonymous block completed. how fix code? if want refer local variable, don't prefix colon declare tst number(9) :=0; begin vcnt in 1..1000 loop tst := vcnt; insert samp_tab values(tst,'a'); end loop; end; this assumes samp_tab table 2 columns, first being numeric , second being string. practice, want list columns inserting explicitly-- makes code more self-documenting , means won't create errors later if adds new columns table later have default values.

javascript - Functions in Namespace Not Attaching Event Listeners to HTML Elements -

i have local page in html , javascript helps me basic tasks @ work. i've been going on code , rewriting use best practices, since helps me learn, , i've been trying study namespacing , put use rewriting common page functions , event listeners. window.onload = (function() { var automationpagewrapper = (function() { var self = {} self.evntlisteners = { btntextchange: function() { // code changes button text when clicked }, btncolorchange: function(formid) { // code iterates through buttons name // , makes them same default color } } self.listeners = { btnlisteners: function() { // add event listeners having buttons here } } return self; }); automationpagewrapper.listeners.btnlisteners(); }); why isn't attaching event listeners? is there better way formatting/calling this? is professional method setting javascript...

Ruby n, 1 = gets.split.map &:to_i -

this question has answer here: ruby x,y = gets.split.map &:to_i 1 answer i looking @ ruby code. unsure happening on line: n,1 = gets.split.map &:to_i i understand input array of strings being mapped array of integers why being assigned n,1 ? that line of code doesn't anything, it's syntaxerror . can't assign 1 , that's not legal name local variable.

How do I create an audio buffer out of an audio tag? -

can somehow use loaded audio tag create audio buffer? i know web audio api has decodeaudiodata method can used create audio buffer, not accept audio tag. how can take audio tag , use create audio buffer can played source node? sadly, doesn't audio tag can loaded buffer. way far create audiobuffer through xmlhttprequest or creating empty buffer.

Java Object Array, asking for two different inputs? -

so here test class: import java.util.scanner; public class test { public static void main (string[] args){ film[] f = new film[10]; scanner input = new scanner(system.in); (int i=0;i<10;i++){ f[i] = new film(); system.out.println("enter title:"); f[i].settitle(input.nextline()); system.out.println("enter film length:"); f[i].setlength(input.nextdouble()); } } } i have getter , setter methods in object class film. problem here output comes out as: enter title: title1 enter film length: 1 enter title: enter film length: 2 enter title: enter film length: 3 enter title: enter film length: how fix code asks 10 user inputted titles , lengths , @ end display film titles , lengths? thanks. *i have tostring method: public string tostring(){ return "title: "+title+" length: "+le...

Joomla - Override bootstrap.min.css -

working on joomla don't want use bootstrap...ever. created css override blank bootstrap.css file in templates/mytemplate/css/bootstrap.css . worked, doing same thing bootstrap.min.css not work... ideas? i know can rename or delete media/jui/css bootstrap css files, isn't permanent solution since updated every time update joomla version. finally found it. there several ways unset/ignore css file, 1 worked on joomla 3.4: <?php unset($this->_stylesheets[$this->baseurl .'/media/jui/css/bootstrap.min.css']); ?>

jquery - HTML text does not re-appear with AJAX -

i'm trying use following code display , fade out text: $('#submit_new_player_order').click(function(e){ //some data define data_to_send $.post(ajaxurl, data_to_send, function() { alert('it in here'); $('#fade_in_text_sort').html('your sort order being saved!'); }) .done(function() { alert('done'); $('#fade_in_text_sort').html('we saved data!').delay(2000).fadeout('fast'); }) }); this works fine first time click submit button , displays text correctly. when click on submit again both alerts text never displayed again. since i'm using fadeout figured display again doesn't that. ideas why? first time ajax done hide (fadeout) element, next time need show (before hide again): $('#fade_in_text_sort').html('we saved data!').show(0).delay(2000).fadeout('fast'); here example button: $('#submit_new_player_order').on('click', function...

php - Laravel 5 - Checking if the user session has expired -

i trying implement way check if user session has expired , pop-up modal letting user know. here have far. route route::get('auth-check', ['uses' => 'userscontroller@authcheck', 'as' => 'auth.check']); userscontroller use illuminate\contracts\auth\guard; class userscontroller extends controller { public function __construct(guard $auth) { $this->auth = $auth; } ... /* * returns {status: false} or {status: true} */ public function authcheck() { return response(['status' => $this->auth->check()]) ->header('content-type', 'application/json'); } } master blade (so can checked on page) <!-- modal --> <div class="modal fade" id="session-expired"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-h...

postgresql - rails postgres date_time not working properly -

i getting weird error when trying save record datetime postgres. works, see first example. other times doesn't work. update "client_comments" set "comment" = $1, "conversation_time" = $2, "updated_at" = $3 "client_comments"."id" = 2 [["comment", "test2"], ["conversation_time", "2015-03-09 23:42:00.000000"], ["updated_at", "2015-03-16 23:50:32.307101"]] works, no problems! when use form <%= f.datetime_select :conversation_time, { :start_year => 2010, :end_year => date.today.year } %> i click update, params are: parameters: {"utf8"=>"✓", "authenticity_token"=>"iz/ms9mi3k7h0dg05afjaiktudlpug3ipatapgbheqa=", "client_comment"=>{"client_id"=>"1221", "user_id"=>"1", "company_id"=>"mon", "conversation_time(1i)...

parse.com - Error setting up push notification using parse in android studio -

following parse.com tutorial setting push notification on android ( https://parse.com/tutorials/android-push-notifications ). getting below error: 03-16 14:36:15.280 19899-19952/experties.com.handytask e/com.parse.pushservice﹕ tried use push, app not configured push due to: push not configured app because app manifest missing required declarations. please add following declarations app manifest support either gcm or ppns push (or both). enable gcm support, please make sure these permissions declared children of root <manifest> element: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.vibrate" /> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name=...

jenkins - Android emulator in Docker -

i`m trying start android emulator inside docker container, error: root@686d602e6ffa:~/android-sdk-linux/tools# ./emulator error: 32-bit linux android emulator binaries deprecated, use them have @ least 1 of following: - use '-force-32bit' option when invoking 'emulator'. - set android_emulator_force_32bit 'true' in environment. either 1 allow use 32-bit binaries, please aware these disappear in future android sdk release. consider moving 64-bit linux system before happens. but os inside container ( uname -a ) ubuntu smp tue mar 10 20:06:50 utc 2015 x86_64 x86_64 x86_64 gnu/linux and manually starting emulatox64-x86 works fine: android-sdk-linux/tools# ./emulator64-x86 emulator: error: did not provide name of android virtual device '-avd <name>' option. read -help-avd more information. if *really* want *not* run avd, consider using '-data <file>' specify data parti...

javascript - querySelectorAll() print textcontent of all nodes -

this code using text content webpage. yet not working , not know doing wrong. <tr style="color:#000000" class="odd"> <td style="padding:5px 5px 5px 10px" align="center"><input type="checkbox" name="cards[]" id="card_278002" value="278002"></td> <td align="center">411756</td> <td align="center">sherrie</td> <td align="center">89852</td> </tr> and thats js code : function get42() { return document.queryselectorall('tr>td').textcontent; } console.log(page.evaluate(get42)); output : null .. doing wrong ? you can't use document.queryselectorall that. returns nodelist . have take textcontent each node yourself. longer way: function get42() { var tds = document.queryselectorall('td'), result = []; (var = 0; < tds.length; i++) { res...

regex - Powershell log tailer issues -

Image
i have written log tailer powershell, tailer loads in xml file contains configuration information regarding when report on word match in log tail (basically if patterns occur x amount of times in tail). at moment tailer not returning matches many of lines contain matches. for example retrieving log file many info lines, if check word info nothing detected, if work shutdown returns matches (the line shutdown contains info on line). the strange thing using same log file , same powershell script seems produce accurate results on own machine behaves strangely on server. i suspect might issue version of powershell running on server, hoping here might know of issues can come different versions. have noticed when print out number of matches, if nothing found output blank, perhaps should 0 , causing weird issue trigger? function main() { #### global settings $debugpreference = "continue" $servername = $env:computername $scriptpath = split-path $script:m...

c++ - Simple OpenCV Program crashes -

i having problem. following instructions given in book "opencv 2 computer vision application programming cookbook" creating simple image display program in opencv (2.4.10-1) using qt(5.4), qtcreator in ubuntu 14.04. the code follows: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> int main() { // read image cv::mat image = cv::imread("${path_to_home}/pictures/bottle_label.jpg"); if ( image.data == null ) { std::cout << "no data loaded" << std::endl; return -1; } else { // create image window named "my image" cv::namedwindow("my image", 1); // show image on window std::cout << "image loaded" << std::endl; cv::imshow("my image", image); // wait key 5000 ms cv::waitkey(5000); return 0; } } and contents in .pro file ...

java - Self written eclipse plugin works for Luna, but not for Juno -

i developed plugin in eclipse standard/sdk version: luna service release 1 (4.4.1) build id: 20140925-1800 and works fine. install via feature project eclipse version (luna). try install same plugin for android developer tools eclipse platform juno version: 4.2.1.v20130118-173121-9mf7ghydg0b5kx4e_skfzv-1mnjvatf67zab7 build id: m20130204-1200 and not work. found similiar problem on stack overflow , not solution ... eclipse plugin developed under helios doesn't show in juno . does have idea? some notes: i haven't got warnings/errors or while installation. in "plugins\aal_validator_eclipse_plugin_1.0.0.201503170126" exists plugin in "\eclipse\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info" "aal_validator_eclipse_plugin,1.0.0.201503170126,plugins/aal_validator_eclipse_plugin_1.0.0.201503170126/,4,false" first entry i see plugin in eclipse juno, menu-entry "enable aal validator builder" not a...

linux - How to replace multiple blank lines with a single line in C language -

i want squeeze multiple lines in single line. have tried apply own logic there wrong. char *p; linecount=0; while (fgets(buffer, sizeof(buffer), file)) { //it print user input number p=buffer; if('\r' == *p ||'\n' == *p ) { linecount++; if(linecount>2 ) printf("\n"); } else { linecount=0; printf("\t %s", p); } for instance file has lines like a b c d e then output should be a b c d e basically, devloping code cat -s command. in if block: if(linecount>2 ) printf("\n"); what doing printing out 3rd, 4th, ..nth blank lines. the first blank have linecount ...

html - net::ERR_INCOMPLETE_CHUNKED_ENCODING when trying to show PHP page -

i have page loads list of data rows via foreach loop. code goes this: <table> <thead>...</thead> <tbody> <?php foreach($data $datarow){ ?> //data displayed here. 10 hidden fields , <tr>'s 8 <td>'s each <?php } ?> </tbody> </table> when run on local machine (with iis), renders fine. if there more 20,000 elements in $data but when publish server , try run this, following error in chrome debugger: net::err_incomplete_chunked_encoding. when $data has 500 elements. edit: below 500 works fine does know how can solve error? have increase value of setting on iis server? thanks in advance

c# - Not able to Update the LINQ list -

i have list of products came database , list, used linq , return list of phone class. list<product> products = new list<product> { new product { id = 1, name = "alcohol", expired = false }, new product { id = 2, name = "phone", expired = false }, new product { id = 2, name = "phone", expired = false }, new product { id = 3, name = "computer", expired = false }, new product { id = 4, name = "chair", expired = false }, }; var results = in products.where(o => o.name == "phone") select new phones { id = i.id, phone = i.name, ischild = i.expired }; //update ischild property foreach (var item in results) { item.ischild = true; } public class phones { public int id { get; set; } public string phone { get; set; } public bool ischild { get; set; } } i used update list of phon...

wordpress - Plugin not displaying function on page where shortcode is present -

this plugin i'm developing, it's function display csv file stored in plugin directory, html table; reason i'm writing manually rather using 1 of many existing plugins perform similar task is; need able use html output script's functions executed later, rather displaying data. the shortcode functioning because isn't visible on page, nothing else appears on page. as far know csv file i'm using test plugin isn't corrupted, can opened. this content of book1.csv: test1,test2,test3 a,b,c 1,2,3 4,5,6 7,8,9 10,11,12 13,14,15 <?php <table> <thead> <th> image </th> <th> name </th> <th> price </th> </thead> <tbody> <?php add_shortcode( "csv", "open_csv_file"); function open_csv_file() { $handle = fopen("book1.csv", "r"); while (($data = fgetcsv($...

Insert formula into cells using excel vba -

i'm trying follow this example , it's not working. offset cause problem? here's have: sub parse_dates_flurry() dim col_diff integer ' how many columns away unparsed date col_diff = -20 dim num_of_char integer num_of_char = 10 dim sheet_name_flurry string sheet_name_flurry = "flurry_an_output.csv" ' rows used in sheet dim rows1 long rows1 = get_rows_generic(sheet_name_flurry, 1) ' find last column , fill formula dim formula_parse string formula_parse = "=left(rc[col_dif],num_of_char)" ' dim starting_cell_range range dim n long worksheets(sheet_name_flurry) set starting_cell_range = .range(find_last_column(sheet_name_flurry)) starting_cell_range.offset(0, 1) = "parsed date" n = 1 (rows1 - 1) ' getting error here: starting_cell_range.offset(n, 1).formula = formula_parse next n end end sub ...

javascript - Traversing Using Jquery .find() to Select Element by Class & Store Prop -

i'm trying search through descendants of element "service-block" find specific element class "title" using below code. can't var have "undefined" assigned. appreciated - <div class="col-md-4"> <div id="service-block" class="wp-block default grey-glow"> <div class="figure"> <img alt="..." src="~/images/services/nav-icon-white.jpg" class="img-responsive"> </div> <div class="wp-block-body services-text"> <h2 id="test" class="title">lorem ipsum <span class="heavy-header" style="color:#001990;">lorem ipsum</span> lorem ipsum</h2> <p>lorem ipsum.</p> </div> </div> </div> $("#service-block").hover(function () { va...

sql server - can I use CTE this way? -

working refactor stored procedure convert heavy sqlxml statements plain sql resultset... it's been difficult.. thinking define multiple cte tables, each reference previous one, this: ;with cte1(column1) (....) cte2(column2) (select column2,... inner join (select ... group column3 having column3 in (select column1 cte1)) cte3 (select ... inner join (select ... group column4, column5 having column4 in (select column1 cte1) , column5 in (select column2 cte2) ) select * cte1, cte2, cte3 although final select not join each other, can still expect correct resultset use comma after each cte below: ;with cte1(column1) (....) , cte2(column2) (select column2,... inner join (select ... group column3 having column3 in (select column1 cte1)) , cte3 (select ... inner join (select ... group column4, column5 having column4 in (select column1 cte1) , column5 in (...

ios - Parsing RSS in Obj-C? -

i'm trying parse rss date view in app, following this tutorial . have json file retrieve information , display on screen. here's code // // viewcontroller.m // jsonyt // // created yo_291 on 3/16/15. // copyright (c) 2015 yo_291. rights reserved. // #import "viewcontroller.h" @interface viewcontroller () { nsmutabledata *webdata; nsurlconnection *connection; nsmutablearray *array; } @end @implementation viewcontroller - (void)viewdidload { [[self myview]setdelegate:self]; [[self myview]setdatasource:self]; array = [[nsmutablearray alloc]init]; [super viewdidload]; // additional setup after loading view, typically nib. } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } -(void)connection:(nsurlconnection *)connection didreceiveresponse:(nsurlresponse *)response { [webdata setlength:0]; } -(void)connection:(nsurlconnection *)connection didr...