Posts

Showing posts from March, 2010

Jquery append string from array -

i have array tags = ['str1', 'str2']; and need implement tags ul template - <li><span>str1</span></li> <li><span>str2</span></li> at first have tag: <ul id="tags"> </ul> how can on jquery? edited : sry i'm modified question plz check now for generating entire list content, try:: var tags = ['str1', 'str2']; var lis = $.map(tags, function(element, index) { return $("<li />").append($("<span></span>").text(element)); }); $("#tags").append(lis); see: http://jsfiddle.net/syqpa/1/

MadExcept for delphi is not printing stacktrace after application crash -

detailed question : we trying capture stacktrace (bugreport.txt) using madexcept in delphi application thread crashing application fatal error. madexcept doesn't print stacktrace after application crashes. ideas why? our code : procedure tmainform.wsserverexecute(acontext: tidcontext); begin try htmlexecute(acontext); except on e: exception begin if not(e eidexception) begin logdata.adderror('htmlexecute error: ' + e.message); madexcept.handleexception; end; raise; end; end; end; this procedure called when client makes websocket connection server. thread produced indy tcpserver component. htmlexecute function reads , writes packets between client , server. i've wrapped in try..except block catch exceptions. logdata line records error error log , madexcept line supposed create bugreport.txt file. raise line passes exception indy knows fatal error occurred , abort thread. the reason why mad...

VB.net stopping a backgroundworker -

i want create button stop background worker , end process working on. here sample backgroundworker code: private sub button1_click(sender object, e eventargs) handles button1.click try if backgroundworker1.isbusy <> true backgroundworker1.runworkerasync() end if catch ex exception end try end sub private sub backgroundworker1_dowork(sender system.object, e system.componentmodel.doworkeventargs) handles backgroundworker1.dowork dim counter integer = 1 'updated code stop function---------------- backgroundworker1.workersupportscancellation = true if backgroundworker1.cancellationpending e.cancel = true progressbar1.value = 0 exit end if 'updated code stop function---------------- listbox1.items.add(counter) ...

Official Spring Abbreviations -

may know if there official abbreviations spring commonly use terms/annotation? for example @component - examplecomp @service - examplesvc @respository - exampleres i work anal organization requires justification kinds of abbreviations. an abbreviation (from latin brevis, meaning short) shortened form of word or phrase. usually, not always, consists of letter or group of letters taken word or phrase. example, word abbreviation can represented abbreviation abbr., abbrv. or abbrev. these not abbreviations , annotations (you can understand them identifiers) identify pieces can scanned , registered @ time of context creation. moreover, can used interchangeably, general convention use the @repository domain level objects, @service service layer classes in ideal mvc implementation , @component in general can used component want bean context aware of. if can more specific want ask, might more clear answer. edit: if want see examples of how these annotations...

android - Where the decoded frame by ffmepg stored? -

i try decode video , convert frame rgb32 or gb565le format. then pass frame c android buffer jni. so far, know how pass buffer c android how decode video , decoded frame. my question how convert decoded frame rgb32 (or rgb565le) , stored? the following code, i'm not sure correct or not. -jargo img_convert_ctx = sws_getcontext(pcodecctx->width, pcodecctx->height, pcodecctx->pix_fmt, 100, 100, pix_fmt_rgb32, sws_bicubic, null, null, null); if(!img_convert_ctx) return -6; while(av_read_frame(pformatctx, &packet) >= 0) { // packet video stream? if(packet.stream_index == videostream) { avcodec_decode_video2(pcodecctx, pframe, &framefinished, &packet); // did video frame? if(framefinished) { avpicture pict; if(avpicture_alloc(&pict, pix_fmt_rgb32, 100, 100) >= 0) { sws_scale(img_convert_ctx, (const uint8_t * const *)pframe->data, pframe->linesize, 0, pcodecctx->...

three.js - Confusion about ParticleSystem and Particle -

i'm beginner in threejs. read examples particle system in web , , observe particlesystem , webglrenderer or particle , canvasrenderer used together.so want know whether particle can used in webglrenderer . wish control every particle's movement in system webglrenderer .how can it? when create particle system can pass in geometry. this: var geom = new three.geometry(); var material = new three.particlebasicmaterial({size:4, vertexcolors: true, color:0xffffff}); (var x = -5 ; x < 5 ; x++) { (var y = -5 ; y < 5 ; y++) { var particle = new three.vector3(x*10,y*10,0); geom.vertices.push(particle); geom.colors.push(new three.color(math.random()*0x00ffff)); } } var system = new three.particlesystem(geom,material); scene.add(system); by changing position of each individual vertices can move them around.

regex - replacing tabs with single tab in sed -

