Posts

Showing posts from September, 2011

delphi - .rep Report File - Find Report Builder -

i have old software believe done in delphi , uses .rep files reports. there way figure out report builder used? opening file in hex or text doesn't tell lot, shows quite text used within report though. thanks patrick candidates: a visual dbase file, case should ascii text, question seems rule out. a (sap) business objects report file an act! (crm software) report file a grand theft auto san andreas game replay file. since 'used report', bo best bet. acquired sap in 2007, before standalone software produced business objects ag. so need copy of open file. maybe there other ways inspect/use file, other people have faced same problem

android - Use color ints, as opposed to color resource ints, for SwipeRefreshLayout? -

i have colors dynamically generated in app, based off of user preferences. used these colors in chrisbane's actionbar-pulltorefresh library, since library no longer being developed, i'm trying move on swiperefreshlayout. however, swiperefreshlayout seems take color resource ids, opposed ints directly represent colors, , such can't find way color progress bar. there i'm missing in swiperefreshlayout allow me need do? not sure v19 support library, v20 1 has following methods: public void setcolorschemeresources(int colorres1, int colorres2, int colorres3, int colorres4) which allows set colors resource. following method exists, takes colors: public void setcolorschemecolors(int color1, int color2, int color3, int color4) the second 1 answer

Prevent System Generated Toast in Android -

i have added onprimaryclipchangedlistener() in service, detects when user copies text, , displays output toast. however in apps (e.g. gmail) when user copies test, toast message "text copied clipboard" displayed overrides toast displayed message. how can suppress other toast message? thanks you, developer, have no means of affecting toasts displayed app.

javaFX helloworld jar cannot be ran on different platform -

i new javafx stuff , not sure if knows did wrong. here scenario: on win 7, used netbeans 8 jdk1.8.0_05 created helloworld.jar on win 7, java -jar helloworld.jar works fine move helloworld.jar redhat 5.8 , used same version jdk1.8.0_05, java -jar helloworld.jar . , see following error graphics device initialization failed : es2, sw error initializing quantumrenderer: no suitable pipeline found red hat enterprise linux 5.8 not supported configuration javafx in java 8 . red hat enterprise linux 6.x (and other linux variants) supported. midorikid provides procedure allow javafx used on red hat el 5.x system in answer to: running javafx jars on redhat 5.8 . note although procedure can followed, recommended uses more recent rhel system run javafx in supported configuration.

c# - Azure Storage Client v4.1 - a value of the non-primitive type was expected -

i've upgraded asp.net project (mvc5) target azure sdk 2.3 storage library 4.1 , encountering strange error when try save table storage. error: an unhandled exception of type 'microsoft.windowsazure.storage.storageexception' occurred in microsoft.windowsazure.storage.dll additional information: primitive value specified; however, value of non-primitive type '' expected. my models go table storage via repositories use tableservicecontext add, update, delete, save. i follow pattern models: [system.data.services.common.dataservicekey(new string[] { "partitionkey", "rowkey" })] public class persistedalert : alert, itableentity { public string partitionkey { { return this.studentid; } set { this.studentid = value; } } public string rowkey { { return this.id; } set { this.id = value; } } public datetime timestamp { get; set; } public new int type { get; set; } //

swing - java radio button, updating a JLabel -

i trying make code adds or subtracts initial value presented each time click submit. have searched multiple threads on how complete , haven't come across clear. push in right direction help. package twopaneldesign; import javax.swing.jframe; import java.awt.color; import java.awt.font; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.buttongroup; import javax.swing.jpanel; import javax.swing.jradiobutton; import javax.swing.jlabel; import javax.swing.swingconstants; import javax.swing.jbutton; public class twopaneldesign extends jframe { private static final long serialversionuid = 1l; public twopaneldesign() { getcontentpane().setlayout(null); jpanel panel = new jpanel(); panel.setbounds(0, 0, 151, 262); getcontentpane().add(panel); panel.setlayout(null); final jlabel lblyourchoice = new jlabel("your choice..."); lblyourchoice.setbounds(10, 11, 172, 1

arduino - Serial communications and good software for android dev -

so teaching programming class , ran little problem. going teach serial communication between raspberry pi , arduino python, rpi died suddenly. oh well... came idea of teaching serial com btw arduino , android usb otg adapter. brilliant idea catch is, ive never programmed android extensively. know basics, need know how pass simple ascii characters through serial com. ive looked on web, none of existing tutorials ive seen accomplish this. sorry needy long post appreciate can on subject. (on side note know android ide beginners?) here site has source android usb various devices: usb-serial-for-android . from description: this driver library communication arduinos , other usb serial hardware on android, using android usb host api available on android 3.1+.

ExtJS Websocket Chat Application -

