Posts

Showing posts from March, 2013

java - Android appcompat v7 error -

Image
being new android developent followed simplest of tutorials, built new android project, accepting default settings (built kitkat). dismay have un-planned project - appcompat_v7 , along errors: the container 'android dependencies' references non existing library 'c:\users...\workspace\appcompat_v7\bin\appcompat_v7.jar' and twice following the project cannot built until build path errors resolved is there quick way fix these? sign of how difficult, , bugged unpleasant surprises learning android going be? (hope not similar learning ios 6 years ago...) the appcompat_v7 library added default in eclipse android project. need demo projects start making. to correctly add library, follow these steps for android studio: 1. ensure have android support repository installed in sdk manager : 2. in build.gradle file, include following compile statement compile 'com.android.support:appcompat-v7:+' in dependency bracket. 3

c++ - Qt qml - how to use component in its definition? -

i have implement treeview in qml . because each subtree treeview itself, want use treeview component in treeview definition (this repeater on end). this part of code reference component defining. you can see rootdelegate id of component . problem qt gives error unable assign qquickrow qqmlcomponent repeater { model: childrens delegate: rootdelegate } treeview.qml import qtquick 2.0 component { id: rootdelegate column { row { id: itemcontrol spacing: 2 rectangle { anchors.verticalcenter: parent.verticalcenter gradient: gradient { gradientstop { position: 0.0; color: "#eeeeee" } gradientstop { position: 1.0; color: "#404040" } } width: openchar.implicitwidth height: openchar.implicitheight - 6 radius: 3 mousearea {

multithreading - vb.net delegates don't seem to be working -

in vb.net, trying use delegates update control on form thread, doesn't change on form. i've confirmed is,in fact, receiving data(so it's not blank), reason won't send data control. delegate sub fupdatedelegate(byval itemtoadd string) dim myupdate fupdatedelegate = addressof updatefrmlist private sub updatefrmlist(byval itemtoadd string) form1.listbox1.items .add(itemtoadd) end msgbox(itemtoadd) end sub and called as if form1.listbox1.invokerequired form1.listbox1.begininvoke(myupdate) end if how can make adds items listbox ? (this being run module) try modifying sub deal invoke. call item add. private sub updatefrmlist(byval itemtoadd string) if me.invokerequired me.begininvoke(myupdate, itemtoadd) else listbox1.items .add(itemtoadd) end ' msgbox(itemtoadd) end if end sub all calls updatefrmlist(somestring)

n2o Erlang framework email authentication -

i'm new erlang , n2o have experience in python web development. want create authentication email address (email - password) in application instead of using avz. i've created sign page code (other code n2o_sample). instead of putting user kvs have {error, no_container} -module(signup_page). -compile(export_all). -include_lib("n2o/include/wf.hrl"). -include_lib("n2o_sample/include/users.hrl"). title() -> [ <<"sign page">> ]. main() -> #dtl{file = "login", app = n2o_sample, bindings = [{title,title()},{body,body()}]}. body() -> [ #span{id=display}, #br{}, #span{body="email: "}, #textbox{id=user}, #br{}, #span{body="password: "}, #password{id=pass}, #br{}, #span{body="confirm password"}, #password{id=confirm}, #br{}, #button{id=signup, body="sign up", postback=signup,source=[user,pass,confirm]}]. event(signup) ->

php - When to store data to memcached -

i storing result of each query memcached , give expired long time let 1 year. create each crud create, update, delete operation re-cache each request. in other words use memcached first layer , database second layer provide data. am using memcached right way or memcached temporary storage? in other words don't store each result of query long time because bigger later.

Swift CMutablePointers in factories e.g. NewMusicSequence -

how use c level factory methods in swift? let's try using factory such newmusicsequence(). var status:osstatus var sequence:musicsequence status=newmusicsequence(&sequence) this errors out "error: variable 'sequence' passed reference before being initialized". set sequence nil, , exc_bad_instruction. you can try being explicit this: var sp:cmutablepointer<musicsequence>=nil status=newmusicsequence(sp) but bad access exception when set sp nil. if don't set sp, "error: variable 'sp' used before being initialized" i'd expect way it, it's not: import audiotoolbox var sequence: musicsequence? var status:osstatus = newmusicsequence(&sequence) error: cannot convert expression's type 'osstatus' type 'inout musicsequence?' var status:osstatus = newmusicsequence(&sequence) here's reference . i think issue need optional value. optional values initialized nil , optional v

c# - ReadInt32 vs. ReadUInt32 -

i tinkering ip packet 'parsers' when noticed odd. when came parsing ip addresses, in c# private uint srcaddress; // stuff srcaddress = (uint)(binaryreader.readint32()); does trick, you'd think vb.net equivallent private srcaddress uinteger '' stuff srcaddress = cuint(binaryreader.readint32()) would trick too. doesn't. : srcaddress = reader.readuint32() however will. took time discover, have dicovered -- if ? why ? vb.net, default, c# doesn't default. check numerical overflow. , will trigger in code, ip addresses last bit 1 instead of 0 produce negative number , cannot converted uinteger. data type can store positive 32-bit numbers. c# has option too, you'd have explicitly use checked keyword in code. or use same option vb.net projects have turned on default: project + properties, build tab, advanced, tick "check arithmetic overflow/underflow" checkbox. same option in vb.net project named "remove integ

local - Chromium DocumentRoot browsing file:// -

i'm looking way set documentroot while browsing local file:// sites. situation: have copy of web server on local machine , sync via rsync server. i'm looking way check these site (while offline, can't sync them) without installing local web server. can open files, links beginning @ documentroot broken. i'm looking for: switch "chromium --doc-root=/home/user/website/http/" or similar perfect. there this? help. afaik, don't think chromium provides such options specify document root file scheme, obey file uri scheme ( http://en.wikipedia.org/wiki/file_uri_scheme ). for case, think it's better use simple http server (e.g. if have python, use simplehttpserver ). ff file scheme used, still have append --allow-file-access-from-files avoid permission restrictions.

rtos - what kind of scheduler does FreeRTOS use? -

what kind of scheduler freertos use.. read somewhere run complete scheduler, on other hand, i've seen being used parallel tasks, wouldn't round robin scheduler?? highest priority task granted cpu time. if multiple tasks have equal priority, uses round-robin scheduling among them. lower priority tasks must wait. it important high priority tasks don't execute 100% of time, because lower priority tasks never cpu time. it's fundamental problem of real-time programming. usually want assign high priority task must react fast important event, perform quick action , go sleep, letting less important stuff work in meantime. generic example of such sustem may be: highest priority - device drivers tasks (valve control, adc, dac, etc) medium prio - administrative subsystem (console task, telnet task) lower priority - several application tasks (www server, data processing, etc) lowest priority given general applications, scheduled using round-robin, gives

c - Currency conversion database structure from text file -

i've been working on program data structure reads in file of different currencies, call use conversion. i've been running on days on end , tried fgets , fscanfs , , such, , i'm lost @ point pretty new programming. the dat. file outlined on separate lines this: dollar 1.00 yen 0.0078 franc 0.20 mark 0.68 pound 1.96 my code far: typedef struct { string currency; double rate; } currencyt; typedef struct { currencyt cur[maxcurrencytypes]; int ncurrency; } *currencydb; static currencydb readdatabase(void); static readoneline(file *infile, currencydb db); static currencydb readdatabase(void) { file *infile; currencydb db; int ncurrency; db = new(currencydb); infile = fopen(exchangefile, "r"); while (readoneline(infile, db)); fclose(infile); return(db); } static readoneline(file *infile, currencydb db) { currencyt cur; char termch, currency; double rate; int nscan, ncur

css - Going from 2 to 3 columns when expanding the width of screen -

when screen expands past width i'd add column unordered list items, 2 columns 3 columns. i'm not sure how this? bootstrap seems has solution i've never used it. here jsfiddle: http://jsfiddle.net/en9qm/ the html <div class="sidebar"> <div class="search-filters">filters</div> <div class="search-results"> <div class="listings"> <ul> <li>hello</li> <li>byebye</li> <li>chuck</li> <li>paul</li> </ul> </div> <div class="listings-footer"></div> </div> </div> the css .sidebar { position: fixed; top: 47px; right: 0; bottom: 0; width: 60 % ; overflow - y: scroll; /*-webkit-overflow-scrolling: touch; background: #f7f7f7;*/ background - color: aqua; /*border: 3px solid black;*/ } .s

listview - Deleting an entry from list and inserting into another one. Android -

if there 2 lists in same view, how can move entry in 1 list other on click. made listviews , made adapters both of them. 1 list pending connection , other approved connections. each entry in pending connections has accept , reject button. on rejecting entry should deleted. part. kept override function in adapter of pending list connection reject button. on accept have insert same entry accepted list. not able because adapters of both listviews different , dont know how access them activity.java file. can 1 please me? in advance. <textview android:id="@+id/pendingheading" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="pending connections" android:textsize="25sp" android:textstyle="bold" android:padding="10dip" /> <listview android:id="@+id/pendingconnectionslist" android:layout_width="match_parent" andr

asp.net mvc 4 - How to get current controller name with jquery? -

i want active menu item in mvc jquery. <ul id="menunav" class="nav nav-pills"> <li> <a href="/reportgenerator/index">reports</a> </li> <li> <a href="/account/roles">user groups</a> </li> <li> <a href="/projectstatedefinition/index">projects</a> </li> </ul> i created menu @html.navigation() . i want current controller in jquery add active class selected menu. highlightactivemenuitem = function () { var currentaction = ???; var currentcontroller = ???; }; try <script type="text/javascript"> function currntcontrol(){ alert('@httpcontext.current.request.requestcontext.routedata.values["controller"].tostring()'); } </script> <button onclick="currntcontrol()"></button>

javascript - Jquery Validation check username with remote -

i using validation plugin , laravel 4.2. try check username via ajax, can't work. username can taken, doesn't matter if exists or not. my second issue if using validation rule remote, can't submit form. does know doing wrong? because in chrome log fine, request sent , can see debug messages. php <?php use app\models\user; class validationcontroller extends basecontroller { public function getcheckusername() { if(request::ajax()) { $user = user::where('username', input::get('username'))->get(); if($user->count()) { return response::json(array('msg' => 'true')); } return response::json(array('msg' => 'false')); } } } js $(document).ready(function() { $("form").validate({ rules: { username: { required: true, rangelength:[3,255], remote: { url:"http://"

java - Bx2D body Sprite synch -

Image
seeing how box2d bodies cannot resized, have problem bodies , animated sprites. here's situation have no doubt not unique: sprite's dimensions change during different motions attacking, walking, jumping. seeing how use box2d body collision detection can cause quite problem. far thought of 3 ways solve issue. 1- not use box2d bodies collision detection , use them object's physical behavior 2- delete , recreate body before each render. or on animation change. 3- trying recheck collision on bodies see if collides sprite itself. act. and here's problem have each of these solutions. 1- way makes using box2d whole seem rather absurd, i'll using not one, 2 world logic , trying keep them in sync. seems big headache. 2- doesn't optimized, doubt can make objects pop in , out of existence in physics world without side effects. 3- i'm not sure how or if can done, option 1 require more advice on. cause difficulties in long run, or cause conflicts in p

python - Replace an item in a list based on user input -

i'm noob please excuse me. there 3 lists a list of letters l = ['a','b','c','d','e'] a list of numbers n = ['1','2','3','4','5'] a list of number strings list = ['124','351'] these steps wish achieve request letter user e.g. a find letter in letter list l , record numerical position e.g. [0] use same numeric position in list of numbers n , record number that's there e.g. 1 replace instances of number found in non-letter strings list e.g. ['124','351'] becomes ['a24','35a'] ask user next letter until number strings become letters. what have achieved far first 4 steps. after step 4 thought check if number strings still contained numbers , if go step 5. can't seem work out how code check if number strings contain more number. note: number list not limited numbers. contain math symbols e.g. + or - l = ['a','b

python - Resizing QPixmap while maintaining aspect ratio -

to keep aspect ratio of image fixed while resizing qdialog i've tried following: import os, sys pyqt5.qtwidgets import qapplication, qdialog, qgridlayout, qlabel pyqt5.qtgui import qpixmap pyqt5.qtcore import qt class dialog(qdialog): def __init__(self, parent=none): super(dialog, self).__init__(parent) self.pic = qlabel() self.pic.resizeevent = onresize self.pic.setpixmap(qpixmap(os.getcwd() + "/images/1.jpg").scaled(300, 200, qt.keepaspectratio,qt.smoothtransformation)) layout = qgridlayout() layout.addwidget(self.pic, 1, 0) self.setlayout(layout) def onresize(event): size = dialog.pic.size() dialog.pic.setpixmap(qpixmap(os.getcwd() + "/images/1.jpg").scaled(size, qt.keepaspectratio, qt.smoothtransformation)) if __name__ == '__main__': app = qapplication(sys.argv) dialog = dialog() dialog.show() sys.exit(app.exec_()) as espected image starts 300x200. ca

javascript - Protecting routes with authentication in an AngularJS app -

some of angularjs routes pages require user authenticated api. in cases, i'd user redirected login page can authenticate. example, if guest accesses /account/settings , should redirected login form. from brainstorming came listening $locationchangestart event , if it's location requires authentication redirect user login form. can simple enough in applications run() event: .run(['$rootscope', function($rootscope) { $rootscope.$on('$locationchangestart', function(event) { // decide if location required authenticated user , redirect appropriately }); }]); the next step keeping list of applications routes require authentication, tried adding them parameters $routeprovider : $routeprovider.when('/account/settings', {templateurl: '/partials/account/settings.html', controller: 'accountsettingctrl', requiresauthentication: true}); but don't see way requiresauthentication key within $locationchangestart event

Rails 2.3.5 applications on Ruby 1.8.7 Rake Error. -

i trying install rails 2.3 gem on fedora server. application not having gemfile in it. requires oauth2 gem. when use installation command giving following error: rake aborted! can't activate rack (>= 1.1.0, < 2, runtime) ["faraday-0.5.7", "oauth2-0.1.0"], activated rack-1.0.1 ["actionpack-2.3.5", "rails-2.3.5"] is there way find required gems rails 2.3.5 gem?

PowerShell Path Parameter Invoke-Command (UnauthorizedAccessException) -

when running simple script receiving error message: + categoryinfo : openerror: (:) [import-csv], unauthorizedaccessexception + fullyqualifiederrorid : fileopenfailure,microsoft.powershell.commands.importcsvcommand param( [string]$path, [string]$credential ) invoke-command –cn dc –credential $credential -argumentlist $path –scriptblock ` {import-csv -path $args[0] | select-object –property ` @{name='identity';expression={$_.username}},@{name='fax';expression={$_.'fax number'}} ` | foreach{set-aduser -identity $_.identity -fax $_.fax -confirm:$false}} any idea why may happening? have correct permissions the path using. i found issue , because not including csv file in path. pointing c:\files\csv instead of c:\files\csv\fax-users.csv.

python 3.3 list error-SPRITES -

this game right reason keep getting python game.py", line 319, in <module> blocks_hit_list = pygame.sprite.spritecollide(player, block_list, true) file "c:\python33\lib\site-packages\pygame\sprite.py", line 1515, in spritecollide if spritecollide(s.rect): attributeerror: 'rocket' object has no attribute 'rect' error. have no idea why , ive tried alot of stuff work. this stupid thing keeps saying have code wrote sentance take room import pygame import random """ global constants """ # colors black = ( 0, 0, 0) white = ( 255, 255, 255) blue = ( 0, 0, 255) black = [ 0, 0, 0] white = [255, 255, 255] black = [ 0,0,0] white=[255,255,255] green = ( 0, 255, 0) red = ( 255, 0, 0) blue = ( 0, 0, 255) lightblue= ( 0, 255, 255) brown =( 97, 66, 12) yellow =(232,232,74) grey=(148,148,148) purple=(124,102,196) yellow2 =(252,252,0) yellow3 =(252,25

Python argv issue -

#python 3.0 sys import argv script, user_name = argv prompt = "> " print("hi %s, i'm %s script." % (user_name,script)) print("i ask few questions.") print("do me %s?" % user_name) likes = input(prompt) print("where live %s?" % user_name) lives = input(prompt) print("what kind of computer have?") computer = input(prompt) print(""" alright said %r liking me. live in %r. not sure is. , have %r computer. nice. """ % (likes, lives, computer) ) i getting following error: script, user_name = argv valueerror: need more 1 value unpack please help try len(argv) to see how many elements argv has. problem there mismatch between number of elements in argv , number of variables you're trying assign to. here simplified case of problem: >>> one, 2 = [1] # cannot this! valueerror: need more 1 value unpack >>> one, 2 = [1, 2] # ok! to fix this, mak

c# - Need to aceess master layout controls from a view in MVC -

i have mvc web application master layout , views based on layout.and need display text in label in master layout. and javascript function in child view. here master page. <body onload="setinterval('layouthandler.diplayclock()', 1000);"> <div id="notify"> @html.label("hi", new { id="lblnotify"}) </div> </body and here javascript function in view.. getcustomerdetails: function (customerphonenumber) { $("#lblnotify").val("calling"); }, don't mind javascript function, call function fires signalr.and works fine.the issue can't change text of lblnotify function. identifies lable object, text not changing... how can slove this??? label rendered in html as: <label id="lblnotify">hi</label> and changing text between tags, need use text() : $("#lblnotify").text("

c# - How can I easily create a case (switch case) for all enum items? -

often using switch-case, , creating case enum items. is there shortcut (it may resharper shortcut) creates cases automatically , let me fill cases? or question related code-snippet subject? possible create dynamic code-snippet (it vary according enum type) ? set cursor after first brace within switch statement , press alt + enter. see option generate switch labels.

Rails 4.1 and Thinking Sphinx - undefined method 'parent' for ActiveRecord::Associations::JoinDependency::JoinAssociation -

i started upgrade rails 4.0 app rails 4.1 . app uses lot of gems , thinking sphinx 1 of them. have reinstalled thinking-sphinx gem after rails 4.1 upgrade (to enable proper version of joiner, 3.0 now). weird error ts when try, example, rebuild index: $ rake ts:rebuild --trace ** invoke ts:rebuild (first_time) ** invoke ts:stop (first_time) ** invoke environment (first_time) ** execute environment ** execute ts:stop searchd not running. stopped searchd daemon (pid: ). ** invoke ts:index (first_time) ** invoke environment ** execute ts:index generating configuration /users/serj/projects/project/config/development.sphinx.conf rake aborted! nomethoderror: undefined method `parent' #<activerecord::associations::joindependency::joinassociation:0x007ff438543678> /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/thinking-sphinx-3.1.1/lib/thinking_sphinx/active_record/filtered_reflection.rb:40:in `block in scope' /users/serj/.rvm/gems/ruby-2.0.0-p353@project/gems/activer

ios - No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7, VALID_ARCHS=armv6 i386) -

Image
i getting error while building ios app. no architectures compile ( only_active_arch=yes, active arch=armv7, valid_archs=armv6 i386 ). i followings errors while trying use _acaccounttypeidentifiertwitter: undefined symbols architecture armv7s: "_acaccounttypeidentifiertwitter", referenced from: -[clshomepageviewcontroller twitterlogin:] in clshomepageviewcontroller.o "_objc_class_$_acaccountstore", referenced from: objc-class-ref in clshomepageviewcontroller.o ld: symbol(s) not found architecture armv7s clang: error: linker command failed exit code 1 (use -v see invocation) and architecture settings follows: architectures: standard architectures (including 64-bit) (armv7,armv7s,armv64) base sdk: latest ios (ios 7.0) build active architecture only: no valid architectures: arm64 armv7s armv7 go project, open project (not target) -> build settings , set build active architecture only no :

caching - APC with TYPO3: high fragmentation over time -

using apcu typo3 6.2 extensively, high fragmentation of cache on time. had values of 99% smaller shm_size. in case typo3 admin, switched caches cache_pagesection , cache_hash , cache_pages (currently testing purposes moved db again), cache_rootline , extbase_reflection , extbase_opject other extension caches apc backend. switching cache_hash away db sped menu rendering times dramatically ( https://forge.typo3.org/issues/57953 ) 1) apc fragmentation matter @ or should watch out never runs out of memory? 2) typo3 admins: happen have idea tables cause fragmentation , bit in apcu.ini configuration relevant usage typo3? i tried using apc.stat = 0 , apc.user_ttl = 0 , apc.ttl = 0 (as in t3 caching guide http://docs.typo3.org/typo3cms/coreapireference/cachingframework/frontendsbackends/index.html#caching-backend-apc ) , increase shm_size (currently @ 512m around 100m used). shm_size job @ reducing fragmentation, i'd rather have smaller full cache large 1 unused. 3)

C# Dictionary change notification (INotifyCollectionChanged) -

i have loop running retrieving live share prices. want check if of prices retrieved different price have stored in dictionary , notify me details of have changed. looking along lines of dictionary utilising inotifycollectionchanged. e.g. using system; using system.collections.generic; using system.collections.specialized; using system.linq; namespace basicexamples { class collectionnotify:inotifycollectionchanged { public dictionary<string, string> notifydictionary{ get; set; } public collectionnotify() { notifydictionary = new dictionary<string, string>(); } public event notifycollectionchangedeventhandler collectionchanged; protected virtual void oncollectionchanged(notifycollectionchangedeventargs e) { if (collectionchanged != null) { collectionchanged(this, e); } } public void add(object k, object v) {

javascript - jQuery autocomplete validation -

i using jquery autocomplete list of 800 values j$(function() { var availabletags = [item1,item2, item3,...]; j$( "#stdcodes" ).autocomplete({ source: availabletags }); }); this works fine, want limit or validate input in 1 autocomplete values. can this? try this: $("#stdcodes").autocomplete({ open: function(e) { valid = false; }, select: function(e){ valid = true; }, close: function(e){ if (!valid) $(this).val(''); }, source: availabletags }); $("#stdcodes").change(function(){ if (availabletags.indexof($(this).val()) == -1){ $(this).val(""); } }); added validation, in case autocomplete doesn't execute fiddle: http://jsfiddle.net/ra96r/2/

create a multiple data frames from a single data frame in r -

i've got large data frame finaldata , produce bunch of other smaller data frames explanatory1, explanatory2 e.t.c.... consisting of 10 columns each finaldata i'm trying using loop throwing me error attempt apply non function for(i in 1:length(finaldata)/10) { nam <- paste("explanatory", i, sep = "") assign(nam, finaldata[,10(i):10(i)+10]) } i have tried for(i in 1:length(finaldata)/10){ assign(paste("explanatory",i,sep=""),finaldata[,10(i):10(i)+10])} but gave me same error, understand error being caused passing finaldata[,10(i):10(i)+10] argument assign, don't see why wouldn't work ina loop, or different passing finaldata[,10:10+10] any appreciated! create sample data play with: df <- data.frame(matrix(vector(), 10, 33)) find number of dataframes you're going create: number_of_dataframes <- ceiling(ncol(df) / 10) loop through dataframes, finding range of columns use creatin

how to hide the buttons in angularjs -

when user login page have show logout button. have written logout in header. how disable have tried ng-show , ng-hide. button not showing after set visibility true <button ng-show="visibility">logout</button> in controller class, setting visibility of button once user login in app $scope.visibility = true; your idea correct. see if have put inside same scope, , mainly, ng-app directive in <html> . there code of controller working? as can see here, works: http://codepen.io/anon/pen/haoxk

python - Matplotlib: how to make tight_layout independent of ticklabels -

here part of code, exports figures tight layout. ... fig.set_size_inches(8,6.8) fig.tight_layout(rect=(0, 0, 1, 0.9)) # fig.savefig(path,bbox_inches='tight',dpi=100) fig.savefig(path,dpi=100) plt.gcf().clear() plt.close(fig) ... unfortunately when looping on different frames , y axis labels changing, there frames when ticklabels getting close edge , entire plot shrinked shown in figures between red , green lines. https://dl.dropboxusercontent.com/u/248943005/montage.png i tried several cases, effect coming in 1 or way. seems make tight layout somehow independent of ticklabels. possible? if no, there alternatives?

node.js callback in a for-loop -

im trying read data , put multi-array. open different files use for-loop, because need results numbered in correct order. problem: i cant save data in 1 array. once call function read data, can use result inside function borders. how can make whole array available outside function? (pretty sure messing callbacks). in other words: trying open multiple files , save content in 1 array [[file1], [file2], ...]. here code: var einlesen = require ('./einlesen/einlesen.js'); var einzeln = function(arg, callback){ //this function use read data (it works fine, checked separately) einlesen.einlesen(arg[0], arg[1], arg[2], function(err, output){ //this function opens file, works on content , returns array containing needed data if (err) { return cb1(err); } callback(output); }); } var daten_einlesen = function (callback){ var tabellenarray = []; //initiating array in whole info should go var tabelleninfos = [ //this array contains info da

yii - The attribute must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional -

i have 2 models/mysql tables: user , truck . in truck table have row user_id , in truck _form.php created dropdownlist field user_id populating user table. code: <?php echo $form->dropdownlist($model,'user_id', chtml::listdata(user::model()->findall(), 'id', 'name')); ?> and works fine, manage list users in dropdown. when save form data should redirect me cdetailview instead error: "the attribute must specified in format of "name:type:label", "type" , "label" optional." could tell me what's causing problem, tried set relations , still error.. thanks

python - Investigating different datatypes in Pandas DataFrame -

i have 4 files want read python / pandas, files are: https://github.com/kelsey9649/cs8370group/tree/master/tafengdataset stripped away first row (column titles in chinese) in 4 files. other that, 4 files supposed have same format. now want read them , merge 1 big dataframe. tried using pars = {'sep': ';', 'header': none, 'names': ['date','customer_id','age','area','prod_class','prod_id','amount','asset','price'], 'parse_dates': [0]} df = pd.dataframe() in ('01', '02', '12', '11'): df = df.append(pd.read_csv(cfg.abspath+'d'+i,**pars)) but: file d11 gives me different format of single columns , cannot merged properly. file contains on 200k lines , cannot problem in file mentioned above, assuming has same format, there's small difference in format. what's

spring - Masking in Broadleaf Commerce -

we using broadleaf commerce 3.0.5 version. know , community version not having source code. , admin present in jar level. have requirement masking in admin user information. can respose post , can resolve issue? thanks , regards --sitakant by way, of source code ce version of broadleaf framework open source , on github @ https://github.com/broadleafcommerce/broadleafcommerce .

SmartGWT Dialog setting Height for dynamix text -

Image
here's deal, im trying create popup window uses dynamic text, when text large cap height of window , use scrollbar instead navigate through not seems working. code: final dialog dialog = new dialog(); dialog.setmessage(direttivadescription); dialog.setoverflow(overflow.auto); dialog.setwidth(600); dialog.setheight(50); dialog.seticon(someicon); dialog.setbuttons(new button("ok")); dialog.addbuttonclickhandler(new buttonclickhandler() { public void onbuttonclick(buttonclickevent event) { dialog.hide(); } }); dialog.draw(); if text large window height resized accordingly. funny part setwidth method seems working fine. you need container such hlayout , vlayout , dynamicform etc. can add message in add container in dialog . sample code: vlayout vlayout=new vlayout(); vlayout.addmember(new label(message)); vlayout.setoverflow(overflow.auto); vlayout.setwidth100(); ... dialog.additem(vlayout); dialog.draw()

css - Hover doesn't work -

hover effect doesn't work. here fiddle: http://jsfiddle.net/6wmnf/ don't know why. when remove hover , change width attribute(as example) works. hover or cursor attribute doesn't work, when used seperately. use latest google chrome version. css: #düzenleyici{ border: 1px solid #000; width: 550px; height: 300px; box-shadow: -1px 1px 4px #000; display:inline-block; position:relative; z-index:-1; } #araclar{ width:auto; height:50px; background:#aad3d4; display:inline-block; padding:5px 15px 5px 15px; border-bottom:1px solid #000; } #araclar>div{ padding:0 5px 0 5px; display:inline-block; border:1px solid #606060; margin:0 3px 5px 3px; background:#f6f6f6; font-family:calibri; } #iclik{ border: 1px solid #000; width: 100px; height: 267px; box-shadow: 1px 1px 4px

Grails launch controller's remote functions from within javascript -

i have button on gsp <button id = "select" onclick = "${remotefunction(controller: 'customer', action: 'selectbatch', params: '\'batchid=\' + selectedbatchid')}">select</button> i have javascript function on same button: $('#select').click(function () { if (selectedbatchid == undefined) { $("#errormessages p").text("click row choose batch first."); $("#errormessages p").show(); $("#errormessages p").fadeout(3000); } else { $("#choosebatch h2").text("batch id " + selectedbatchid + ": " + selectedbatchdesc); } what move button's onclick function declared in gsp code else clause of javascript function controller function doesn't launch time, when javascript else clause executed. can't seem figure out right syntax. help/tips appreciated.

numpy - Plotting Pandas DataFrames as single days on the x-axis in Python/Matplotlib -

i've got data this: col1 ;col2 2001-01-01;1 2001-01-01;2 2001-01-02;3 2001-01-03;4 2001-01-03;2 2001-01-04;2 i'm reading in python/pandas using pd.read_csv(...) dataframe. want plot col2 on y-axis , col1 on x-axis day-wise. searched lot couldn't many useful pages describing in detail. found matplotlib not support dataformat in dates stored in (datetime64). i tried converting this: fig, ax = plt.subplots() x = np.asarray(df['col1']).astype(dt.datetime) xfmt = mdates.dateformatter('%b %d') ax.xaxis.set_major_formatter(xfmt) ax.plot(x, df['col2']) plt.show() but not work. best way? can find bits there , bits there, nothing working in complete , more importantly, up-to-date ressources related functionality latest version of pandas/numpy/matplotlib. i'd interested convert absolut dates consecutive day-indices, i.e: starting day 2001-01-01 day 1 , data this: col1 ;col2 ; col3 2001-01-01;1;1 2001-01-01;2;1 2001-01-02;3;2 2

dynamic - Java Change tray icon -

hi trying change tray icon have in java dynamically. e.g icon grey square. when user clicks item in tray menu, grey square switch images red square. here current code tray icon. 'public class utils { private static image iconimage; private static image iconimage2; private static systemtray systray; private static popupmenu menu; private static menuitem item1; private static menuitem item2; private static menuitem item0; private static trayicon trayicon; private static trayicon trayicon2; public static void loadtrayicon() { jframe frame = new jframe("ac tray frame"); frame.setlayout(new gridlayout(1, 3)); if (systemtray.issupported()) { systray = systemtray.getsystemtray(); iconimage = toolkit.getdefaulttoolkit().getimage("osx_tray_icon.png"); iconimage2 = toolkit.getdefaulttoolkit().getimage("loading.gif"); menu = new popupmenu(

amazon web services - My EC2 instance has a Public IP but don't have a Public DNS -

i created new vpc called testglobal 2 subnets: opennet, closednet so created ec2 instances on subnets , can't ping them. in ec2 panel shows public ip don't shows public dns. they associated elasticips , added group traffic in/out. am doing wrong? ec2 instances in public subnet (what you've called opennet ) have public dns , public ip address. able ping them if in security group allows icmp echo requests client-side ip address. instances in private subnet ( closednet ) not have public ip addresses or public dns names. have private addresses within range of subnets. intent of private subnet - not allow direct public internet traffic. access systems in private subnets instance in public subnets, or alternatively via vpn. more specific advice require further information, screenshots of instance, subnet, route table , security group details.

kafka consumer patterns with groups -

i trying head around possible consumer patterns kafka 0.8.1.1. let's ignore replication because dont believe affects these patterns. ran command line console consumer tests. can please confirm understanding correct? 1) 1 topic, many partitions m, many consumers n, m=>n, no groups defined. in case every consumer every message on topic. 2) 1 topic, many partitions m, many consumers n m less n , no groups defined. same behavior. every consumer every message on topic. 3) 1 topic, many partitions m, many consumers n, m less n , 1 consumer group defined consumers i see "no broker partitions consumed consumer thread" on 1 of consumer consoles. is because there more consumers partitions? ( in case m=3, n=4 ) 4) 1 topic, many partitions m, many consumers n, m=n , 1 consumer group defined consumers from using kafka monitor, see each partition assigned 1 consumer now. however, seems there no parallelism in data consumption. see happening 1 con