Posts

Showing posts from June, 2014

c# - list vs observable comparison table -

is there comparison table of "list vs observable" , performance comparision table? if table not exist know differences between list , observable. minor performance overhead event firing , eventargs construction. no addrange() method.

Can StyleCop warnings / errors create Visual Studio todo tasks -

is there way stylecop violations being shown in resharper to-do explorer (or similar window, appreciate to-do tasks generated actual content in comments) can keep pinned , track. i using visual studio 2010 resharper , stylecop resharper plugin. thanks in advance. have tried resharper's inspection results: resharper->inspect->code issues in solution. you need create own extension add to-do comments each issue show in to-do explorer.

c# - Client side form validation in mvc4 -

can validate email , password using jquery. i using following codes validation . not working @using (html.beginform(new { @class = "emlfrm" })) { @html.validationsummary(true) <p>@html.label("email") @html.textboxfor(model => model.mem_email, new { @class = "eml" }) <label id="error" style="padding:0;color:red;font-size:12px; width:100%;"></label> </p> <p style="padding:0 20px;"> @html.label("password") @html.editorfor(model => model.mem_pwd) </p> <p style="margin-left:27%;"> <input type="submit" value="submit" /> </p> } $(function () { $(window).on('load', function () { $(".emlfrm").on("submit", function () { //email validation var x = $(this).find(".eml").eq(0).val(); var ...

c# - XML parsing: line 1, character 7, semicolon expected -

an error occurs when running xml sql in c#. missing? works fine in sql server management studio not in c#. protected datatable servicecodes(string ordercolumn = default(string), bool orderascending = true) { string sql = @" select distinct(split.a.value('.', 'varchar(100)')) data ( select cast('<m>' + replace(text09, ',', '</m><m>') + '</m>' xml) data assets category = 'service' ) cross apply data.nodes ('/m') split(a) order data"; return databaseconnection.executedatatable(sql, 120000); } i think there's special character in text09 column. try this: select distinct(split.a.value('.', 'varchar(100)')) data ( select cast('<m>' + replace...

android - TextView does not appear when added dynamically -

i dynamically adding textview not appear, seems problem? is there difference between following 2 lines: receiptlayout.addview(order_1_confirm); ((linearlayout) receiptlayout).addview(order_1_confirm); well, neither 1 of them not work! my activity_receipt.xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/receiptmainlinearlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <imageview android:id="@+id/image_view_rsc_logo" android:layout_width="wrap_content" android...

html - Bootstrap span are not inline -

jsfiddle of code http://jsfiddle.net/55pqg/6/ why button1 , button2 not standing side side? <div class="row-fluid span12" style="width: 300px"> <div class="row-fluid span6 " style="background-color: #ff0;">button1</div> <div class="row-fluid span6 btn" style="background-color: #f0f;">button2</div> </div> and span work differently tables in bootstrap? (code in jsfiddle) remove row-fluid both buttons. first button needs .btn class <div class="span6 btn" style="background-color: #ff0;">button1</div> <div class="span6 btn" style="background-color: #f0f;">button2</div> js fiddle: http://jsfiddle.net/55pqg/7/

xaml - C# - wp8: change textblock content by dynamically? -

i have several html files in app. displayed through webbrowser. stored current displaying page's number string page . wanna display page name in textblock. so, have stored text string's. example string chapter1 = "welcome page"; string chapter2 = "about us"; //...// 100 strings if welcome page displayed in webbrowser, string page 1. using string page string chapter1 should filename.text likewise wanna display. but, dunno how so. best answers appreciated. c# code; textblock filename = new textblock(); filename.margin = new thickness(0); filename.fontsize = 30; filename.foreground = new solidcolorbrush(colors.white); filename.textalignment = textalignment.center; filename.text = "???"; if xaml controls labelled [have name tag], can call them c# this: xaml: <textblock name="filename" margin="0,0,10,0" fontsize="30" foreground="white" textalignment="center" /> <pho...

How to get 10 days back date by giving one date as parameter to the shell script -

if give date "20130828"(not current date) in yyyymmdd format, how can 10 days date using shell script i.e. 20130818 in advance! try date +%y%m%d --date="20130818 -10 day" or even date +%y%m%d --date="20130818 10 days ago" +%y%m%d format of date (yyyymmdd), , through --date can provide string (in human readable format) specify when want date.

Delphi - Firebird - Vista access to socket denied -

i facing problem delphi application connecting firebird database on port 45000: if try connect localhost/45000:c:\dbname.fdb giving below error can't format message 13:98 -- message file c:\firebird.msg not found. unable complete network request host "localhost". failed establish connection. attempt made access socket in way forbidden access permissions. i don't understand error tried changing port cheked free ports using netstat command no use. any highly appreciated in advance i think had same problem in past. re-installing firebird helped.

vbscript - VBS passing variable to recursive sub -

i relative newbie vbs , scripting in general. i've got housekeeping script among other things clears empty folders i've got bit of trouble with, can tell me going wrong.. here sub sub clearfolder(folder) 'recursive search old empty folders each subfolder in folder.subfolders if subfolder.files.count = 0 , subfolder.subfolders.count = 0 logwrite "the folder:" & subfolder.path & " empty , removed" redim preserve arrfolders(arrpath) arrfolders(arrpath) = subfolder.path foldersdeleted = foldersdeleted + 1 arrpath = arrpath + 1 else logwrite "the folder:" & subfolder.path & " contains files or folders" end if clearfolder subfolder next end sub when call sub.. this works: clearfolder objfso.getfolder ("f:\scripts\file_cleardown\testing\_uk") this doesn't work: (strvariable above path) clearfolder objfso.getfolder (strvariable) c...

android - Change color of selected bar in Achartengine -

i have change color of particular bar selected user in bar chart. when ever user select bar want change color of bar , again if user change selection of bar last selected bar show default color. note: saw in 1 post have use 1 more series contain selected bar can achieve that. need sample code understand that. private string[] mmonth = new string[] { "january", "feburary", "march", "april", "may", "june", "july", "aug", "sep", "oct", "nov", "dec" }; int[] x = { 0, 1, 2, 3, 4, 5, 6, 7 }; int[] income = { 2000, 2500, 2700, 3000, 2800, 3500, 3700, 3800 }; public static final string type = "type"; private xymultipleseriesdataset mdataset = getdemodataset(); private xymultipleseriesrenderer mrenderer = getdemorenderer(); private graphicalview mchartview; protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub sup...

android - Why does SeekBar customization work on 4.1 but not on 4.2 and 4.3? -

i've created custom seekbar , works perfect 4.1 devices, on 4.2 , 4.3 devices not show background, leaves blank. this do: myseekbar.setprogressdrawable(getresources().getdrawable(r.drawable.seekbar_progress)); myseekbar.setbackgrounddrawable(getresources().getdrawable(r.drawable.slider_shape)); seekbar_progress.xml: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <bitmap android:src="@drawable/slider_background_part" android:tilemode="repeat"> </bitmap> </item> <item android:id="@android:id/progress"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <clip> <color xmlns:android="http://schemas.android.com/apk/res/android" ...

objective c - I need these three stock options to be class level variables, so they are only declared and initialised once -

i need 3 stock options below declared , initialised once. have got pseudo-code achieve i'm unsure on how make work. this declared in .m file of ios app , nothing in .h file . pseudo-code below: // _msftstockprice _googstockprice _applstockprice need class level if(_msftstrockprice == nil) googstockprice = [[[cpdstockpricestore sharedinstance] monthlyprices:cpdtickersymbolmsft] if(_applestrockprice == nil) _msftstockprice = [[[cpdstockpricestore sharedinstance] monthlyprices:cpdtickersymbolmsft] if(_msftstrockprice == nil) msftstockprice = [[[cpdstockpricestore sharedinstance] monthlyprices:cpdtickersymbolmsft] if ([plot.identifier isequal:cpdtickersymbolaapl] == yes) { return [_applestockprice objectatindex:index]; } else if ([plot.identifier isequal:cpdtickersymbolgoog] == yes) { return [[_googstockprice objectatindex:index]; } else if ([plot.identifier isequal:cpdtickersymbolmsft] == yes) { return [_msftstockprice objectatindex:index]; } don'...

c# - show just the date when bind a datetime Field in label in repeater -

i have repeater in asp.net page , bind data source repeater there label in repeater , text of label datetime field want label show me date not date , time <asp:label id="lbldate" runat="server" text='<%# eval("postdate") %>'></asp:label> this code show date , time together add dataformatstring="{0:dd/mm/yyyy}" <asp:label id="lbldate" runat="server" text='<%# eval("postdate") %>' dataformatstring="{0:dd/mm/yyyy}" ></asp:label>

extjs - Nested List view to show other -

here code showing list using sencha. when click any row how make visible detailed view.i have tried following link sencha nested list way no response. list view var tab= ext.create('ext.list', { width: 320, height: 320, store: { fields: ['ext_xtype','imgurl','arimg'], data: [{ ext_xtype: 'harry potter 4', imgurl:'bo.png', arimg:'arrow.png' },{ ext_xtype: 'iphone5 64gb', imgurl:'mo.png', arimg:'arrow.png' },{ ...

Detect mousewheel usage but keep the page scrolling (javascript/jquery) -

i need detect mousewheel usage, when add event listener stops whole page scrolling no matter how fiddle it. i've tried using mousewheel plugin brandon no avail. need simple mock-up code: user has used mousewheel: boolean=true if boolean==true: execute code, change boolean false until next mousewheel usage. i'm new don't go overboard it, thanks. i think need that. bare in mind detect scroll keyboard (down key). if want detect scroll: $(window).scroll(function () { //scroll ); and if want defer between scroll , down: var lastscrolltop = 0; $(window).scroll(function () { var st = $(this).scrolltop(); //downscroll if (st > lastscrolltop){ } //upscroll else{ } lastscrolltop = st; ); sorry, answer not looking for. using answer abdul sy, instead on scroll, @ bind mousewheel event - http://www.jquerysdk.com/api/event-mousewheel ...

matlab - Renaming xPC Target data files after stopping model -

i logging data using file scope on target pc. prevent loss of data, rename files once model has stopped running. i read post renaming files on boot: http://www.mathworks.de/matlabcentral/answers/36751 is there way modify occurs after model stops? note post mention xpc target embedded option, not sure if data files deleted between reboots standard xpc target (not embedded option). how transferring data target pc host pc @ end of run? can archive data in mat files on host files wish. check out xpc target data logging methodologies , xpc file scope tools on file exchange. there may functions in xpc file system allow rename files on target pc, need check doc version of xpc target. find, there weren't in previous versions.

java - How to apply if condition in jframe constructor -

i have jframe named myframe in constructor myframe() have if condition myframe() { if(condition) { openframe(); } } if condition in not true, don't want open frame. still opens blank frame. the problem you're not checking condition until you're in process of creating new myframe . if condition false, skip openframe() , presumably adds content, myframe still there. should put if statement around whatever calling new myframe() .

php - How can i delete item from MySQL? -

well have code : $check = mysql_query("select * items id='$id'"); $checknum = mysql_num_rows($check); if($checknum==1) { mysql_query("delete * items id= '$id' ") or die("mysqlerror"); echo "ok"; } remove asterisk. mysql_query("delete items id= '$id' ") or die("mysqlerror");

css - HTML: How to increase width of table columns when the table is inside a div with fixed width -

the following piece of html code creates table inside div of fixed width. seems "th,td" width inherited parent div (but w3 documentation says not inherited property!). how increase width of table columns (say 500px)? you can see changing width value in "th, td" selector not have impact on width. please note: - not want change width of div - not want set fixed width table - have tried "table-layout: fixed;" inside table selector. did not make "td,th" width property work. <!doctype html> <html> <head> <style> table { border-collapse:collapse; } table, td, th { border:1px solid black; } th, td { /* changing width doesn't make difference */ width:500px; } .myclass { width:200px; overflow:auto } <...

php - Adding featured image in wordpress.com via api -

i want add new post featured image, firstly add image post. function add_post($access_key,$blogid,$title,$content,$categories_array,$tags_array,$featuredimage) { $options = array ( 'http' => array ( 'ignore_errors' => true, 'method' => 'post', 'header' => array ( 0 => 'authorization: bearer '.$access_key, 1 => 'content-type: multipart/form-data', ), 'content' => http_build_query( array ( 'title' => $title, 'content' => $content, 'tags' => $tags_array, 'categories' => $categories_array, 'media'=>$featuredimage,///array($featuredimage),//jak nie zadziala zapakowac w array 'media[]'=>$featuredimage//array($featuredimage) ) ), ), ); ...

algorithm - Several big O notations for the same function -

let f(n)= ( (n^2+2n)/n + 1/1000*(n^(3/2)))*log(n) the time complexity function both o(n²*log(n)) , o(n^(3/2)*log(n)) how possible? thought dominating term here n² (*log(n)) , therefore should o(n²*log(n)) big o notation , time complexity measures feels ambiguous big o notation isn't confusing. defines upper bound running time of algorithm, hence, if o(f(n)) valid upper bound, every other o(g(n)) such g(n) > f(n) definitively valid, since if code run in less f(n) , sure run in less g(n) . in case, since o(n^2 *log(n)) dominates o(n^(3/2) log(n)) , it's valid upper bound too, if it's less strict. furthermore, algorithm o(n^3) . question is, 1 of big o notation gives more informations algorithm? obvious answer lower one, , that's reason why indicate that. to make things cler : let's can throw ball in air 10m. then, can can't throw higher 10m, or can't throw higher 15 meters. fact first 1 stricter upper bound, doesn't make se...

java - Query terminate with semicolon(;) get SqlException and process does not terminate -

say query is select * table_a pk=1; if run query(with semicolon) java using preparedstatement, sqlexpection thrown. using oracle 10g , java 5. my question :though query valid one, why sqlexception(ora-00911: invalid character) occurred when query executed form java prepared statement ? statement terminators not part of statement itself. jdbc api intended execute individual statements, statement should not terminated. for databases, statement terminator not part of statement syntax, artifact of cli (which needs know when query finished sent server).

python tarfile to ignore directory structure while creating tarball -

i having direcotry structure : d:\testfolder\folder_to_tar: |---folder1 |--- file1.txt |---folder2 |--- file2.txt |---file3.txt i want create tarball using python @ same directory level. however, observing in tarball python including parent directory i.e. testfolder in example. expected output : d:\testfolder: |---folder_to_tar.tar |---folder_to_tar |--folder1 ..... actual output : d:\testfolder: |---folder_to_tar.tar |---testfolder |---folder_to_tar |--folder1 ..... code : import tarfile tarname = "d:\\testfolder\\folder_to_tar" tarfile1 = "d:\\testfolder\\folder_to_tar.tar" tarout = tarfile.open(tarfile1,mode="w") try: tarout.add(tarname,arcname=tarna...

html - ExpressJs Cannot Get /register Error -

i'm having error using expressjs. says "cannot /register.html". don't have idea how solve this. show register.html /register error. btw here's code guys. guys, hope can me, i've googled errors 1 hr can't still make work. app.js var express = require("express"); var app = express(); var redis = require("redis"); var client = redis.createclient(); var reply; app.use(express.bodyparser()); client.on("error", function (err) { console.log("error event - " + client.host + ":" + client.port + " - " + err); }); app.get("/", function (req, res) { res.sendfile(__dirname + "/login.html"); }); app.get("/", function (req, res) { res.sendfile(__dirname + "/register.html"); }); app.post("/login", function (req, res) { res.sendfile(__dirname + "/login.html"); console.log("--------------------"); console.log(req.body.user.username);...

delphi - SynEdit OnPaintTransientDemo -

i'm working delphi 2007 , synedit component. i'm main developer of open source editor ( tinn-r ) , i'm trying switch synedit ansi unicode . after months of work working fine except onpainttransient procedure. to try discover source of problem have tried original demo onpainttransientdemo . works in latest ansi version of synedit. however, i'm not getting same result latest unicode version. if instruction occupies 1 line, 1 symbol "[] {} or ()" near @ cursor mistakenly highlighted, closes not. in other words, when click on first bracket "(" last bracket ")" doesn't change color. should color start , end tag. example, considering "|" cursor position: (|aaaa) -> ( highlighted (aaaa|) -> ) highlighted however, if symbols in different lines both correctly highlighted: (|a a a) -> both () highlighted (a a a|) -> both () highlighted this looking bug in sources of component! (doing debug not fi...

networking - What is the advantage of using proxy in network for accessing internet? -

my college has different proxies accessing internet 192.168.0.2/3/4 , specific port number.what advantage of using ? know happens there.i heard institution has different isp connections shared on same network. role of proxy there? it easy know if understand proxies , why used generally. found on magical website called www.google.com. using proxy, more control on network because request go through there.your school may want stuffs traffic shaping, content filtering etc. using proxy server make sure request internet routed there first.

php - Drupal high number of queries -

i have drupal site , slow. it's on localhost , takes 4-5 sec load 1 page. enabled general_log in mysql , saw 1 page drupal executes more 2000 queries... is there way speed ? drupal can beast if not optimized production: general guideline: disabled devel module disabled views ui enabled views caching (views content cache) enable page caching enable block caching disable database logging (use syslog instead) disable statistics module note: if site makes use of authenticated traffic (logged in users drupal), different paradigm in of caching efforts above ignored logged in users.

ios - UiCollectionViewCell random images flipping -

i have been looking around here answer no success ill make try self. im trying make uicollectionview different cells containing images + animation cells. i want cells "random flipping" images (5 different images) uiviewanimationoptiontransitionflipfromleft in loop 5-6 sec delay. the animation have moment this: - (void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { uicollectionviewcell *cell = [collectionview cellforitematindexpath:indexpath]; [cell.superview bringsubviewtofront:collectionview]; [uiview transitionwithview:cell duration:1.0 options:uiviewanimationoptiontransitionflipfromleft animations:^{ [uicollectionviewcell commitanimations]; cell.transform = cgaffinetransformmakerotation(0.0); } completion:^(bool finished) {}]; } i...

node.js - Beginner - setting up local host for Angular app using XAMPP on Windows 7 -

i have taken angular app works on local host when use visual studio iie server. i don't want use visual studio , trying test app locally using xampp. i complete beginner, , cannot local host pick-up html initialization file. have checked following: skype off , port set 80 in xammp root server in httpd.conf setup correctly (no slash @ end) i getting little confused 'how' angular work on xammp local host. need yeoman or grunt (seen these apps in posts, seem command line environment). any help, or pointer step step set-up great! angular no different normal html web page, when comes working in localhost. does xampp work standard html files? do have error generated?

javascript - Navigation menu with php, js and mysql -

note: original & new inside code. my issue here original "parent" not seo friendly , not act according plan, not fetched in sitemaps. however new seo friendly, picked in sitemaps , according plan in end. i need link can see both navigation menu left name of each menu / sub-menu , in center of page have picture name each sub-menu depending on parent click in navigation menu on left. with new line added page refresh due link, sub-menus flash open second before refresh. what need solving is: -making sub-menu stay open during page refresh can use both navigation sidebar navigation , center navigation. thanks in beforehand! //jim this current menu: <div id="container"> <dl> <?php $select_category = mysql_query("select * menu hidden = 0 order menu asc"); while($ln = mysql_fetch_array($select_category)){ $idcat = $ln['nmr']; $catname = str_replace(...

writetofile - Why can't I save files to my iOS apps /Documents directory? -

i writing app can access ios root system, user should able save files document directory. using code save file document directory. for text: nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; [self.filepath writetofile:[nsstring stringwithformat:@"%@/%@", documentsdirectory, [self.filepath lastpathcomponent]] atomically:yes encoding:nsutf8stringencoding error:nil]; for other files: nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; [self.filepath writetofile:[nsstring stringwithformat:@"%@/%@", documentsdirectory,[self.filepath lastpathco...

c# - Joining two dictionaries -

hi have 2 dictionaries , need find way join them together.here 2 dictionary types. idictionary<string, byte[]> dictionary1 idictionary<ifilesharedocument, string> dictionary2 out of 2 dictionaries have create third dictionary this idictionary<ifilesharedocument, byte[]> dictionary3 both dictionaries have exact same number of items , string property of both them linking point. what able write somethign this: dictionary1.value join dictionary2.key dictionary1.key == dictionary2.value statement should result in dictionary3. is there way can achieve can not seem find way this? here's way using linq query syntax, join (this compiles same thing @kingking's solution): idictionary<ifilesharedocument, byte[]> dictionary3 = (from item1 in dictionary1 join item2 in dictionary2 on item1.key equals item2.value select new { item2.key, item1.value }) .todictionary(x => x.key, x => x.value); note above prefer...

javascript - Alert makes polyline on map display correctly! Any ideas? -

i'm reading collection of lat/long xml file , plotting markers on google map. additional join markers polylines based on "flight coordinates example". my problem need have alert("anything") before polylines drawn, otherwise markers doesn't display on map. suspect has loading of map, have no idea how past it? have tried setinterval, created busy loop not solve problem. assistance appreciated. also, apologies if code not display in 1 block function initialize() { var myoptions = { zoom: 15, maptypeid: google.maps.maptypeid.satellite } map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); var ctalayer = new google.maps.kmllayer('http://xxx.kmz'); ctalayer.setmap(map); var flightplancoordinates = new array() downloadurl("incident/breadcrumb.xml" + "?dummy=" + math.random(), function (data) { var markers = data.documentelement.getelements...

android - Which is this graph library? -

anyone knows graph library use application? https://play.google.com/store/apps/details?id=com.cgollner.systemmonitor looks lot similar https://bitbucket.org/danielnadeau/holographlibrary/wiki/home hope help

Why might SQL Server 2008 OLE DB UDL require port 1433 explicitly specified? -

in production environment, found port 1433 must explicitly specified "microsft ole db provider sql server" udl. this: provider=sqloledb.1;user id=user;data source=ip,1433 without port specified, error is: test connection failed because of error in initializing provider. [dbnetlib][connectionopen (invalid instance()).]invalid connection. same environment, sql native client 10.1, not require 1433 explicitly specified: provider=sqlncli10.1;integrated security="";persist security info=false; user id=user;data source=ip;... same test against development sql server, ole db udl not require default port specified. under circumstances might necessary explicitly specify default port? the production system clustered, primary active , secondary passive, , cluster server connections made. development environment single sql server 2008. don't know of other differences. if think plays it, why might matter? client sql server (where udl created): win...

c# - Open Oracle connection failed while using Oracle.ManagedDataAccess -

i'm testing oracle.manageddataaccess 4.121.1.0 .net console application , powershell script, fine in c# application. unfortunately have strange issue powershel script while try open oracle connection open method. here powershell "script" add-type -path 'c:\oracle\odp.net\managed\common\oracle.manageddataaccess.dll' $cnx = 'data source=(description=(address_list=(address=(community = tcp.world)(protocol = tcp)(host = host)(port = 1521)))(connect_data=(sid=sid)));user id=user;password=pwd;' $con = new-object oracle.manageddataaccess.client.oracleconnection("$cnx") $con.open() the error thrown exception lors de l'appel de « open » avec « 0 » argument(s) : « impossible de trouver l'asse mbly 'oracle.manageddataaccess, version=4.121.1.0, culture=neutral, publickeytoken=89b483f429 c47342'. » au niveau de c:\oracle\oracle.ps1 : 5 caractère : 10 the same code written in c# console application works fine. i think...

ios - Non-scaling / absolute gradient for scatter plots in CorePlot? -

Image
i've added gradient scatter plot in usual manner: cptfill areagradientfill = [cptfill fillwithgradient:areagradient1]; boundlineplot.areafill = areagradientfill; boundlineplot.areabasevalue = 0; setting minimum gradient easy areabasevalue property. however, gradient stretch such entire range of color defined areagradient1 appears below line plot. what i'd set absolute y-axis range (e.g., 0 100) , have gradient set range. if line @ y=50, bottom 50% of gradient rendered below line. thought setting boundlineplot.areabasevalue2 = 100; this, doesn't have effect. does coreplot support this? if not, what's 'right' way go implementing it? (this first question apologies if i'm not clear. gentle. :) ) while there's no direct way make happen use trick. make horizontal global range wider show , not make graph horizontally scrollable. add value graph in hidden area maximum value. filled full gradient. other parts partial gradient, depending...

html - white-space: pre; ignored/inconsistent inside <td> in export to (save as) .xls -

Image
consider following, in browser: <tr> <td><pre>my ex tra whitespace preserved</pre></td> </tr> <tr> <td style="white-space: pre;">my ex tra whitespace preserved</td> </tr> but in excel, when open above .html file, whitespaces removed unless use <pre> this problem because 1 table i'm exporting has 50 columns , ~2000 rows. not balloons size of file (which fine), causes excel crash. i used pre tags wrap tds this: <tr> <pre> <td>my ex tra whitespace preserved</td> <td>my ex tra whitespace preserved</td> <td>my ex tra whitespace preserved</td> </pre> </tr> it worked fine. used on 2000 line html table 6 columns.

jquery - If item has class change css of another -

so have unordered list menu. have setup whenever click menu item, menu item gets class "active" added it, , other list item class has removed. part works fine. now, have arrow absolute position , want change "top" style depending on class has "active" class. checking when site loads, won't change placement when list item gets "active" class. note: ".active-item" arrow. $(document).ready(function() { $('.nav .nav-items li').click(function () { $('.nav .nav-items li').removeclass('active'); $(this).addclass('active'); }); }); if ($('.nav .nav-items .nav-dash').hasclass('active')) { $('.nav .nav-items .active-item').css('top', '30px'); }; if ($('.nav .nav-items .nav-sales').hasclass('active')) { $('.nav .nav-items .active-item').css('top', '90px'); }; etc... you must place ar...

c# - TLB to managed .NET assembly without Regsrv32 at deploy time -

Image
i have tlb provided part of third-party api. used tlbimp.exe generate dll assembly wrappper. however, @ development time, appears assembly requires registration regsvr32 used. this isn't problem @ development time however; using managed instances in production , registering dll manually pain if not impossible when deploy. there way use managed dll assembly in way doesn't require registration step during deployment? i've been reading around internet , have found literature on registration-free com using app.manifest. viable solution? if type library embedded 3rd party com dll should be, isolated com can indeed used (you verify oleview). consuming com dll way quite easy vs2010/2012. dll has registered on development machine. you'd add reference .net project , turn on embed interop types , isolated properties: the interop assembly merged consuming .net assembly, , you'd need make sure com dll, .net assembly , generated .manifest files copied wh...

mysql - Strange order of results when adding joins -

Image
i'm trying build commenting system on website having issues ordering comments correctly. screenshot of had before went wrong: and query before went wrong: select com.comment_id, com.parent_id, com.is_reply, com.user_id, com.comment, com.posted, usr.username blog_comments com left join users usr on com.user_id = usr.user_id com.article_id = :article_id , com.moderated = 1 , com.status = 1 order com.parent_id desc; i want include each comment's votes blog_comment_votes table, using left outer join, , came query, works, screws order of results: select com.comment_id, com.parent_id, com.is_reply, com.user_id, com.comment, com.posted, usr.username, ifnull(c.cnt,0) votes blog_comments com left join users usr on com.user_id = usr.user_id left outer join ( select comment_id, count(vote_id) cnt blog_comment_votes group comment_id) c on com.comment_id = c.comment_id com....

linux - Bash script that prints out contents of a binary file, one word at a time, without xxd -

i'd create bash script reads binary file, word (32-bits) word , pass word application called devmem. right now, have: ... (( i=0; i<${num_words}; i++ )) val=$(dd if=${file_name} skip=${i} count=1 bs=4 2>/dev/null) echo -e "${val}" # weird output... devmem ${some_address} 32 ${val} done ... ${val} has weird (ascii?) format character representations looks diamond question mark. if replace "val=" line with: val=$(dd ... | xxd -r -p) i desired output. what easiest way of replicating functionality of xxd using bash? note: i'm working on embedded linux project requirements don't allow me install xxd. this script performance driven, please correct me if i'm wrong in approach, reason chose (dd -> binary word -> devmem) instead of (hexdump -> file, parse file -> devmem). - regardless of optimal route end goal, exercise has been giving me trouble , i'd appreciate helping me figure out how this. thanks! ...

Google OAuth2 not working on local development server - PHP Codeigniter spark -

i trying use codeigniter spark ( http://getsparks.org/packages/oauth2/versions/head/show ) allow users login php site fb , google. my local dev site (on wampserver) called mysite.dev, have etc/hosts file : 127.0.0.1 mysite.dev facebook login works absolutely fine. when try logging google, google complains : invalid parameter value redirect_uri: non-public domains not allowed: http://mysite.dev/index.php/oauth2/session/google oauth2 controller , session function specify fb/google, etc any clues/hints ? thanks when create client id web applications in google apis console can add allowed redirect uris . accepts localhost urls , others well.

How to traverse through other parents with jQuery? -

i have many forms on website , i'd use jquery transverse when press pgup / pgdn go next <textarea> field. got working when <textarea> 's siblings, if they're in separate form (with different parents) can't figure out. the html like: <form action="#" method="post"> <textarea id="numone" name="numone" class="num" ></textarea> </form> <form action="#" method="post"> <textarea id="numtwo" name="numtwo" class="num" ></textarea> </form> <form action="#" method="post"> <textarea id="numthree" name="numthree" class="num" ></textarea> </form> this worked when siblings: $('.num').keydown(function (e) { if (e.which == 34) { $(this).next().focus(); e.preventdefault(); return fals...

c# - Windows Communication Foundation Null Reference Error -

i trying use windows communication foundation(wcf) testing purposes in application , getting null object. new using wcf, appreciated. from understand, each host has 1 service type(class). have several interfaces , classes want test. goal make 1 master class has instances of others, don't have have several hosts running. below of code. host- public class automationwcfhost { public servicehost host; public automationwcfhost() { uri httpurl = new uri("http://localhost:8090/myfun"); host = new servicehost(typeof(myfun), httpurl); servicemetadatabehavior smb = new servicemetadatabehavior(); smb.httpgetenabled = true; smb.metadataexporter.policyversion = policyversion.policy15; host.description.behaviors.add(smb); } public void startwcf() { this.host.open(); } public void stopwcf(){ this.host.close(); interfaces - [servicecontract] public interface imyfun { [operationcon...

windows - Why doesn't this fork loop work as expected? -

why following code: #!/usr/bin/perl use strict; use warnings; use parallel::forkmanager; $pm = new parallel::forkmanager(5); @all_data = ('a','b','c','d','e','f'); foreach $data (@all_data) { # forks , returns pid child: $pid = $pm->start , next; print "hello $pid\n"; $pm->finish; # terminates child process } $pm->wait_all_children; print: hello 0 hello 0 hello 0 hello 0 hello 0 i new perl , trying catch on multiprocessing in perl from docs start method : this method fork. returns pid of child process parent, , 0 child process. as happens, fork function same, why start mirrors it. the parent may need child pid control child – sending signals , stuff – child knows own pid via $$ variable: foreach $data (@all_data) { $pm->start , next; print "hello $$\n"; $pm->finish; } example output: hello 22215 hello 22218 hello 2...

.net - visual basic hashtable image key/value -

what want achieve question random name generated array of strings particular enemyname chosen correspond eneimage.key , return value string(if possible) send form requesting information. i post whole code interested people whole code, pastebin so have hashtable below: private eneimage new hashtable() sub main() eneimage.add("orc", my.resources.orc) eneimage.add("troll", my.resources.troll) eneimage.add("salamander", my.resources.salamander) eneimage.add("cavetroll", my.resources.cavetroll) eneimage.add("dragon", my.resources.dragon) eneimage.add("vampire", my.resources.vampire) eneimage.add("werewolf", my.resources.werewolf) end sub and have for function includes each loop iterates through hashtable: private eimage bitmap public function getenemyimage() bitmap each de dictionaryentry in eneimage msgbox("key = {0}, value = {1}", de.key, de.value) ...

c++ - LNK 2019 error using Boost::asio -

i trying test snippet of friends code goes like: #include <boost/asio.hpp> #include <boost/array.hpp> #include <iostream> #include <sstream> #include <string> boost::asio::io_service io; std::string port; boost::asio::serial_port_base::baud_rate baud(115200); int main() { std::cout << "enter port number: "; std::getline(std::cin,port); while(port.empty()) { std::cout << std::endl; std::cout << "error: user must provide port number." << std::endl; std::cout << "enter port number (example: com5): "; std::getline(std::cin,port); } std::cout << std::endl; return 0; } in vc++ directories have linked both include , 64 bit libraries. in linker -> input have put additional dependencies. whenever run code error: error 1 error lnk2019: unresolved external symbol "class boost::system::error_category const ...

javascript - Reference to a bxslider after it has been created -

is possible reference bxslider has been applied element, after has been created? commonly, can reference when slider if first created. var myslider; $(function(){ myslider = $('#slider').bxslider({ auto: true, controls: true }); }); however, if have multiple sliders on same page, , being reference class instead of id, nice able reference slider object, after fact. for example html: <ul class="slider" id="my-specific-slider">...</ul> <ul class="slider" >...</ul> <ul class="slider" >...</ul> js: var myslider; $(function(){ $('.bxslider').bxslider({ auto: true, controls: true }); myslider = $('#my-specific-slider').xxx; }); not sure if still need answer suggest use each(). $(function(){ $(".slider").each(function() { eleid = $(this).attr('id'); if (eleid) { ...

php - unexpected T_VARIABLE on login script -

this question has answer here: reference - error mean in php? 29 answers hi learning php , having trouble writing login script, keep getting ", unexpected t_variable" error code says on line 16 can not find issue <?php if(isset($_post['user'])) { $user = $_post['user']; $pass = md5($_post['pass']); $con = mysql_connect ("localhost","root",""); if(!$con) {die('could not connect: '.mysql_error());} mysql_select_db("phplogin", $con); if (mysql_num_rows(mysql_query("select * users username ='$user' , password = '$pass'")) $result = mysql_query("select * users username='$user' , password='$pass'") while($row = msql_fetch_array($result)) { $expire = time()+60*60*24*30;...