im setting mvc application extjs 4.2 has chat support client. i'm using extjs websocket , followed tutorial https://market.sencha.com/extensions/ext-ux-websocket seem work broadcast message connected client on different browsers. here codes: this.ws = ext.create('ext.ux.websocket', { url : 'ws://localhost:6966', autoreconnect : true, autoreconnectinterval : 1000, keepunsentmessages : true, listeners : { open : function(ws) { ws.send('notify', { 'message' : 'connected server!', 'id' : '123456' }); }, message : function(ws, data) { var data = ext.decode(data); console.log(data) }, close : function(ws) { var panel = ext.getcmp('

javascript - Angular ngChange not firing in firefox and safari -

i created custom directive works similar foundations custom dropdown. create div , populate ul options. interacting div interacts actual select in background. eveyrthing works great in chrome. issue when select option use jquery trigger change event select element. in chrome in turn triggers ng-change attached it. reason isn't triggered in firefox , safari. assume should work same chrome. did further testing , found change event fire, reason doesn't trigger angular fire it's ngchange method. i'm @ loss , need done a.s.a.p. , appreciated. [update] here simple code example <select ng-model="model" ng-change="changefunc()"></select> i have jquery installed directive give me $element wrapped in jquery call $element.trigger("change") in chrome in turn triggers changefunc on controller so figured out. apparetly must set selected option using: element.selectedindex = 0 // or index selected this sets selecte

css - Customized Scroll Bar doesn't appear on Internet Explorer -

Image
i created customized scroll bar in css, in google chrome scroll bar displays , style created it, in internet explorer doesn't seem appearing @ all... it's appearing default scroll bar. how can make scroll bar appear on ie well? here's jsfiddle example: http://jsfiddle.net/5wne5/ ::-webkit-scrollbar{ width:6px; border-radius:10px; } ::-webkit-scrollbar-thumb{ background-color:#b03c3f; border-radius:10px; } ::-webkit-scrollbar-thumb:hover{ background-color:#bf4649; border:1px solid #333333; } ::-webkit-scrollbar-thumb:active{ background-color:#a6393d; border:1px solid #333333; } ::-webkit-scrollbar-track{ border:1px gray solid; border-radius:10px; -webkit-box-shadow:inset 0 0 6px #1f1f1f; } -webkit- supported safari, chrome, opera 15+ mentioned in comments. therefore, css not work in ie use this: scrollbar-base-color: #c0c0c0; scrollbar-base-color: #c0c0c0; scrollbar-3dlight-color: #c0c0c0; scrollbar-highlig

php - Swap my element's order to be the first in an array -

let's have array so: array( [0]=>1 [1]=>3 [3]=>5 [15]=>6 ); arbitrarily want array[15] first: array( [15]=>6 [0]=>1 [1]=>3 [3]=>5 ); what fastest , painless way this? here things i've tried: array_unshift - unfortunately, keys numeric , need keep order (sort of uasort ) messes keys. uasort - seems overhead - reason want make element first in array avoid uasort ! (swapping elements on fly instead of sorting when need them) you can try this using slice , union operator : // last element (preserving keys) $last = array_slice($array, -1, 1, true); // put union operator $array = $last + $array; update: as mentioned below , answer takes last key , puts @ front. if want arbitrarily move element front: $array = array($your_desired_key => $array[$your_desired_key]) + $array; union operators take right , add left (so original value gets overwritten).

xcode issue with git and resources -

i'm working developer using xcode , git. never had issue previoulsy i'm seeing problem consistently. when (or other developer) add image project, , push repo, files , pushed , fine. however, other developer not see file added project on pull request. have been trying debug several weeks no luck. have .gitignore file below: # xcode noise build/* *.pbxuser *.mode1v3 *~ build/ xcuserdata *.xcuserstate *.moved-aside !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 *.mode2v3 *.perspectivev3 .svn # osx noise .ds_store is there else modify in it? tried compare other projects afnetworking , sdwebimage , etc.

python - How to manipulate users input in a functions parameter -

i don't know if question made sense, i'll best explain. have many lists (rounds 1-20) , want ask user round on can jump right it. have function works each list, need know list use round1 = [1, 2, 3, 4] round2 = [5, 6, 7, 8] class makeup(): def example_round(self,filler): self.filler = filler if 'a' in filler: return example_function(raw_input('what round on?')) no user going type round1. they're gonna type either round 1 or 1. how can manipulate whatever input can pull desired round? want know if there way manipulate example_function(raw_input('what round on?')) so if put 1, can pull round1 use dict manage functions. funcs = {"1": round1, "2": round2, ...} funcs[input]()

html - To make first letter in a string as capital and make the font as italic -

how make first letter capital in string , display string italic.. input: hyptis suavalovens trying output this... *hyptis suavalovens* do css: p:first-letter { text-transform: capitalize; } p { font-style: italic; } <p>input:hyptis suavalovens</p> <p>i trying output this...</p> <p>*hyptis suavalovens*</p> http://jsfiddle.net/ez3lv/2/

Using Java Runtime class to find out a class in Jar file in Unix -