i want replace multiple tabs single tab sed. trying use sed 's:\t+:\t:' .\text.csv > newtext.csv but doesn't seem work if open in sublime , replace regex \t+ \t works properly what wrong sed? also, if replace tabs comma sed 's:\t\t*:,:g' text.csv > newtext.csv i kind of line 264262360,20030826,200308,2003,2003.6466,bus,employer,,,,,,bus,,, ,,,,,,,,,,0,051,051,05,1,3.4,12,2,12,5.24866163479182,1 you can use tr replace multiple tabs single one: tr -s '\t' '\t' < inputfile > outfile the -s option squeezes repeats: -s , --squeeze-repeats replace each input sequence of repeated character listed in set1 single occurrence of character

c++ - Find out what's holding a lock on a file with WinAPIs -

at times when i'm trying delete exe file 1 of processes following error getlasterror : error: 32 process cannot access file because being used process. is there way find out what's holding lock on file using c++ , winapis? the best solution works me can based on article suggested @iinspectable. check other reply post here .

plugins - sbt: cobertura4sbt cannot be found from sbt 0.12 -

i use cobertura4sbt sbt plugin maven repository. i added following lines project\plugins.sbt : resolvers += "sonatype oss snapshots" @ "https://oss.sonatype.org/content/groups/scala-tools" addsbtplugin("de.johoop" % "cobertura4sbt" % "1.0.0") however, tried "sbt compile", appended local sbt , scala version number resolving path corresponding pom cannot found. miss anywhere? [warn] ==== sonatype oss snapshots: tried [warn] https://oss.sonatype.org/content/groups/scala-tools/de/johoop/cobertura4sbt_2.9.2_0.12/1.0.0/cobertura4sbt-1.0.0.pom [warn] ==== public: tried cobertura4sbt on sbt 0.7.4 the auto-postfixing of scala , sbt version added while in sbt distinguish plugins different releases of sbt. this source , cobertura4sbt looks built 0.7.4, author says plugin no longer maintained: this sbt plug-in enables measure code coverage of great cobertura tool. however, since cobertura not actively ...

memory allocation of character in c and java -

how memory space allocation affects operations on string length in (both) c , in java ? (this in reference fact c string variable packs 4 bytes per word java string variable packs 2 half words per word) the fact there ain't c string variable in c , arrays ;arrays of characters. 1 char in c occupies 1 byte . string literals stored array of characters , terminating \0 appended @ end. in java programming language, strings objects. string contains following: a char array — separate object— containing actual characters; an integer offset array @ string starts; length of string; another int cached calculation of hash code. this means if string contains no characters, require 4 bytes char array reference, plus 3*4=12 bytes 3 int fields, plus 8 bytes of object header. gives 24 bytes (which multiple of 8 no "padding" bytes needed far). then, (empty) char array require further 12 bytes (arrays have 4 bytes store length), plus in case 4 bytes of padding br...

Why is my Admob banner not showing? using storyboard -

can me correcting mistake in code, can't find myself, think seems fine, no ads showing. thanks! #import "viewcontroller.h" #import "gadbannerview.h" #import "gadrequest.h" @implementation viewcontroller @synthesize adbanner = adbanner_; - (uiview *)view { return (uiview *)self.view; } - (id)initwithframe:(cgrect)frame { self = [super initwithframe:frame]; if (self) { // initialization code } return self; } #pragma mark init/dealloc // implement viewdidload additional setup after loading view, // typically nib. - (void)viewdidload { // initialize banner @ bottom of screen. cgpoint origin = cgpointmake(0.0, self.view.frame.size.height - cgsizefromgadadsize(kgadadsizebanner).height); // use predefined gadadsize constants define gadbannerview. self.adbanner = [[gadbannerview alloc] initwithadsize:kgadadsizebanner origin:origin]; // ...

R - plot raster without box -

i have problem getting rid of box when plotting raster colour scale: require(raster) data(volcano) raster <- raster(volcano) colfunc <- colorramppalette(c("blue", "red")) plot(raster, col = colfunc(40), breaks = seq(minvalue(raster), maxvalue(raster), length.out = 40), bty = "n", xaxt = "n", yaxt = "n") the bty option doesn't work. missing here? got it: plot(raster, ..., bty="n", box=false) it interesting both bty="n" , box=false must set! if try 1 of these, box printed!

c# - ConfigurationManager.GetSection(sectionName) returns null while performing unit tests -

i have unit tests project it's own app.config file, mock of real configuration file defined target project being tested. mock file loaded , processed unit test code (not target project), , works if run tests within 1 test project. configurationmanager.getsection(sectionname) however, if run tests several test projects, , other test projects performed prior relevant project, above statement returns null . if discussed test project performed first, there no problem loading configuration file. how can fix loading of configuration file in unit test work correctly? your problem not configurationmanager.getsection(sectionname) returns null, how can test code containing configurationmanager.getsection(sectionname)? and answer is: wrap it, inject it, test mock it. you have several examples of pepole facing same issue: http://chrisondotnet.com/2011/05/configurationmanager-wrapper-for-unit-testing/ http://weblogs.asp.net/rashid/archive/2009/03/03/unit-testable-con...

