Posts

Showing posts from August, 2011

RSA Chat Messenger(Number Format Exception in Java) -

im doing rsa chat messenger(single server,multiple clients).i have included send,decrypt,exit button.when client sends message 1 client other client.the client recieves message gets in encrypted form , clicks decrypt button original message.but when im clicking decrypt button im getting awt-eventqueue-0" java.lang.numberformatexception , getting wierd characters in decryption section. here code: private string bytestostring(byte[] encrypted) { // todo auto-generated method stub //return null; string test = ""; (byte b : encrypted) { test += byte.tostring(b); } return test; } public static void main(string ... args) { // take username user string name = joptionpane.showinputdialog(null,"enter name :", "username", joptionpane.plain_message); string servername = "localhost"; try { new chatclient( name ,servername); } catch(exception ex) { out.println( &quo

php - Comparison of 0 to a string fails -

update: 0 isn't using default value, after testing condition failing suggested answers. function test($value='a') { if ($value != 'a') { echo 'ok'; } else { echo 'not ok'; } } test(); // outputs not ok test('a'); // outputs not ok test(0); // outputs not ok, should output ok? test('0'); // outputs ok test(null); // outputs ok test(false); // outputs ok this kind of throwing 1 of functions. surprised see 0 , null works fine. know why php interpreting 0 default value? in php, comparing string 'a' number 0 causes change of string number. in case 'a' gets converted 0 , of course 0 == 0 . see here details. for completeness, fix, same linked documentation is use strict comparison operators (===, !==) comparison operators

c - where will be the output of the user from kernel using procfs? -

ssize_t dev_read(struct file *filp,char *buf,size_t count,loff_t *offset) { int len = count >= strlen(chr_arr.array) ? strlen(chr_arr.array) : count; *offset += len; if (*offset >= strlen(chr_arr.array)) return 0; if (copy_to_user(buf,chr_arr.array,len)) return -efault; return len; } i want read value kernel , use in user application, using procfs api read kernel , use in user space. the above read function read kernel , store in user buffer(buf). if want read output user application value read kernel stored in user space ?? me in ?? if value exposed in procfs, user application needs open procfs node file , read other file. fancy stuff's done in kernel. if you're trying write kernel component exposes procfs, you'll need similar code quoted handle read() calls procfs node.

How to breakout from an iframe? -

i have site works within iframe, want breakout iframe, , redirect site, whole new site own url should open, not maintaining current url or iframe. i have tried <meta http-equiv="refresh" content="0"; url="http://www.newsite.com/newurl.html"> , header ('location:http://www.newsite.com/'); they didnt work out me. try this: <script type="text/javascript"> if (top.location!= self.location) { top.location = 'http://www.newsite.com/'; } </script> if runs within iframe redirect parent window http://www.newsite.com/ .

tortoisegit - What should Git committers do to avoid overwriting others' changes? -

i created git repository on bitbucket project 5 committers. of new git , using tortoisegit. have master branch , want simple "svn-like" workflow: other people's changes, make changes yourself, let other people see changes. one particular committer seems having lot of trouble git , he's overwritten other people's changes several times now. undoing damage difficult, because don't know git either. can't watch him uses git, don't know does, i'd tell him: here's ensure doesn't happen . svn be: before committing, update first, merge changes , test still works . should tell him git? if you're going use git, should use power git offers... branches! on assumption don't want complicate workflow more necessary though, tell developer before committing, git pull --rebase . in nutshell, will: a) save off local changes, b) pull remote changes (that is, changes others have committed and pushed), c) replay local changes onto new co

INSPECT verb in COBOL program -

here example used inspect verb. inspect function reverse (ws-addr(7:4)) tallying ws-count leading spaces display 'count :' ws-count compute ws-length = 4 - ws-count display 'length :' ws-length i not getting right output below input, input-1 - 43we ws-count = 0 length = 4 input-2 - 85 ws-count = 2 length = 2 input-3 - 74oi ws-count = 2 length = 2 for input-3 ws-count should come 0 getting 2 value. please find console window screen shot below, in-values :%orig243we count :000 length :004 addresslines: 43we<br> ws-sub :004 in-values :%orig385 count :002 length :002 addresslines: 85<br> ws-sub :005 in-values :%orig474oi count :002 length :002 could me resolve this. you must initialize identifier-2 before execution of inspect statement begins. so says ibm enterprise cobol language reference, , words similar in cobol manual. identifier-2 target field of t