i using java runtime class write program checks class file in list of jar files. here program: import java.io.*; public class javaruncommand { public static void main(string args[]) { string s = null; try { process p = runtime.getruntime().exec("find /home/user/lib/ -name \"*.jar\" | xargs grep myclass.class"); bufferedreader stdinput = new bufferedreader(new inputstreamreader(p.getinputstream())); bufferedreader stderror = new bufferedreader(new inputstreamreader(p.geterrorstream())); // read output command system.out.println("here standard output of command:\n"); while ((s = stdinput.readline()) != null) { system.out.println(s); } // read errors attempted command system.out.println("here standard error of command (if any):\n"); while ((s = std

data structures - Hashing analysis in hashtable -

the search time hash value o(1+alpha) , alpha = number of elements/size of table i don't understand why 1 added? the expected number elements examined (1/n summation of i=1 n (1+(i-1/m))) i don't understand too.how derived? (i know how solve above expression , want understand how has been lead expression..) edit : n number of elements present , m number of slots or size of table i don't understand why 1 added? the o(1) there tell if there no element in bucket or hash table @ all, you'll have compute key hash value , won't instantaneous. your second part needs precisions. see comments. edit: second portion there "amortized analysis", idea consider each insertion in fact in set of n insertions in empty hash table, each lookup take o(1) hashing plus o(i-1/m) searching bucket content considering each bucket evenly filled respect previous elements. resolution of sum gives o(1+alpha) amortized time.

JavaScript - converting object key value pairs to JSON -

i have javascript object 6 key value pairs: my_type_1:"vegetable" my_type_2:"fruit" my_type_3:"dessert" my_value_1: "carrot" my_value_2: "apple" my_value_3: "cake" i want construct json out of above object such generates following: [{"vegetable":"carrot"},{"fruit":"apple"},{"dessert":"cake"}] edit: for (j=0;j<3;j++) { var tvarray = new array(); var stype = 'my_type_'+j+1; var svalue = 'my_value_'+j+1; tvarray['type'] = jsobject[stype]; tvarray['value'] = jsobject[svalue]; } the json.stringify doesn't produce desired output listed above. how do this? thanks you need put parenthesis around j + 1 . have gives 'my_type_01' , on. var obj = { my_type_1:"vegetable", my_type_2:"fruit", my_type_3:"dessert", my_value_1: "carrot

How to find the day of month in momentjs -

how can find day of month current moment date points to. on here iam trying invoke dayofmonth() var compareday = function(ts1,ts2){ return (moment(ts1).dayofmonth() === moment(ts2).dayofmonth())?true:false; }; per documentation , moment#date date of month, , moment#day day of week. so believe want, return moment(ts1).date() === moment(ts2).date();

css - Scrollbar for parent containing absolutely positioned element -

i have following code jsbin . possible have vertical scroll when messages overflow wrapper? thanks! replace css css demo #wrapper { position: relative; height: 400px; border: 1px solid #aaa; margin-bottom: 20px; } #list { position: absolute; bottom: 0; width: 100%; max-height:100%; overflow-y: auto; } .message { background-color: orange; padding: 10px; border-bottom: 1px solid red; }

javascript - how to draw sphere using math/sphere.js in threee.js? -

drawing sphere mesh function. function draw_sp(x,y,z) { var geometry = new three.spheregeometry( .02, 100,100 ); var material = new three.meshbasicmaterial( {color: 0xff0000} ); var sphere = new three.mesh( geometry, material ); sphere.position.set(x,y,z ); scene.add( sphere ); } its working , how draw same using sphere.js, given in three.js/doc under math? i tried this var sphere1= new three.sphere(new three.vector3( -l/2, 0, 0 ), 1.0); scene.add( sphere1); its not working .. can 1 give simple example use this? sphere.js mathematically version of sphere. doesn't draw anything. used calculations.

ios - UIKit controller/view to switch between views? -

sorry novice question if is. i have controller/view uisegmentedcontrol . need switch between controllers/views let views take rest of screen. idea pretty similar uitabbarcontroller switching controls not tab buttons segment controls. how can achieve according ios design , practice? create container viewcontroller , include tis logics: @property (nonatomic, strong) uisegmentedcontrol *segmentedcontrol; @property (nonatomic, strong) nsmutablearray *viewcontrollers; @property (nonatomic, weak) uiview *containerview; @property (nonatomic) nsinteger currentselectedindex; _segmentedcontrol = [[uisegmentedcontrol alloc] initwithitems:nil]; [_segmentedcontrol addtarget:self action:@selector(changeviewcontroller:) forcontrolevents:uicontroleventvaluechanged]; - (void)changeviewcontroller:(uisegmentedcontrol *)segmentedcontrol { uiviewcontroller *oldviewcontroller = self.viewcontrollers[self.currentselectedindex]; uiviewcontroller *newviewcontroller = self.viewcont

curl - How to make a PMML persistent model using openscoring? -

i using openscoring web service score pmml models. however, not getting how store model. using curl -x put --data-binary @decisiontreeiris.pmml -h "content-type: text/xml" http://localhost:8080/openscoring/model/decisiontreeiris put model on server before model querying. concern when stop webserver , starts again, model no longer exists. there way store these model can query using post anytime after restarting server? starting openscoring version 1.1.3, can use model auto-deployment directory option. use command-line argument --deploy-dir tell openscoring server start watching specified directory. then, can 1) deploy model copying pmml file auto-deploy directory , 2) undeploy auto-deployed model deleting pmml file auto-deploy directory. there no need deal curl put , delete commands anymore. however, please notice --deploy-dir command-line argument has been renamed --model-dir in github trunk.

javascript - How to verify identity on server when using an external login -

i have explain scenario here: want single authentication authority our webapps. sit on server a (for auth). 1 holds user's emails, passwords, etc. stuff should not shared. then have server b , on app hosted. able write javascript authentication , login part, works this: b loads login dialog code user logs dialog has session (cookie) user b asks javascript of user details in browser, b can logged in user a because server code of a has access session, ajax call works , can confident deliver. now, app on b needs load privileged data own database, should visible right user. far, browser has knowledge if user logged in @ all, , is. so sending user id via ajax server of b ludicrously unsafe , faked. since session, cookie , user data ever known a , b needs have way verify if access privileged data legit. and there i'm bit stumped in how can design api on a support server-to-server verification ensure b can check it's right user , has right access data. m

ios - Swift: How to implement User Defined Runtime Attributes -

Image
so implementing custom "chooser" toolbar, ios equivalent of radio button set ( uisegmentedcontrol ). horizontal bar divided options. to this, created subclass of uicontrol called segmentedcontrol , implemented custom drawing. however, such view, need option set available options are. have accessed view controller's viewdidload() , set there, using interface builder kind of stuff. so discovered wonderful thing called "user defined runtime attributes." created string attribute key buttonvalues , set value (this simple male/female chooser went "male|female"). found out can access these values using function self.valueforkey() , pass in key. made parser turn string array , added functionality drawrect() function use array set buttons. when ran app, got error "key value coding-compliance." so looked up, , found out class has have backing variables store attributes. fine, added instance variable called buttonvalues , initialized

c# - XSL more template -

i have source xml file , xsl code edit output xml file. have source xml file: <root> <firma kod_firmy="tomášov" stredisko="" ico="666666" dic="cz66666 " nazev="rest" jmeno="" mesto="zl" ulice="uomlom" psc="76007"> <faktura kod_odberatel="tomášov" datum_porizeni="2014-06-12" cas_porizeni="15:34:29" datum_vystaveni="2014-06-12" datum_zdanitelneho_plneni="2014-06-12" datum_splatnosti="2014-06-26" cena_cenik="2310.72" mnozstvi="24.000"> <dane dph="21.00" sklad_cena="968.365" /> <dane dph="0.00" sklad_cena="0.000" /> </faktura> </firma> </root> this xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml&q

javascript - Buffered geometry Uint16Array limitation? -

i trying optimize code using buffered geometry (three.js).i going through is there limit of vertices in webgl? . seems cannot comment on question. question on 65k limit. limit on number of vertex indexes?? or each vertex index being smaller 65k , array can have more 65k vertex indexes. and need documentation on buffered geometry. the limitation there. need work offsets around buffer geometry. see http://threejs.org/docs/#reference/core/buffergeometry . i gave small explanation of how offsets work in https://github.com/mrdoob/three.js/issues/4886#issuecomment-47198394

javascript - Convert special HTML character codes like &quot; to normal characters -

i have code in .cshtml file outputs json string: window.teagent = { id: @user.agentid , roles: '@user.roles' } but how looks when view page source or call window.teagent javascript: window.teagent = { id: 47650 , roles: '{&quot;rolesforuser&quot;:[&quot;agent&quot;,&quot;wvs&quot;]}' } how can convert each &quot; " looks this? {"rolesforuser":["agent", "wvs"]} use html.raw prevent string being html encoded: window.teagent = { id: @user.agentid, roles: @html.raw(user.roles) }

c# - Load indicator Windows Forms -

i have 3 forms: login form browse users form user profile and classes: user article app so, forms creating reloaded constructor. 1 of them are: public userprofile(user user) { initializecomponent(); show(); picturebox2.load("https://d13yacurqjgara.cloudfront.net/users/34535/screenshots/631316/loader_gif.gif"); string ajson = @client.downloadstring(app.host + "api/get_user_articles?e=" + app.email + "&p=" + app.password + "&u=" + user.id.tostring()); articles = jsonconvert.deserializeobject<list<article>>(ajson); listview1.view = view.largeicon; imagelist1.imagesize = new size(32, 32); int = 0; foreach (var article in articles) { listviewitem aview = new listviewitem(article.theme); string aurl = client.downloadstring(app.host + "api/get_article_image?a=" + article.id); if (!aur

if statement - How to remove the error 'not all code paths return a value' in c# -

i error in c#: 'not code paths return value'. know main reason behind if not followed else . if not want compiler if condition inside if not satisfied? example, in following program of trying find quotient without use of / operator: namespace consoleapplication1 { class program { public int quotient( int dividend, int divisor) { int i, quotient = 0, remainder; = divisor; while (i <= dividend) { += divisor; quotient++; remainder = dividend - i; if (i == dividend || ((i < dividend) && (remainder < divisor))) { return quotient; } } } static void main(string[] args) { program obj = new program(); console.writeline("enter first number:"); int = convert.toint32(console.readline());

In dart web projects, shouldn't type and reference warnings be errors? -

in dart, when developing web application, if invoke method wrong number of arguments, editor shows warning message, javascript compilation runs successfully, , error raised runtime. case example if refer , unexistent variable, or pass method argument of wrong type. i ask, if editor know things won't work, why compilation successful? why have types if not checked @ compile time? guess behaviour has reason, couldn't find explained anywhere. there no compilation stage. see warning based on type. example: this code have warning: void main() { var foo = ""; foo.baz(); } but 1 won't: void main() { var foo; foo.baz(); } because code analyzer cant deduct type of foo

php - Magmi redirect to main Magento folder -

whenever access php file in magmi folder, redirect main magento root directory 404 error. please me solve issue. note, have tried below options: replaced default magento .htaccess file magmi folder has full permission. magmi comes not include index.php file in it's root. server may have redirect rule prevents access folder if case. try accessing magmi php file directly going http://yourwebsite.com/magmi/web/magmi.php if doesn't work, magmi files may not in correct location (the root of magento), or server configuration preventing loading. check server logs debug this.

Swift compile error, subclassing NSValue, using super.init(nonretainedObject:) -

this code class id<t: anyobject> : nsvalue { init(baseobject: t) { super.init(nonretainedobject: baseobject) } } gives compiler error: error: must call designated initializer of superclass 'nsvalue' super.init(nonretainedobject: baseobject) ^ how rid of this? things thought of i thought error might because nsvalue initializer has anyobject? type ( note well: postfix ? ). tried various flavors of casting , [?!] postfixing in places, , fixed nothing. also, presumably nsvalue(nonretainedobject:) must call designated initializer, right? nsvalue(nonretainedobject:) isn't designated initializer. initializer listed in nsvalue reference (and hence designated initializer) nsvalue(value:cconstvoidpointer, withobjctype type:cstring) the other constructors convenience constructors derived class helper methods. you might try: init(baseobject: t) { super.init(bytes:&baseobject, withobjctype:"^v") }

c# - How do I stop a custom EF-based RoleProvider from caching results? -

i have asp.net mvc 4 application required use pre-existing membership model of users/roles. way did implement custom asp.net roleprovider manage access, uses entity framework repositories read user data database. method read user roles shown below, method implementations follow pattern: public class ourroleprovider : roleprovider { private iuserrepository _userrepository; public ourroleprovider() : this(container.resolve<iuserrepository>()) { } public ourroleprovider(iuserrepository userrepository) { _userrepository = userrepository; } public override string[] getrolesforuser(string username) { var user = _userrepository.getuserbyusername(username); if (user.roles.isnullorempty()) return new string[0]; return user.roles.select(r => r.rolename).toarray(); } } i have come across problem described in post . because single instance of roleprovider re-used lifeti

linux kernel - How many docker containers can i run simultaneously on single host? -

i new lxc , docker. docker max client count depend solely on cpu , ram or there other factors associated running multiple containers simultaneously? as mentioned in comments question, largely depend on requirements of applications inside containers. what follows anecdotal data collected answer (this on macbook pro 8 cores, 16gb , docker running in virtualbox boot2docker 2gb, using 2 mbp cores): i able launch 242 (idle) redis containers before getting: 2014/06/30 08:07:58 error: cannot start container c4b49372111c45ae30bb4e7edb322dbffad8b47c5fa6eafad890e8df4b347ffa: pipe2: many open files after that, top inside vm reports cpu use around 30%-55% user , 10%-12% system (every redis process seems use 0.2%). also, time outs while trying connect redis server.

javascript - Appending one URL to another as a link -

what trying (and failing miserably @ it) create link... , link should open specific page current page appended it. example... if user on page called www.bar.com , click link... go www.foo.com?link=www.bar.com here sorry little attempt @ this... <img src="#" id="link" target="_blank"> <script type="text/javascript"> window.onload = function(){ document.getelementbyid("link").href = 'http://www.foo.com?link='.window.location.tostring(); } </script> i in php can not use php particular page. can please help? edit: botched question cause added code here in middle of editing on accident. trying alter href code place specific image in place instead ...for example <img src="#"> becomes... <img src="http://www.bar.com?link=www.foo.com"> sorry ignorance. it's best wrap img tag , change attribute : (and use + , not . chaining strings ! ) <a

windows - Several limitation classes per one Job Object -

in windows job object can apply amount of different limitations processes. these limitations available through different job object info classes. msdn says "you can use setinformationjobobject function set several limits in single call. if want establish limits 1 @ time or change subset of limits, call queryinformationjobobject function obtain current limits, modify these limits, , call setinformationjobobject." but it's unclear: possible set limitations more 1 job object info class 1 job object? of course "rich" limit classes wrap basic, have limitations of 2 classes simultaneously. ask case of 2 non-basic classes.

c# - VCALENDAR .ics file issue -

i have .ics file set calendar ehtry outlook 2010 when end user registers course. server location on east coast (orhas est zone). however, 2 regions application is both in central standard time zone (cst) , mountain standard time zone (mst). issue when calendar entry set in outlook if course startime cst , user registering mst zone calender entry set 2 hours ahead of actual start time. example course starts @ 10:30 , register course , in mst zone. outlook calendar entry sets course start @ 8:30 instead of 9:30 am. also, if course mst zone , mst zone course set hour behind course start time. example class in start @ 2:00 pm mst register course , in mst outlook calendar entry set entry @ 3:00 pm when should 2:00 pm code below:` //create body in vcalendar format string caldateformat = "yyyymmddthhmmssz"; string bodycalendar = "begin:vcalendar\r\nmethod:request\r\nprodid:microsoft cdo microsoft exchange\r\nversion:2.0\r\nbegin:vtimezone\r\nx-microsoft-cdo-tzid:11\r\nbe

How to create pages in the footer in magento -

i have installed magento1.8.0.1, , import sample data. i added 1 more menus, now want add pages e-mail us, go cms -> pages -> add new page ->. created, want know how display e-mail page in footer. can me? thank you!!!. there various way, quick reference: go magento admin go cms block edit footer links (click on name) do whatever changes , save page. good luck!

objective c - Setting NSWindow position in current screen -

i newbie in objective-c.i have created main window want display in right bottom of current screen. tried following code - (void)windowdidload { nspoint pos; pos.x = [[nsscreen mainscreen] visibleframe].origin.x + [[nsscreen mainscreen] visibleframe].size.width - [mywindow frame].size.width ; pos.y = [[nsscreen mainscreen] visibleframe].origin.y + [[nsscreen mainscreen] visibleframe].size.height - [mywindow frame].size.height; [mywindow setframetopleftpoint:pos]; } what wrong in it? how resolve it? use nspoint pos; pos.x = [[nsscreen mainscreen] frame].size.width - [mywindow frame].size.width ; pos.y = 0.0f; [self.window setframe:cgrectmake(pos.x, pos.y, [mywindow frame].size.width , [mywindow frame].size.height) display:yes]; because [[nsscreen mainscreen] frame].origin.x 0. , in case of mac screen starts bottom.

Why does Python handle a KeyError differently than an IndexError (in this case)? -

i trying out various one-line solutions problem of defining variable if not exist , noticed python handles dicts , lists/tuples differently. these errors seem entirely parallel me, i'm confused why there discrepancy. dictionary keyerror handling existing_dict = {"spam": 1, "eggs": 2} existing_dict["foo"] = existing_dict["foo"] if not keyerror else 3 returns {"spam": 1, "eggs": 2, "foo": 3} notice i'm referencing non-existing key in both left , right hand sides; python has no problem handling keyerror in either clause appears. list indexerror handling (also true tuples) existing_list = ["spam","eggs"] existing_list[2] = existing_list[2] if not indexerror else ["foo"] returns indexerror: list assignment index out of range it's not difficult @ around specific error ( answer here ), i'm curious why there difference in these cases. in both situations, ther

typo3 - TypoScript: Check if JS/CSS File is already included -

anybody knows how check if js/css file included typoscript? example [template_a.ts] page.includejs { jsfile = fileadmin/template/js/jquery-1.10.2.min.js } now if got extension same include e.g. [extension_a.ts] page.includejs { jsfile = fileadmin/template/js/jquery-1.10.2.min.js } is there way prevent kind of double code injection ? maybe got template e.g. template_b.ts jquery not included - extension_a.ts has include jquery itself. kinldy you can use same key inside includejs such gets overridden if include file twice. other should put jquery includejslibs , such loaded before other js files. other that, ts should unique each page. therefore make sure anyway resources included in-order. should not include js libs automatic extension ts setups. use documentation tell integrator needs included , not.

JasperReport/Aspose.word - Background image working with pdf but doesn't with word -

as explained in title. i'm using aspose.word extension jasperreports. when create report pdf format, works fine; but, when export same jrxml file in word .doc format cannot see background image. wondering if aspose.word support background images or not. didn't manage point in documentation. edit: came out aspose development team aspose.word has bug , doesn't show background images. just reference 1 facing issue in future. issue issue id:wordsjsp-146 has been logged in our issue tracking system fix bug. also, following thread posted in aspose forum above issue http://www.aspose.com/community/forums/thread/556318/background-image-not-showing.aspx . p.s. social media developer @ aspose.

puppet - Proper syntax for entry in Hiera yaml file -

the goal supply default value parameter being passed defined resource type. have supplied defaults class parameters using automatic defaulting procedure uses hiera, mechanism not work defined types. here how call hiera in defined type: define git_down( $local_repo_dir = undef, $remote_repo_url = undef, $version = undef, $shell = hiera("git_down::shell"), $path = hiera("git_down::path"), $date_format = hiera("git_down::date_format", '%y-%m-%d %h:%m:%s') ) { ... more puppet code type definition... } my idea create classes have normal automatic defaults parameters keyed class name (hence done in class files, not shown), make other parameters same default users of type, regardless of class. above type permit updating git repo. needs type , not class, because need fetch files multiple git repositories, , classes singletons, while types may have multiple instances. every class declares "git_down" instance shoul

java - JavaFX CSS URL isn't loading -

i trying load xml resource, , doing this: fxmlloader = new fxmlloader(); root = fxmlloader.load(getclass().getresource("document.fxml").openstream()); when run code error: null/../css/button.css javafx.fxml.loadexception: unknown path:23 when @ line 23 have this: <url value="@../css/button.css" /> this works: fxmlloader = new fxmlloader(); root = fxmlloader.load(getclass().getresource("document.fxml")); but when run following controller = (documentcontroller)fxmlloader.getcontroller(); controller null how can fix css issue? this bit of guess, think issue you're providing input stream fxmlloader instead of url . because of this, fxmlloader unaware of location of fxml resource, , hence can't resolve .. in url tag. explain error message: null/../css/button.css javafx.fxml.loadexception: unknown path:23 the path provided relative null because fxmlloader doesn't know location of fx

vba - Unable to find how to code: If Cell Value Equals Any of the Values in a Range -

i have found following code after lot of research , little of want except don't know how specify criteria reference range of cells instead of 1 single criteria. i trying copy records , append them end of rows of matching records in sheet1. code copies records sheet3 aren't pasted corresponding rows in sheet1 want. sub copytosheet() dim srng range, cell range dim drng range set srng = sheets("sheet2").range([a2], [a65536].end(xlup)) each cell in srng if cell.value = "80560" set drng = sheets("sheet3").[a65536].end(xlup)(2, 1) cell.entirerow.copy drng end if next end sub so, there 10,000+ records in sheet2, , 30+ records in sheet1. sheet2 , sheet1 have id number in column a. of records in sheet1 have matching record in sheet2. want copy records sheet2 , append them @ end of record same id in sheet1. code above doesn't solve problem because finds 1 record "80560" , copies sheet 3. thank in advance assistance ca

git p4 - Detect new branches with git-p4? -

git-p4 not creating new branches git p4 sync . we using branchlist config entries (not perforce branch specifications). i've added new branch spec config, git p4 sync --detect-branches not adding new branch. is situation git p4 sync --detect-branches //path/to depot/@all should used? how git p4 sync detect , add new branches? this article here shows how add new branches: http://answers.perforce.com/articles/kb_article/git-fusion-branch-mappings also git fusion guide here under 'converting lightweight branch populated perforce branch': http://www.perforce.com/perforce/doc.current/manuals/git-fusion/chapter_dyn_ngj_3l.html#section_kkz_gqv_rl references http://answers.perforce.com/articles/kb_article/mapping-git-terms-and-commands-to-perforce

android - How to time an activity out after a certain timeframe? -

i want create application in user has 90 seconds in order complete number of sums. i unsure how stop activity , move after timeframe up? activity code: /** * class holding activity has 10 random sums user answer * @author ross * */ public class randomtest extends activity implements view.onclicklistener { // declare vars textview text; edittext answer; button submit; int random1; int random2; string[] question = new string[10]; int correctanswer[] = new int[10]; int[] results = new int[10]; int score = 0; int questionnumber = 1; mediaplayer correctnoise; mediaplayer incorrectnoise; imageview imagerandom; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.test); // initialising variables initialisevars(); // set random setuprandom(); // set text view equal question in array

Artificial Neural Network layers -

i have decided try , make reccognition system. , want start pictures of say, 16x16 pixels. 256 input neurons. now, output neurons essensially how many results want, want distinguish letters a, b , c. need 3 output neurons right? my question is, how can know how many neurons need in hidden layer? , purpose of them again? how many character classes want? say, o , q quite simular, thay both lead 1 hidden layer neuron later tell them appart? you're right input , output layers. how can know how many neurons need in hidden layer? there's no concrete rule says how many units need in hidden layers of neural network. there general guidelines though, i'll quote one of answers on cross validated . number of input units: dimension of features x(i) number of output units: number of classes reasonable default 1 hidden layer, or if > 1 hidden layer, have same number of hidden units in every layer (usually more better, anywhere 1x 4x number of inp

c# - Moq - Set different parameter in callback method in two different methods -

i have callback method called filter take in function , single string parameter. in code, filter called 2 different times different methods , parameters. there way set parameter different each instance filter called? private void method1 { filter(iq1, function1); } private void method2 { filter(iq2, function2); } this how tried set mock private mock<filter> m = new mock<filter>(); string test1 = "hello"; string test2 = "goodbye"; var queue = new queue<string>(); queue.enqueue(test1); queue.enqueue(test2); m.setup(f => f.filter(it.isnotnull<string>, it.isany<action<filter>>).callback((string iq, action<filter> action) => action(queue.dequeue()); i know method1 calls filter before method2.

c++ - What is the value category of result yielded from shift operators, bit-wise operators, and sizeof operator? -

shift operators: << >> bit-wise operators: ~ , & , ^ , | sizeof operator: sizeof() per c++ standard (n3797), can confirm ~ yields prvalue (5.3.1/2), not others above. as far can tell results prvalues speculative. seems under-specified in similar way value categories of operands covered in what value category of operands of c++ operators when unspecified? , does standard mandate lvalue-to-rvalue conversion of pointer variable when applying indirection? . we can see section 3.10 lvalues , rvalues has following note: the discussion of each built-in operator in clause 5 indicates category of value yields , value categories of operands expects. but can see section 5 spells out value category explicitly in few cases. in case of particular question spells out explicitly value category of result & , ~ . even though underspecified can find clues point in consistent direction. can make argument operands >> , << , ^ , |

AngularJS prevent ngModel sync -

i have simple directive called po-datepicker , displays datepicker on screen, allows user type date manually: <input type="text" ng-model="model" po-datepicker required /> and directive: myapp.directive('podatepicker', function () { return { require: ['?^ngmodel'], restrict: 'a', link: function ($scope, elem, attrs, ctrl) { var ngmodel = ctrl[0]; var picker = elem.datepicker(); picker.on('changedate', function(e) { ngmodel.$setviewvalue(e.date); ... }); elem.parent().find('button').on('click', function() { picker.datepicker('show'); }); var changefn = function(e) { // here have logic calls $setviewvalue(); }; picker.on('hide', changefn); elem.on('keyup blur', changefn

jsf 2 - Is there a way to intercept a ExpansionToggle valueChange event before the client toggles the component? -

i using 3.3 version of icefaces , have data table of people. need expansion button allows user update attributes of person in data table. tag, ace:expansiontoggle 1 think can used, if catch events changelistener, client has toggled component. need validate fields in panel if validation fails, panelexpansion component won't close. here's code describe i'm trying do. binding component backing bean seemed idea if set breakpoint in getter , setter of expansiontoggle, client has collapsed panel before can it. <ace:datatable id="driverlisttable" value="#{persons}" var="person"> <ace:column id="exp"> <ace:expansiontoggler binding="#{personbean.expansiontoggle}" changelistener="#{directdriverinfobean.handletoggleevent}"/> </ace:column> <ace:column headertext="#{msg.label_driver}"> <ice:outputtext value="#{perso

html - Which button was pressed? -

i know question has been asked before, cannot seem find reasonable answer circumstances. i have form multiple buttons in submit , required know button pressed. a small code snippet of inside of form may this: <input type="submit" name="action" value="<fmt:message key="id001"/>"/> <!-- save --> <input type="submit" name="action" value="<fmt:message key="id002"/>"/> <!-- delete --> <input type="submit" name="action" value="<fmt:message key="id003"/>"/> <!-- other action --> the fmt:message part takes consideration language of client , places word on button. until now, adding action handler on submit buttons , adding hidden input element onto form telling me 1 pressed, need support site without depending on javascript. since values of buttons variable, how can approach this? (essentially can if inpu

mysql - Group by with where clause with having count equal to 1 -

objective: find rows (1) number of messages number 1, , (2) length of message less 5 characters in length. can each separately, having difficulty when combine 2 conditions in 1 sql query. sample database table: +-----+----------+----------+ | id | number | message | +-----+----------+----------+ | 1 | 100 | test | | 2 | 100 | testing | | 3 | 100 | testing | | 4 | 200 | test | | 5 | 201 | test | | 6 | 201 | test | | 7 | 250 | testing | | 8 | 251 | test | | 9 | 300 | testing | | 10 | 300 | testing | +-----+----------+----------+ should return rows 200 , 251. tried following, no luck: select * `reports` length(message) < 5 group number having count(*) = '1' returns rows rows contains counts > 1. ok, made wrong change few hrs ago - time have data yours. ah, , see you're having problem with. don't understand order mysql interprets select; it's firs