python 2.7 - Django forms adding class attribute from the constructor -

as can see in code sample below, i'm trying add multiple choice field constructor (instead of doing in commented line) doesn't seem work, doesn't matter if it's before or after call of super(). any advices on how can add attribute constructor? class pageform(forms.form): # answers = forms.modelmultiplechoicefield(answer.objects.all()) def __init__(self, *args, **kwargs): self.answers = forms.modelmultiplechoicefield(answer.objects.all()) super(forms.form, self).__init__(*args, **kwargs) self.answers = forms.modelmultiplechoicefield(answer.objects.all()) p.s. know might irrelevant example, need thing more complex thing :d fields need added after super. instead self.answers, try self.fields['answers']

How to change paypal subscription amount in php -

i have 2 kind of user registration($50/year,$100/year) on site now, suppose user registers $50 amount , takes first registration... next few years $50 per year deducted per recurring payment of paypal. working fine. now, wants upgrade $100 i.e second membership , next year amount deduction should $100... how update paypal change in amount.. i don't want redirect user paypal site can please me ?

c# - How to delete entry from file -

try delete entry csv file, if know part of string code //open file filestream fs = new filestream(filepath, filemode.open, fileaccess.readwrite); streamreader sr = new streamreader(fs); //divide file entry separate lines string []line = sr.readtoend().split(new string[] { environment.newline }, stringsplitoptions.removeemptyentries); // find required entry , create new list without list<string> finaldata = new list<string>(); foreach (var l in line) { if (!line.contains((datetimepicker1.text.tostring().trim() + ','+ eventnamedeletetextbox.text.tostring().trim()+','))) finaldata.add(l); } // convert array string tocsvoutput = string.join(environment.newline, finaldata.toarray()); // viewtextbox1.text=tocsvoutput; //updatefile sr.close(); filestream fs1 = new filestream(filepath, filemode.open,fileacce...

mysql - Use id made from latitude and longitude -

is possible use in database id (primary key) made localization (latitude , longitude) ? formula : public long getkeyvalue() { return long.valueof((intlatitude + 90 * 1000) + "" + (intlongitude + 180 * 1000)); } intlatitude , intlongitude both multiplied 1000 , rounded. respectively add 90 , 180 remap origin in order handle negative coordinates. with given approach going have problems because of ambiguity. example 123 latitude 1 longitude 23 or latitude 12 longitude 3. should pad zeros or use separator. why bother mapping 2 single value? database systems permit compound primary keys can use pair (lat, lon) directly key.

Are unused javascript files compiled in titanium SDK? -