java - What is causing this runnable thread to be skipped -

i have attempted follow examples have found on implementing runnable thread, reason code skipped. for sake of having better understanding, can tell me preventing thread code executing? mainactivity.java: import android.os.bundle; import android.support.v4.app.fragment; import android.support.v7.app.actionbaractivity; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.textview; public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); if (savedinstancestate == null) { getsupportfragmentmanager().begintransaction() .add(r.id.container, new placeholderfragment()).commit(); } } @override public boolean oncreateoptionsmenu(menu menu) {

python - Some problems in compiling cx_Oracle -

i had problem when compile cx_oracle5.1.2 using "python setup.py build". there build errors follows: callback.c:49: error: ‘udt_variable’ has no member named ‘data’ callback.c:50: error: ‘udt_variable’ has no member named ‘actuallength’ callback.c:51: error: ‘udt_variable’ has no member named ‘returncode’ callback.c:52: error: ‘udt_variable’ has no member named ‘size’ callback.c:52: error: ‘udt_variabletype’ has no member named ‘size’ callback.c:53: error: ‘udt_variable’ has no member named ‘buffersize’ callback.c:53: error: ‘udt_variabletype’ has no member named ‘size’ callback.c:54: error: ‘udt_variabletype’ has no member named ‘isvariablelength’ callback.c:55: error: ‘udt_variable’ has no member named ‘buffersize’ callback.c: @ top level: callback.c:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token callback.c:113: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token callback.c:154: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or

python - Adding a falling object -

# import pygame library python import pygame,sys #this next line imports pygame sound system pygame.mixer.init() # loads sound sound = pygame.mixer.sound("c:/music/pygamenew/music2/jurassic_park_-_quot_main_theme_quot_john_williams.wav") roar = pygame.mixer.sound("c:/music/pygamenew/music2/dinosaur roar-soundbible.com-605392672.wav") # allows play song have loaded sound.play() #this allows grab inputs keyboard or mouse presses pygame.locals import * # line limits number of frames (60) # if computer speeds faster, still able play # helps prevent burning phone battery clock = pygame.time.clock() #this initiates pygame pygame.init() #set colors black = (0,0,0) white = (255,255,255) red = (255,0,0) green = (0,255,0) blue = (0,0, 255) #creating size of our game screen size = width, height = 700,700 black = 0,0,0 screen = pygame.display.set_mode((800,600)) # set title of window pygame.display.set_caption('dinosaur madness') pygame.mouse.set_visible(0)

angularJS validation firing onblur for IE10 -

i have validation form working on chrome/ff/ie8/9 on ie10 after loading page firing validation events when clicking input element , outside of element. <div class="form-group"> <label class="col-sm-3 control-label">username:</label> <div class="col-sm-9"> <input id="username" name="username" ng-model="username" type="input" ng-class="{'error-org' : userform.username.$invalid && !userform.username.$pristine}" class="form-control" placeholder="username" required> <label ng-show="userform.username.$invalid && !userform.username.$pristine" class="error-org">please enter username</label> </div> </div>

c# - Change selection WPF combobox by variable -

Image
i'm using combobox show categories user can choose. all items have id selectedvaluepath can easly when user makes selection. <combobox grid.column ="1" grid.row="1" horizontalalignment="center" verticalalignment="center" width="200" name="cbocategorieen" itemssource="{binding}" displaymemberpath="naam" selectedvaluepath="id" /> but how can change selection of combobox when have id of chosen selection (selectedvaluepath)? code doesn't , keeps selecting first one. cbocategorieen.selectedvaluepath = convert.tostring(artikelwijzigen.categorie); to conclude: how can change selection of combobox 1 matching id? i suggest follow mvvm, still answer question if have itemssource this, observablecollection<yourcomboboxclass> wswebshopmrentals; you can set selecteditem of combobox this, cbocategorieen.selectedvalue = wswebshopmrentals.firstordefault(x => x.

c# - How to get the ID of the new inserted row in the SharePoint list by using web service -

i inserting new list items in share point list using web service using below code. servicereference.datacontext sc = new servicereference.datacontext(new uri("http://servername:portnumber/_vti_bin/listdata.svc")); sc.credentials = new system.net.networkcredential(spusername, sppassword, spdomain); sc.addtosamplelist(new servicereference.samplelist { title= "hello world" }); sc.savechanges(); its working fine.. i need id of new inserted row.. is there anyway id of newly inserted row in costume web part splist splist = spweb.lists["samplelist"]; splistitem splistitem = splist.items.add(); splistitem["title"] = "hello world"; splistitem.update(); int id=splistitem.id;//like any or suggestions please.. thanks in advance... you going have change web ser

security - Runtime stack should not be executable -

i'm reading security in embedded systems,and came on statement: "the web browser’s runtime stack should not executable.". aware of stack is, , how works, i'm having hard time understanding not being executable means. mean should not able change stack @ runtime, or something? for von neumann architecture (the common today), programs , data stored in same memory. so, there has distionction of program , data. moreover, without control of executed, many programs can malicious jobs. 1 way prevent malicious programs doing bad things is, @ execution of program, load code in read only, executable memory region , use stack writable memory region cannot executed. there thing called program counter points current instruction being executed. program may change value point stack , execute malitious instructions there, can recieved on network, example, givin access unauthorized person machine. also, in linux operating system, there permission system allows specify

android - eclipse Juno often close automatically after ubuntu upgrade to 14.04 TLS -

i working eclipse before upgrade 14.04.but after upgrade 14.04 , eclipse close without warning message.and generate hs_err_pid4612.log file in desktop. how can fix problem? add following line @ end of eclipse.ini file .(eclipse.ini file located in eclipse folder of eclipse package.) -dorg.eclipse.swt.browser.defaulttype=mozilla

python - spider_closed function is not fired -

i want log data when spider finishes working. i make function inside spider. def spider_closed(self, spider): log.msg('the spider {0} finished working on'.format(self.name), level=log.info) but function not getting fired. i using scrapy 0.20 python 2.7 please note can log log , logging lot of data can see in log file. logging working me. edit i guess have dispatch signal signals.spider_closed don't know how that. you should attach method receiver signalmanager signal dispatcher: from scrapy.xlib.pydispatch import dispatcher scrapy import signals class myspider(spider): def __init__(self, *args, **kwargs): dispatcher.connect(self.spider_closed, signal=signals.spider_closed) super(myspider, self).__init__(*args, **kwargs) def spider_closed(self, spider): log.msg('the spider {0} finished working on'.format(self.name), level=log.info) also see relevant threads: scrapy: call function when spid

reporting services - SSRS Changes User Email in Subscription -

we have user subscription ssrs report. email (with last name & domain changed protect identity): dexter.name@company.com periodically won't receive reports , if investigate find email has been changed "dexter.". what cause this?

javascript - Kendo -MVC ListView - How to Get Checkbox state(checked or not) on selected row -

i trying catch checkboxes state(checked or not) on every click checkboxes on specific row.i can able id value of row clicked cannot retrieve checkbox state properly,it returns false of time(even if it's checked).at end planning edit records according checkboxes state. -on page load status of checkboxes set according model value. html(razor) @(html.kendo().listview<ais.ui.webservice.proxy.dsrvallservice.newsitem>() .name("listview") .events(e => e.change("changefunc")) .tagname("div") .selectable() .clienttemplateid("template") .autobind(true) .datasource(datasource => datasource .model(model => model.id("id")) .pagesize(5) //...some options kendo template: <div class="container-fluid" style="padding-right:0px;border-bottom:1px

postgresql - Database functions mapped to ActiveRecord Models -

let's suppose have 2 database functions (pl/pgsql): create table balances (rents decimal(12,2) default 0 not null, expenses decimal(12,2) default 0 not null); create function account_balance(id integer) returns balances $$ select sum(case when t.amount > 0 t.amount else 0 end) rents, sum(case when t.amount < 0 t.amount else 0 end) expenses transactions t t.account_id = $1 $$ language 'sql'; create function tenant_balance(id integer) returns balances $$ select sum(case when t.amount > 0 t.amount else 0 end) rents, sum(case when t.amount < 0 t.amount else 0 end) expenses transactions t t.tenant_id = $1 $$ language 'sql'; how relate in activerecord models (in examples, account , tenant) can call account.first.balance , returns valid instance of balance? speaking of balance, how should create model?

wordpress - Officially stuck, need to convert link with the "Heavy Black Heart" unicode character across domains -

a client had sent out mass email using constant contact , links contained unicode text character "heavy black heart", available formats can seen here http://www.fileformat.info/info/unicode/char/2764/index.htm : so constant contact mail out has links similar following http://www.wordpress.com/events/❤-heart-card-event-at-kendra-scott they link 404 parsed constant contacts engine , when clicked newsletter go through constant contact , become following: http://www.wordpress/event/&#x2764;-heart-card-event-christofle-2 so... because cannot un-send newsletter , constant contact constant, i'm stuck trying convert unicode heart unicode heart, unicode heart after being parsed constant contact. things i've tried: 1.changing slug of the event/post in wordpress, wordpress not recognize html &#x2764 , ignores upon saving. 2.changing slug link of post/event a%c2%9d%c2%a4 (the hex version escaped) heart, no good, still comes out using ❤ in , sending

linux - error: could not find function install_github for R version 2.15.2 -

i'm having multiple problems r right want start asking 1 of fundamental questions. i want install github files r, reason install_github function doesn't seem exist. example, when type: install_github("devtools") i get error: not find function install_github the install_packages function worked fine. how can solve problem? to add, want ask whether there way upgrade r, since version 2.15.2 doesn't seem compatible of packages want work with. i'm using linux version 3.6.11-1 redhat 4.7.2-2 fedora linux 17.0 x86-64. i checked cran website seemed have unupdated versions of r (if possible) dates way '09. love update myself old version of r. advice on too? install_github function of devtools package. have install , load devtools before using install_github : install.packages("devtools") library("devtools") install_github("youruser/yourrepo")

wxpython - Is there any Shortcut associated with key '2'(keycode=50) in Flatmenu? -

i trying develop application displaying flatmenu,toolbar , following panel.in toolbar have put textctrl. when trying enter key '2' not getting typed.i tried debug code printing keycode in log in textctrl not getting typed.apart '2' other key able enter. code import wx import os import sys import webbrowser import wx.lib.scrolledpanel scrolled import wx.lib.agw.flatmenu fm wx.log.setloglevel(0) class mainpanel(wx.panel): def __init__(self, parent): """constructor""" wx.panel.__init__(self, parent,style=wx.tab_traversal) class myframe(wx.frame): def __init__(self, parent): wx.frame.__init__(self, parent, -1, "flatmenu demo") self.toolbar = self.createtoolbar() self.textctrl = wx.textctrl( self.toolbar, wx.id_any, value='',size=(100, -1)) self.textctrl.bind(wx.evt_key_up, self.handlekeypress) self.createtoolbaritem(0,1,"c

ruby - Creating scss variable in config.rb for scss files -

how define scss variable in config.rb scss file[ compass project ] my use-case in config.rb file like a = true in style.scss use variable @if == true{ background: #fff; } @else { background: #000; } one of solution http://worldhousefinder.com/?p=124141 but not worked me. you can't/shouldn't this. precompile assets there no way of dynamically adapting changing variables. might work config.rb variable, bad pattern use , you'd have recompile assets every time change variable, defeats purpose of doing if else checks in sass. a easier approach either add class .active .inactive on elements (body). or output inline css in head things custom colors etc depending on users signed in. what trying do? sounds you'd check whether in production or development? in case like: <body class='<%= "development" if rails.env == 'development' %>'> or even <body <%= "style='background-color: r

backbone.js - How to put data in table with Underscore? -

i have question - how put data method fetch() html? cause when try that, nothing rendering! define([ "underscore", "backbone", "jquery", "pages/restaurantpage/collections/userscollection", "text!pages/restaurantpage/templates/userstable.html" ], function(_, backbone, $, userscollection, userstable) { return backbone.view.extend({ el: $('#data_table'), render: function() { = this; var users = new userscollection; users.fetch({ success: function(users) { var template = _.template($('#data_table').html(), { 'users': users.toarray() }); that.$el.html(userstable); } }); } }); }); and html file: <table alig

java - How do I tell Spring Boot which main class to use for the executable jar? -

execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.0.1.release:repackage failed: unable find single main class following candidates my project has more 1 class main method. how tell spring boot maven plugin of classes should use main class? add start class in pom: <properties> <!-- main class start executing java -jar --> <start-class>com.mycorp.starter.helloworldapplication</start-class> </properties>

python - To print only one occurrence of matching pattern using pcregrep -

is there option in pcregrep allows me print 1 occurrence of matched string pattern? came know option --match-limit. pcregrep not recognizing options. there specific version supports option. i assume --match-limit=1 prints 1 occurrence of matched pattern. you can let me know on other possible ways. executing pcregrep command python script via commands utility of python. before --match-limit, let's review 2 options almost want do. option 1. when want know if can find match in file, don't care match is, can use -l option so: pcregrep -l \d\d\d test.txt where \d\d\d pattern , test.txt contains strings. option 2. count number of matches, use pcregrep -c \d\d\d test.txt this may closest can want do. what match--limit ? --match-limit=1 does work, doesn't want do. from documentation: the --match-limit option provides means of limiting resource usage when processing patterns not going match, have large number of possibilities in se

file.getName() on a File object created in Android from a file path generated in Java produces strange results -

i have huge problem program either didn't have before or didn't notice. have submit work in 3.5 hours can me sees before then. i have java program user select files , paths of files passed android application. within android application, create new file object using path, , later on call fileobject.getname() . this produces different results depending on if java program run in ubuntu or windows. if run ubuntu android app succesfully extracts file name, if run windows android app extracts full path. i had path sent android canonical path, , i've since changed absolute path because wasn't sure if causing issue. hasn't resolved problem. issue result of creating file object within android using windows path? thought wouldn't matter guess wrong. if me within next couple of hours might save degree, because important project , have had submit report not mention issue have encountered, can't explain more have fix it. for clarification, if select file i

java - Android Title overlay's actionbar content -

i have application uses localisation , in of languages, title long size of screen. want scale title if doesn't fit correctly in space has smaller font size. use custom xml file title bar cannot figure out how scale font size depending on if fits or not. looking this, seems need lot of code quite small feature, can me resolve please! custom title: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/title_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/title_gradient" android:orientation="vertical" android:tag="title" > <textview android:id="@+id/title_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerinparent="true" android:grav

xml - XSLT - how to group output by common child element value in XSLT 2.0 -

i have xml file below may have multiple records common child element so: <person> <name>alice</name> <account>001</account> </person> <person> <name>alice</name> <account>002</account> </person> how transform below using xslt 2.0? <person> <name>alice</name> <account>001,002</account> </person> i'm new xslt please excuse potentially novice question. guidance appreciated here. in advance. you can use for-each-group group person elements, , separator attribute on value-of build comma-separated value: <xsl:for-each-group select="person" group-by="name"> <person> <xsl:sequence select="name" /><!-- copy name element --> <account> <xsl:value-of select="current-group()/account" separator="," /> </account> </person> </xsl:fo

ios - UITableView shows wrong cell contents -

i've stucked uitableview , adding cells. i have chat-app based on uitableview displaying messages. works fine when user opens chat old messages. when user adds new message - cell message populated wrong content. i use custom cell displaying messages.here code (simplified): - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { // im using storyboard, don't need if (!cell) part rightmessagecell *cell = (rightmessagecell *) [self.messagetableview dequeuereusablecellwithidentifier:@"right_text_message"]; [self configurecell:cell forindexpath:indexpath]; return cell; } - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { [self configurecell:self.offscreencell forindexpath:indexpath]; [self.offscreencell setneedslayout]; [self.offscreencell layoutifneeded]; result = [self.offscreencell.contentview systemlayoutsizefittingsize:uilayo

c# - Why are ASCII values of a byte different when cast as Int32? -

i'm in process of creating program scrub extended ascii characters text documents. i'm trying understand how c# interpreting different character sets , codes, , noticing oddities. consider: namespace asciitest { class program { static void main(string[] args) { string value = "slide™1½”c4®"; byte[] asciivalue = encoding.ascii.getbytes(value); // byte array char[] array = value.tochararray(); // char array console.writeline("char\tbyte\tint32"); (int = 0; < array.length; i++) { char letter = array[i]; byte bytevalue = asciivalue[i]; int32 int32value = array[i]; // console.writeline("{0}\t{1}\t{2}", letter, bytevalue, int32value); } console.readline(); } } } output program char byte int32 s

android - Logcat doesn't show & phone crashes -

so, using android studio vor developing android app. the first problem when debug app on phone , crashes (no matter reason is) don't error message, frozen phone doesn't work , have force-restart it. idea why happening? second problem logcat doesn't show in logs while debug on phone don't know caused crash. on emulator have no crashes, don't have google play services there either (that's want test , think causes unknown crash). thx

ios - GLKMathProject gives me estrange numbers -

i can not screen coordinates, big numbers when use code below, can tell me why, position of x, y in radians, wrong ? float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height); glkmatrix4 projectionmatrix = glkmatrix4makeperspective(glkmathdegreestoradians(_overture), aspect, 0.1f, 400.0f); projectionmatrix = glkmatrix4rotate(projectionmatrix, es_pi, 1.0f, 0.0f, 0.0f); glkmatrix4 modelviewmatrix = glkmatrix4identity; modelviewmatrix = glkmatrix4scale(modelviewmatrix, 300.0, 300.0, 300.0); modelviewmatrix = glkmatrix4rotatex(modelviewmatrix, 0.296706); modelviewmatrix = glkmatrix4rotatey(modelviewmatrix, -0.858702); _modelviewprojectionmatrix = glkmatrix4multiply(projectionmatrix, modelviewmatrix); cgsize viewsize = self.view.bounds.size; int viewport[4]; viewport[0] = 0; viewport[1] = 0;

c++ - error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'void' (or there is no acceptable conversion) -

i'm not sure problem is. gives me error: error c2679: binary '<<' : no operator found takes right-hand operand of type 'void' (or there no acceptable conversion) overloaded << shouldn't giving me error, right? #ifndef animal_h_ #define animal_h_ #include <iostream> #include <string> using namespace std; static int counter; static int getanimalcount() { return counter; } class animal { protected: string *animaltype; public: virtual void talk() = 0; virtual void move() = 0; string getanimaltype() { return *animaltype; } //problem right here v friend ostream& operator<<(ostream&out, animal& animal) { return out << animal.getanimaltype() << animal.talk() << ", " << animal.move(); }; ~animal() { counter--; animaltype = null; } }; class reptile : public animal {

php - Within a product loop, get posts associated with custom taxonomy terms and current product -

i'm working woocommerce in wordpress. i've got 3 products (called "kits") , each kit contains several items. "items" custom post type linked each kit via relationship field. each item has custom taxonomy attached ("departments"). departments have no direct link products (or "kits"), except via items. when display products, want them show <ul> loops through each term found in department. within <li> , have nested <ul> lists each item found in current department , in current product. i've got loop that's working display items associated each product: <a href="#details<?php the_id(); ?>" class="details button" data-id = "<?php the_id() ?>">details</a> <div class="items" id="details<?php the_id(); ?>"> <?php $items = get_field('kit_items');?> <?php if( $items ): ?> <ul>

jquery - Custom Marker for JQPLOT -

Image
is there way add multiple different effects marker? i know there's line, color , shadow properties, me try create following design, i've been failing past 2 hours , have come absolutely nothing! seriesdefaults: { linewidth: 50, color: 'yellow', markerrenderer: $.jqplot.markerrenderer, markeroptions: { show: true, style: 'circle', color: 'white', linewidth: 4, size: 25, shadow: true, shadowangle: 0, shadowoffset: 0, shadowdepth: 1, shadowalpha: 0.07 } } i feel need following attributes: markerbackgroundcolor, markershadowsize achieve result. is there can css3? create own html marker , style that? i tried using markeroptions properties did , failed. therefore wrote own shaperenderer , used instead of default jqplot 1 draw both semi-transparent outer circle , inner marker circle. end result looks this: i've done quick , dirty

angularjs - Angular JS Cross Domain Issue -

i using angularjs $resource data using jsonp. app.controller('hello', ['$scope', 'phone', function($scope, phone,$http) { $scope.data=phone.query(); }]); mycallback = function(data,$scope){ alert(data.found); }; app.factory('phone', ['$resource',function($resource){ return $resource('http://public-api.wordpress.com/rest/v1/sites/wtmpeachtest.wordpress.com/posts?callback=mycallback', {}, { query: { method:'jsonp', params:{}, isarray:false, callback: 'json_callback' } }); }]); the error console shows "uncaught syntaxerror: unexpected token :". please let me know, how best can handle jsonp data. you have include $scope in factory before accessing it. app.factory('phone', ['$resource','$scope',function($resource,$scope){} ]);

Nesting Ruby gems inside a Rails project -

how create gem project nested inside current rails project? i've got rails project several parts gems. extract these parts gems not leave current rails project. creating new source control repos gems add additional complexity project or organization not ready or able handle. these complexities overcome @ point , ready. so far can think of these items. relocate code single directory root. i'm guessing in vendor path create <something>.gemspec link gem in gemfile of rails app gem 'my_lib_code', path: 'vendor/my_lib_code' what else need do? i'm sure i'm missing important. if c project create shared library make process spits out. or if c# project make .dll . java would... i'm sure ruby can same other languages. half way step between extracted gem , code siting in lib path. this fine approach component-based architecture. you have single repository, single test suite, , single deployment process, while @ same t

asp.net - Ajax tool kit Calendar Extender Limit Year selection -

i using ajax tool kit calendar extender control, want limit year selection 1900 current year only. have seen here year limit use startdate , enddate when in code behind writing calendarext.startdate its giving error 'ajaxcontroltoolkit.calendarextender' not contain definition 'startdate' , no extension method 'startdate' accepting first argument of type 'ajaxcontroltoolkit.calendarextender' found (are missing using directive or assembly reference?) even in designer checked in properties window,there no such property exists control try getting new version of ajax control toolkit..the start , enddate properties introduced in releases after september 2011 ..i have getting both start date , end date properties on calendar extender..

php manipulation of one data simple basic php code execution -

i have solve assignment question touches on simple basic php codings learnt in class far..the question goes: arithmetic-assignment operators perform arithmetic operation on variable @ same time assigning new value. write script reproduce output below. manipulate 1 variable using no simple arithmetic operators produce values given in statements. hint: in script each statement ends "value $variable." output: value 8. add 2. value 10. subtract 4. value 6. multiply 5. value 30. divide 3. value 10. increment value one. value 11. decrement value one. value 10. do guys think question telling me use arrays?? coz i'm gonna take swing @ , assume arrays question wants me write.. here sample answer. hope guys check out , see if answer meets question's needs: <?php $numbers=array("8","10","6","30","11"); echo "value {$numbers[0]}.<br>"; echo "add 2. value {$numbers[1]}.<br

javascript - Pattern match check -

this question has answer here: how check whether string contains substring in javascript? 48 answers how search "completed" in string "test1|completed" is there reular expression can used slove problem. used spilt function you don't need regex here. use string.prototype.indexof function, this "test1|completed".indexof("completed") !== -1 the indexof function return starting index of string being searched in original string. if not found, returns -1 . so, if result of indexof not equal -1 , string being searched there in original string. note: in next version of javascript (ecmascript 6), there function called contains in string objects , can use them this var str = "to be, or not be, question."; console.log(str.contains("to be")); // true console.log(str.contains("que

apache pig - Pig If Else semantics -

i have like a = load 'input-1'; b = load 'input-2'; c = union a,b; where input-1 directory , may empty. whenever empty, union throws exception null. union 1 operation here, other operation join $0, b $0, etc. is possible check nullness of "a" in pig, before using sub sequent operation ? you need pre-process inputs using split function. there no if/else semantics in pig, unfortunately. a = load 'input-1'; b = load 'input-2'; split a_clean if ($0 not null), a_dirty if ($0 null); split b b_clean if ($0 not null), b_dirty if ($0 null); c = union a_clean, b_clean;

Modelling a forum with Neo4j -

i need model forum neo4j. have "forums" nodes have messages and, optionally, these messages have replies: forum-->message-->reply the cypher query using retrieve messages of forum , replies is: start forum=node({forumid}) match forum-[*1..]->msg (msg.parent=0 , msg.ts<={ts} or msg.parent<>0) return msg order msg.ts desc limit 10 this query retrieves messages time<=ts , replies (a message has parent=0 , reply has parent<>0) my problem need retrieve pages of 10 messages (limit 10) independently of number or replies. for example, if had 20 messages , first 1 100 replies, return 10 rows: first message , 9 replies need first 10 messages , 100 replies of first one. how can limit result based on number of messages , not replies? the ts property indexed, query efficient when mixing other clauses? do know better way model kind of forum neo? supposing switch labels , avoid ids (as can recycled , therefore not stable identifiers)

php - Get Max of AVG in Symfony 2.4 Doctrine -

i need max of list of avg in symfony doctrine my doctrine query average follows : select p,avg(p.pathtime) avgtime shopperanalyticsentitybundle:path p join p.shopper sh join p.floor f join f.store s p.floor=".$floorid." ".$filter." group p.xpath, p.ypath to max of list of averages modified (after referring this ): select max(avgtime) maxtime (select p,avg(p.pathtime) avgtime shopperanalyticsentitybundle:path p join p.shopper sh join p.floor f join f.store s p.floor=".$floorid." ".$filter." group p.xpath, p.ypath) i following error: [semantical error] line 0, col 38 near '(select p,avg(p.pathtime)': error: class '(' not defined so switched native sql same result: $maxsql = "select max(t.avgtime) maxtime ( select avg(p.path_time) avgtime path p join shopper sh join floor f join store s p.floor_id=".$floorid." ".$filter." group p.x_p

c# - FormsAuthentication.RedirectFromLoginPage works but Response.Redirect fails -

i'm using formsauthentication manage login.i set cookie userdata need. formsauthenticationticket authticket = new formsauthenticationticket(1, txtusername.text, datetime.now, datetime.now.addmonths(1), false, roles, formsauthentication.formscookiepath); string encryptedticket = formsauthentication.encrypt(authticket); httpcookie authcookie =new httpcookie(formsauthentication.formscookiename, encryptedticket); authcookie.expires = datetime.now.addmonths(1); response.cookies.add(authcookie); //doesn't work //string url = formsauthentication.getredirecturl(txtusername.text, false); //response.redirect(url, false); formsauthentication.redirectfromloginpage(txtusername.text, false); using formsauthentication.redirectfromloginpage redirects correctly sets it's own cookie empty userdata overwriting mine, while response.redirect

html5 - Windows phone 8 Viewport in update 3 includes system tray -

i have app windows pone 8 phonegap , designed in html5, has fixed footer in , system tray visible. @ first when phone (lumia 820) had windows phone 8 update 1 footer show normally. updated phone windows phone 8 update 3 has changes in ie, fixed footer displaced few pixel below , looks cut off. if hide system tray page suggested in here footer works normally. but here system tray not accessible, how can achieve viewport works see system tray? according this there cordova-plugin handle statusbar correctly.

PHP Send file in HTML form to mail -

i want send 2 files attached email using html form. mail send 2 files can't see files when download (size: 0 ko). cant me please? here code of php file: $boundary = "-----=".md5(uniqid(rand())); $header = "mime-version: 1.0\r\n"; $header .= "content-type: multipart/mixed; boundary=\"$boundary\"\r\n"; $header .= "\r\n"; $msg = "je vous informe que ceci est un message au format mime 1.0 multipart/mixed.\r\n"; $msg .= "--$boundary\r\n"; $msg .= "content-type: text/plain; charset=\"iso-8859-1\"\r\n"; $msg .= "content-transfer-encoding:8bit\r\n"; $msg .= "\r\n"; $msg .= "ceci est un mail avec 2 fichiers joints\r\n"; $msg .= "\r\n"; $file = $_files['icone']['name']; $fp = fopen($file, "rb"); // le b c'est pour les windowsiens $attachment = fread($fp, filesize($file)); fclose($fp); $attachment = chunk_split(base64_

nopcommerce - How should I add new table from plugin -

i have made new plugin name nop.plugin.mostviewproduct.product , want know how should insert new table plugin's model file? model file path : nopcommerce_3.20_source\plugins\nop.plugin.mostviewproduct.product\models please advise! :) .. if created new entity plugin plugin must install , update database let plugin project .. have : 1- create entity in domain folder (for example) 2- create entitymap in data folder (for example) 3- create pluginobjectcontext in data folder (for example) 4- create efstartuptask in data folder (for example) as example: 1- create entity public partial class mostviewedproduct : baseentity { /// <summary> /// gets or sets name /// </summary> public string name { get; set; } } 2- create entitymap public partial class mostviewedproductmap : entitytypeconfiguration<mostviewedproduct> { public mostviewedproductmap() { this.totable("mostviewedproduct"); this.haskey