in titanium project, when have unused javascript files (i mean js not required/included anywhere), them compiled or executed in final app executable? produce resource consumption (memory, cpu) have files? thank you these files not compiled (javascript interpreted language, i'm not sure meant compiled?) nor executed unless explicitly make so, included in resource bundle. since titanium not have way of knowing files using, assumes in resources bundle needed. however, *.js extension base64'd , cuts down on size. if these files unused, have 0 detectable impact on system memory or cpu cycles. the impact have on application size, need have large javascript file, upwards of millions of lines, before became noticeable.

build - Changing the load order of files in an R package -

i'm writing package r in exported functions decorated higher-order function adds error checking , other boilerplate code. however, because code @ top-level evaluated after parsing. these means load order of package files important. to give equivalent simplified example, suppose have package 2 files (negate2 , utils), , require negate2.r loaded first function 'isfalse( )' defined without throwing error. # /negate2.r negate2 <- negate # ------------------- # /utils.r istrue <- istrue isfalse <- negate2(istrue) is possible structure namespace, description (collate) or package file in order change load order of files? internal working of r package structure , cran still black magic me. it possible around problem using awkward hacks, least repetitive way of solving problem. wrapper function must higher-order function, since changes function call semantics of input function. package code heavy (~6000 lines, 100 functions) repetition be...problematic. s...

vba - Generating XML file out of Excel with 50k rows -

i new vba. know other programming languages little. interested know, how transfer table below new structure efficient way. in total there 50k rows of data process , need know approach work given amount of data. excel: level key value reference 1 k_1 fruit 1 k_2 vegetable 2 k_1_1 banana k_1 2 k_1_2 apple k_1 2 k_2_1 cucumber k_2 2 k_2_2 carrot k_2 3 k_1_1_1 banana k_1_1 3 k_1_1_2 banana else k_1_1 3 k_1_1_3 banana else k_1_1 3 k_1_1_4 banana else k_1_1 3 k_1_1_5 banana else k_1_1 the resulting structure should group types, subtypes , subsubtypes according structure below: <type key="k_1"> <levelid>1</levelid> <value>fruit</value> <subtype key="k_1_1"> <levelid>2</levelid> <value>ban...

Unable to run linux kernel image on qemu -

i have compiled linux kernel (stable) tree , got initrd , bzimage. try running on qemu emulator having trouble specifying root file system partition. (i know partition thats loaded run initrd from). my system ubuntu 12.04 installed via wubi on windows. the command have been using qemu-system-x86_64 -kernel bzimage -initrd initrd.img-3.11 -append "root=/no-clue-what-to-put" i know root argument specifies root partition is. image running on qemu appreciated. do have disk image , root filesystem give qemu , kernel? you need more linux kernel boot linux system. qemu, need root filesystem contained within virtual disk image well. contain programs kernel "hands control" when it's done booting, 'init' or 'systemd'. so have generate qemu-disk image contains root filesystem. if created such root filesystem on first partition of virtual disk, can specify virtual disk parameter qemu "-hda /path/to/qemu/disk/image", , ca...

c# - Azure Cloud Service deployment without changing existing configuration -

is possible deploy cloud service without changing existing configuration? what want deploy cloud service package dev cloud service , take same package , upload production cloud service. any ideas? if understand question correctly, yes possible. configuration settings you'd different between 2 environments (like connection strings, app settings, etc.) should defined in service definition file , set in service configuration file. when visual studio uploads package uploads package , service configuration file separately (the service definition inside package). when update or deployment command line or portal provide package , service configuration file separately well. allows push same package, provide different configuration. if don't have differences between deployments, rare think, deploy same package , configuration file. if performing update production system , don't want "override" configuration there production need upload same file pre...

sql server - How to group values of one column based on condition in t-sql? -

my table has doctor id, visit id (one doctor can have several visits) , visit cause, looks this: doctor_uid | visit_uid | visit_cause 11-11-11 22-22-11 1 22-22-22 44-44-22 2 11-11-11 23-23-23 1 i need count visits each doctor, based on visit_cause (it should equal '1' ). before count visits each doctor without condition of visit_cause , must have in query too: select v.vra_uid, count(v.visit_uid) on (partition v.vra_uid) number_of_visits visits v it returns: doctor_uid | number_of_visits 11-11-11 2 22-22-22 1 how can count visits, have visit_cause = '1' each doctor? like: doctor_uid | number_of_visits | visits_with_cause_equal_1 11-22-33 2 2 22-22-22 1 0 thanks in advance! this should work: select v.vra_uid, count(v.visit_uid) number_of_visits , sum(case when v.visit_cause = 1 1 else 0 end) visits_with_cause_equ...

how to split a xml format data into row column format in sql server 2008 using stored procedure -

i getting response asp.net web service mentioned in below format . want convert in table format age in age column , date in date column. have asked question earlier string getting o/p in xml should do? getting response output in @response in format : <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://abc.org/">age=7|date=15/04/2006^age=5|date=15/04/2008</string> how split row column format in sql server 2008 using stored procedure.i getting @response above mentioned form unable use way doing . can me. use string split function of choice , split on ^ first , | second. after can use pivot data in columns. declare @xml xml = '<?xml version="1.0" encoding="utf-8"?><string xmlns="http://abc.org/">age=7|date=15/04/2006^age=5|date=15/04/2008</string>'; xmlnamespaces(default 'http://abc.org/') select p.age, p.date ( select s1.id, ...

asp.net - Ajax Extension Works With Master Page But Not With Content Page -

i have installed ajax extension , added reference application. facing strange problem master page accept ajax extension tools content page throw error “element scriptmanager/updatepanel not known element." my webconfig: <?xml version="1.0"?><configuration> <system.web> <customerrors mode="off"> </customerrors> <authentication mode="windows"/> <pages> <controls> <add tagprefix="asp" namespace="system.web.ui" assembly="system.web.extensions, version=1.0.61025.0, culture=neutral, publickeytoken=31bf3856ad364e35"/> </controls> </pages> </system.web> </configuration> contentpage: <%@ page language="c#" masterpagefile="~/yuva.master" autoeventwireup="true" codebehind="picsave.aspx.cs" inherits="yuvark12.picsave" %> <asp:content id="mypicsav...

json - Ajax request Syntax issue -

here code in sencha receiving json data, problem when call shows error message because of syntax.i dont know fails coz im new sencha,here code ext.ajax.request({ url: 'http://117.218.59.157:8080/wishlist/login', method: 'post', headers: { 'content-type': 'application/json;' }, jsondata:{ username : "faz@gmail.com", emailid : "faz" }, success: function (response) { alert(response.responsetext); }, failure: function (response) { alert(response.responsetext); } }); when above method calls showing following response <html><head><title>apache tomcat/...

joomla - Remove tooltips when creating an article -

say there menu item registered user website can create article. when hovering title (and form fields), tooltip shown, consists of title , explanation. have managed hide explanation, can't find way totally remove whole tooltip. don't way form goes , down after hovering each field. i have tried add jhtml::_('behavior.disable','tooltip') in several files, nothing happened. tried comment jhtml::_('behavior.tooltip') wherever was. have searched everywhere, can't find answer suits me. any ideas?? thanks in advance. try finding class , using in css .some_class { pointer-events: none; cursor: default; }

Create editor with multiple parts in Eclipse 4.x -

i want create application can open files. when opening file, editor should open in normal eclipse ide. want in editor multiple parts (e.g. treeview of opened data , data in plaintext) is there way describe contents of editor in application.e4xmi , opening "view"? this: application.e4xmi: partstack (id = "editor.partstack") |- part (datatreeviewer.java) |- part (plaintextviewer.java) \- part (imagepart.java) openhandler.java: partstack ps = openpartstack("editor.partstack"); addtomainpartstack(ps); or have describe editor contents programmatically in openhandler? this: openhandler.java: partstack ps = createnewpartstack(); ps.add(new datatreeviewer()); ps.add(new plaintextviewer()); ps.add(new imagepart()); addtomainpartstack(ps); i used partdescriptor editor part , ordinary ctabfolder pages in editor.

c# - Password filled blank after postback -

when set textmode = password value of textbox lost after postback since know textbox class implement interface ipostbcakdatahandler retains value either disable textbox viewstate false. so want know reason why happening.

javascript - Ajax request extremely slow -

i don't know why, javascript extremely slow , takes 5 minutes finish properly, refresh pages , requests haven't been processed. i used async:true hoping process little bit faster doesn't. here's code using save each element on inside #myspace. cn = document.getelementbyid("myspace").childnodes; (var t = 0; t < cn.length; t++) { if (cn[t].nodetype == 1) { var n = { id: cn[t].id, left: cn[t].style.left, top: cn[t].style.top }; $.ajax({ data: n, url: "/application/ajax/__ajaxprofile.php?a=saveposition", type: "post", cache: true, async: true, success: function (e) {} }) } } e("please wait save, might take more minute."); setint...

sql server - fulltext search over data with underscore -

i have indexed table 1 of indexed columns can contains data underscore. id name 1 01_a3l 2 02_a3l 3 03_a3l 4 05_a3l 5 name 6 name 7 name when search table following query don't results: select * myamazingtable where( contains(*,'"a3l*"')) what reason this? , how can make sure results expect (all records end a3l)? kees c bakker 100% correct, if wanted results require without of steps. quick/dirty way change search like... select * myamazingtable name '%a3l' % in case represent whatever comes before , make sure last 3 characters a3l. give results looking for.

PHP: query all variables defined inside function scope -

this out of curiosity, wondering if there way query variables defined inside scope of function (exclusively within scope, , within function) , put them in associative array. extended get_defined_vars function. the reason nice able save 'state' of execution @ point in program, instance debug, log, handle exceptions, or pass entire scope of function one. if i'm not mistaken, think get_object_vars allows doing objects. from comments of php.net // top of php script $vars = get_defined_vars(); // stuff $foo = 'foo'; $bar = 'bar'; // variables defined in current scope $vars = array_diff(get_defined_vars(),$vars); echo '<pre>'; print_r($vars); echo '</pre>';

Select last 5 rows in join query SQL Server 2008 -

i trying bring last 5 rows of order table based on orderdate column name firstname customer table. the below query displays values order table instead of last 5 rows. select a.[firstname], b.[orderid], b.[orderdate], b.[totalamount], b.[orderstatusid] [schema].[order] b outer apply (select top 5 * [schema].[customer] b.[customerid] = 1 , a.[customerid] = b.[customerid] order b.[orderdate] desc) any mistake in logic of using top , desc ? if want last 5 rows of order table, why apply top customer table? select top 5 a.[firstname],b.[orderid],b.[orderdate],b.[totalamount],b.[orderstatusid] [schema].[order] b left join [schema].[customer] on a.[customerid]=b.[customerid] b.[customerid]=1 order b.[orderdate] desc

php line change including space for string -

i need put hyperlinks strings, line break wrong. need change line per string, underlined links don't mix each other. $aaa = 'aaaaaaaaaaaaaaaa' $aaa = 'bbbbbbb'; $aaa = 'ccccccc cccccc'; for($i = 1; $i <= 3; $i++) { echo $aaa; echo ' '; ----->space between string } currently, i'm getting wrong outputs below: wrong output1: aaaaaaaaaaaaaaaa bbb bbbb wrong output2: aaaaaaaaaaaaaaaa bbbbbbb ccccccc cccccc i need print out this: aaaaaaaaaaaaaaaa bbbbbbb ccccccc cccccc i tried , , still change line per @ space. =========================================== updated question: ok, think explanation bad: think print out values database using loop: google images google email google mail google books google earth google voice google scholar google finance i'm printing out them in line below. google images google email google mail google books google earth google voice my concern prints out below: goo...

mongodb - Optimize loops with big datasets Python -

it's first time go big python need help. i have mongodb (or python dict) following structure: { "_id": { "$oid" : "521b1fabc36b440cbe3a6009" }, "country": "brazil", "id": "96371952", "latitude": -23.815124482000001649, "longitude": -45.532670811999999216, "name": "coffee", "users": [ { "id": 277659258, "photos": [ { "created_time": 1376857433, "photo_id": "525440696606428630_277659258", }, { "created_time": 1377483144, "photo_id": "530689541585769912_10733844", } ], "username": "foo" }, { "id": 232745390, "photos": [ { "created_time": 1369422344, "photo_id": ...

python - How to copy to specific path over ssh to a Windows server with Fabric? -

how can copy file or folder on ssh specific folder (absolute path) in remote windows server ? possible use remote server's environment variables specify path? if use fabric's put operation: put('somedir') or put('somedir', '.') without destination, create folder in user's desktop folder in destination , copy contents (i have no idea why default folder, , couldn't change through freesshd daemon used on windows server) if try using: put('somedir', '/users/me') put('somedir', 'c:/users/me') put('somedir', './testdir') or: put('somedir', 'c:\\users\\me') it fail permission denied (an error in paramiko's sftp_client.mkdir).

nosql - Understanding Eventual Consistency in Cassandra from theory -

i on way writing bachelor thesis. therefore concerned consistency in theory , how cassandra applies theory. understand problem, consider following definitions of consistency (as far understood): causal consistency: a system provides causal consistency if memory operations potentially causally related seen every node of system in same order. (wikipedia) so if process writes data x db , after process b reads data x , overwrites y, causal consistency ensured if b gets x after on replicas (resp. nodes). read-your-write consistency: this special case of causal consistency. hereby reading , writing processed on same process a. type of consistency ensures never have older object of data after modification. session consistency: in case process accesses db in session. long session exists, system guarantess read-your-write consistency monotonic read consistency: if process gets specific data object after reading, system guarantees process on every subsequent read-acce...

Using EXTENT SIZE + NEXT SIZE for TEMP tables will impact performance in informix DB? -

i want know if there performance impact if using extent size, next size while creating temp tables in informix db. that smells premature optimization me. in 20 years of writing informix sql, don't think i've ever found need set extent size or next size on explicitly created temp table. assuming have dbspaces on decent speed disks allocated temporary tables, there's aren't many performance tuning options. temporary tables aren't logged in first place, there's not lot of overhead. the theoretical benefit in declaring extent size might ensure there sufficient temp space available before commencing long running query, seems blunt instrument. not guarantee won't run out of space anyway, , simultaneously allocates space unavailable other queries. said, classic example of premature optimization. long story short, answer no, there's no performance benefit in setting size attributes.

c++ - Lua C API: what's the difference between lua_gettop() and -1? -

i don't understand stack exactly. lua_gettop() returns index of top element in stack. because indices start @ 1, result equal number of elements in stack (and 0 means empty stack). so what's difference between , -1? lua_getglobal(l,"foo"); if( lua_isfunction(l,lua_gettop(l)) ) { lua_getglobal(l,"foo"); if( lua_isfunction(l,-1) ) { you can imagine stack growing bottom, bottom (i.e., first pushed) element having index 1, push element (index 2), 1 (index 3), etc.. have situation: +-----------------------+ | element index 6 | <-- top ("relative" index -1) +-----------------------+ | element index 5 | <-- -2 +-----------------------+ | element index 4 | <-- -3 +-----------------------+ | element index 3 | <-- -4 +-----------------------+ | element index 2 | <-- -5 +-----------------------+ | element index 1 | <-- bottom ("relative" index -6 ) +-----------------------+ you "normal i...

xaml - Customize scrollbar of listbox in metro apps -

in our metro style apps, using listbox , want customize scrollbar , means height, width , color of scroll (horizontal , vertical). there example task ?? have searched lot couldn't example.please help. you need customize own scrollviewer first , add style of listbox . below listbox 's default style , after scrollviewer 's default style. <style targettype="listbox"> <setter property="foreground" value="{staticresource listboxforegroundthemebrush}" /> <setter property="background" value="{staticresource listboxbackgroundthemebrush}" /> <setter property="borderbrush" value="{staticresource listboxborderthemebrush}" /> <setter property="borderthickness" value="{staticresource listboxborderthemethickness}" /> <setter property="scrollviewer.horizontalscrollbarvisibility" value="disabled" /> <setter proper...

c# - Webclient image upload to server -

this follow on last question ( here ) don't think gave enough information first time around , can't delete it. i've got image converted byte array follow on , suggestions made seem image wanted save needed first exist on computer. where, in fact, image want take exists in picture box (its screen grab). when check server see if image has been passed over, don't see , nothing prompts me name image file or anything. so question thus: what best way upload screen grab application, using webclient, central server? ideally functionality similar of saving image computer. difference is, it's not hard drive i'm saving image on. it's server somewhere.

c# - Multiple Awaits in a single method -

i have method this: public static async task saveallasync() { foreach (var kvp in configurationfilemap) { using (xmlwriter xmlwriter = xmlwriter.create(kvp.value, xml_writer_settings)) { fieldinfo[] allpublicfields = kvp.key.getfields(bindingflags.public | bindingflags.static); await xmlwriter.writestartdocumentasync(); foreach (fieldinfo fi in allpublicfields) { await xmlwriter.writestartelementasync("some", "text", "here"); } await xmlwriter.writeenddocumentasync(); } } } but i'm struggling follow happen when calls saveallasync() . what think happen this: when first calls it, saveallasync() return control caller @ line await xmlwriter.writestartdocumentasync(); then... when await saveallasync() (or wait task)... happens? saveallasync() still stuck on first await until called? because ...

binary search tree c++ searching operation always giving 0; -

in bst,the searchbst function searching function returning 0 always. not giving 5 or 8 have programmed error in code because of problem there #include<iostream> using namespace std; struct bstnode{ bstnode *lchild; int data; bstnode *rchild; }; void creatbst(bstnode *&t,int k){ if(t=='\0'){ t=new(bstnode); t->data=k; t->lchild='\0'; t->rchild='\0'; } else if(k<t->data){ creatbst(t->lchild,k); } else if(k>t->data){ creatbst(t->rchild,k); } } int searchbst(bstnode *t,int k){ if(t=='\0') return 5; else{ if(k<t->data) searchbst(t->lchild,k); else if(k>t->data) searchbst(t->rchild,k); else return 8; } } int main(){ bstnode *t; t='\0'; creatbst(t,36); creatbst(t,20); creatbst(t,75); creatbst(t,42); creatbst(t,8); creatbst(t,31); ...

java - Liferay: Get URL in portal.normal.vm from properties file -

i have problems read info properties file "liferay-portal-6.1.0/tomcat-7.0.23/lib/myweb-application.properties" in portal_normal.vm myweb-application.properties: redirect.docs.url = http://stackoverflow.com/questions/ask "liferay-portal-6.1.0/tomcat-7.0.23/webapps/web-theme/templates/portal_normal.vm": #set ($docsurl = $propsutil.get("redirect.docs.url")) <a href="$docsurl">#language("foot.docs")</a> propsutil (or $propsutil) accesses portal.properties , typically configured through portal-ext.properties . unless add myweb-application.properties "external properties" file, propsutil won't find it. one way add line portal-ext.properties : include-and-override=/path/to/myweb-application.properties but make sure it's not using same keys portal.properties different purposes.

android - How to prevent an ad blocker in our apps? -

as know, many people using custom roms. custom roms ve changed hosts file blocking access(sends requests 127.0.0.1 ads) admob. is there way overcome ? perhaps not possible change hosts file programmatically maybe can define ip admob in our apps,cant we? such issues doing prevent adblocker? i wouldnt prefer block app using users if app detects adblocker. i think worrying needlessly. less 1% of people using custom roms or ad blockers (stats compiled myself after being concerned this). want code 1% of eventualities or want invest time in more functionality?

asp.net mvc - AttributeRouting WebAPI Now Producing Errors -

i've updated (from v3.x) latest version of attributerouting on webapi project , it's started produce errors i've never seen before. now whenever call made api error this: system.invalidoperationexception: constraint entry 'inboundhttpmethod' on route route template 'my/path' must have string value or of type implements 'ihttprouteconstraint'. @ system.web.http.routing.httproute.processconstraint(httprequestmessage request, object constraint, string parametername, httproutevaluedictionary values, httproutedirection routedirection) @ system.web.http.routing.httproute.processconstraints(httprequestmessage request, httproutevaluedictionary values, httproutedirection routedirection) @ system.web.http.routing.httproute.getroutedata(string virtualpathroot, httprequestmessage request) @ attributerouting.web.http.framework.httpattributeroute.getroutedata(string virtualpathroot, httprequestmessage request) @ system.web.http.webhost.routi...

javascript - cannot upload files and vars with xhr2 and web workers -

i try create code upload files using xhr2 , web workers. thought should use web workers , if file big, web page not freeze. this not working 2 reasons, never used web workers before, , want post server file , vars @ same time, same xhr. when vars mean name of file, , int. heres got client side //create worker var worker = new worker('fileupload.js'); worker.onmessage = function(e) { alert('worker says '+e.data); } //handle workers error worker.onerror =werror; function werror(e) { console.log('error: line ', e.lineno, ' in ', e.filename, ': ', e.message); } //send stuff worker worker.postmessage({ 'files' : files, //img or video 'name' : nameofthepic, //text 'id':imageinsertid //number }); inside worker (fileupload.js file) onmessage = function (e) {var name=e.data.name; var id=e.data.id ; var file=e.data.files; //create var catch anser of server var datax; var xhr = new xmlhttprequest...

Move text over image using CSS -

i've been able text on top of image top left using. .block1 img {position:relative:} and use .text {position:aboslute; top:0;} with success. problem have sticky navigation bar has position:fixed applied it. images go overtop of sticky navigation bar. is there way around this? edit: fiddle http://jsfiddle.net/wcwbv/4/ this should replicate problem closely. thanks everyone! z-index:1; on stick navigation bar works perfectly. :)

css - Animating tooltip fade in and out -

how can make tooltip show , hide fade? have tried add: transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; -webkit-transition: opacity .25s ease-in-out; but no luck, here code tooltip css: .mainbuttoncontainer button:hover:after { background: none repeat scroll 0 0 rgba(255, 255, 255, 0.7); border-color: #093466; border-radius: 5px 5px 5px 5px; border-style: solid; border-width: 7px 2px 2px; bottom: -5px; color: #093466; padding: 5px 15px; position: absolute; width: 113px; z-index: -1; } html: <button id=mgf_main1 type="button" onclick="loaddata(1)"> <img src="images/magof-icon.png" width="68" height="68"/> </button> jsfiddle.net/rdrhs you need move describes element button:after , , change properties change on hover in button:hover:after . fiddle button:after { opacity: 0; -webkit-transition: opacity ...

symfony - build form for tables with many relations -

Image
i have got problem build forms many relations between tables. structure of relations can see on below picture: my relations in yml: ######### products.orm.yml ######### type: entity table: products fields: ... lifecyclecallbacks: { } onetomany: productcombinations: targetentity: productscombinations mappedby: product ######### productscombinations.orm.yml ######### type: entity table: products_combinations fields: ... lifecyclecallbacks: { } onetomany: productattributes: targetentity: productsattributesjoin mappedby: productcombinations manytoone: product: targetentity: products inversedby: productcombinations joincolumn: name: product_id referencedcolumnname: id ######### productsattributesjoin.orm.yml ######## type: entity table: null fields: combinationid: type: bigint column: combination_id id: true generato...

php - need ideas for remote authentication (Wordpress) -

i need redirect authenticated users wordpress site #1 wordpress site #2, , have them authenticated site #2 when land there. iow, don't want them have authenticate twice because i've relocated app #1 #2. wordpress user tables replicated between 2 sites, may or may not within same domain. any ideas on how accomplish this? (i can write wordpress plugins) i don't know enough wordpress answer definitively, possible use openid in sso (single sign-on) model wherein 1 of wordpress sites (say wp1) acts openid provider wp2. once user agrees share credentials wp2 should logged in automatically. method of authentication stack exchange uses; if logged in on stackexchange.com automatically logged in on of other sites provided have account. janrain provides library php openid i've heard things about, (although i've never used it, have used openid c#).

php - Why am I getting this error -

the path of filename correct, reason i'm getting error below when run script .. phpinfo shows me imagick installed ...and downloaded ghostscript i'm not sure if detects .. did downloading computer .. there i'm missing ? i'm confused on how ghostscript work php fatal error: uncaught exception 'imagickexception' message 'can not process empty imagick object' in c:\xampp\htdocs\tms\test_php.php:7 stack trace: #0 c:\xampp\htdocs\tms\test_php.php(7): imagick->setimageresolution(1250, 1250) #1 {main} thrown in c:\xampp\htdocs\tms\test_php.php on line 7 php code: //echo phpinfo(); $filename = dirname(__file__).'\_media\4055-beckman-lead-app\client\fpo.pdf'; echo $filename; $im = new imagick( $filename, 0777); $im->setimageresolution(1250,1250); $im->setimagecolorspace(255); $im->setcompression(imagick::compression_jpeg); $im->setcompressionquality(100); $im->setimageformat('jpeg...