Posts

Showing posts from June, 2011

internet explorer - IE10 not using correct priority for max-width and min-width -

i'm creating responsive website , want images take @ 2/3 of column, not smaller 300px wide (or larger original image width). i'm using following css: img {max-width:66%;min-width:300px;} in chrome + firefox, works - starting wide, image displays @ uploaded size; when 2/3 of column, starts shrinking until hits 300px, doesn't shrink further. in ie10, image continues shrink past 300px - ignores 300px altogether. is there way ie10 can understand min-width should take priority? fiddle: http://jsfiddle.net/whdsm/3/ note using width:66% isn't option, since there no way of saying 'don't display larger uploaded'. you don't need set max-width in case, width . img { width: 66%; min-width:300px; } works in ie10: http://jsfiddle.net/whdsm/9/ "note using width:66% isn't option, since there no way of saying 'don't display larger uploaded'." there's bit of logic issue here well. max-width ...

Cassandra Data Structure -

i need understand in detail how design efficient data structures in cassandra. there online demo or tutorial understanding data structure of cassandra? need able design column families columns , payloads, , see specific, tangible examples. i'd appreciate if recommend source allow me this. in several thousands of classes make cassandra codebase, doubt c*'s performance can attributed single data structure. topic bit complicated single online demo, however... what better source source... start looking through code , checkout data structures used. data in memory stored in called memtable sorted string table (sstable). in-memory data flushed disk , again stored in sstables. so question comparrison between binary tries , sstables indexing columns in db. the other data structure found interesting merkle tree, used during repairs. hashed binary tree. there many advantages , disadvantages when using merkle tree, main advantage (and guess disadvantage) reduces how data ...

Unable to get MPEG-DASH working using cast-android-sample -

i'm having difficulty getting mpeg-dash sample play using cast-android-sample . it's reproduced adding dash sample mediaadapter:addvideos() method . here 3 known mpeg-dash samples used try working: mvideos.add(new castmedia("car mpeg-dash video", "http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-manifest.mpd")); mvideos.add(new castmedia("simple mpeg-dash video", "http://download.tsi.telecom-paristech.fr/gpac/dash_conformance/telecomparistech/mpeg2-simple/mpeg2-simple-mpd.mpd")); mvideos.add(new castmedia("mpeg-dash sample", "http://www.digitalprimates.net/dash/streams/gpac/mp4-main-multi-mpd-av-nbs.mpd")); attempting play these generates error of form in logcat: 18147-18147/com.example.castsample e/mediaprotocolmessagestream: error parsing message: {"type":"response","cmd_id":24,"status":{"error":{"domain":"ramp",...

Floating Video Player in android? -

i have added vitamio player in android application. , works fine. there method in vitamio or other player can make player floating on other apps , resizable this one? the technique described in stackoverflow post can used create these types of floating windows. there excellent standout library, given 1 of answers in post, implements nice api.

ios - Audio to wave form Conversion -

i want build app in require convert audio wave form. something auriotouch2 apple sample code. sample apple complicated understand. want simple solution conversion of audio waveform. my basic requirement convert audio heartbeats sound waveform of ecg. can me better sample code or tutorial regarding this.

javascript - Sort array in ascending order while eleminating repeated values -

i'm working on project have array simmilar this var sortbp = [ 'height58em', 'width480px', 'width768px', 'width959px', 'width767px', 'width767px' ]; i want sort array in ascending order while eleminating repeated values result should var sortbp = [ 'height58em', 'width480px', 'width767px', 'width768px', 'width959px' ]; i'm using following function sort array in ascending array how eliminate immediate values ?? (in above case 'width767px' ) var sortbp = bparrays.sort(function(a, b) { = a.replace(/[a-z]/g, ''); b = b.replace(/[a-z]/g, ''); return - b; }); firstly, can't eliminate elements while sorting. have sort array first, remove duplicates. solution using array.prototype.filter , array.prototype.indexof might unsorted array, since array sorted, it's overhead here(takes o(n)...

php - prevent popup-box to open in kendo grid -

i want stop opening popup-boxes in cases. mean on specific condition should open , shouldn't in kendo grid. using javascript , jquery this. using js 1.7.1 of kendo. $('.k-grid-add').on("click", function () { if(val==-1) { alert('please select agent'); //here want prevent popup-box } }); use return false; $('.k-grid-add').on("click", function (e) { if(val==-1) { alert('please select agent'); return false; } });

c# - How to select first n number of columns from a DataTable -

i have datatable containing dynamic number of rows , dynamic number of columns, col1 col2 col3 col4............coln ________________________________________________________________________ row1col1 row1col2 row1col3 row1col4........row1coln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . rowncol1 rowncol2 rowncol3 rowncol4.......rowncoln how select data first n number of columns datatable? to columns: var tbl = new system.data.datatable(); var cols = tbl.columns.cast<system.data.datacolumn>().take(20); // if wish first 20 columns... if want data, have loop through columns data. var data = cols.selectmany(x => tbl.rows.cast().take(100).se...

json - Can Jackson handle serialize and deserialize to java Object type -

i have structure list<map<string, object>> or can wrap it public static class testwrapper { list<map<string, object>> list; public testwrapper() { } public list<map<string, object>> getlist() { return list; } public void setlist(list<map<string, object>> list) { this.list = list; } } how jackson know deserialize value type of objects map value? if configurable, how config using annotaions? let me explain how works using below classes , example json string. let assume, have 2 classes below: class testwrapper<t> { private list<map<string, t>> list = new arraylist<map<string, t>>(); public list<map<string, t>> getlist() { return list; } public void setlist(list<map<string, t>> list) { this.list = list; } } class entity { private long id; public long getid() { ...

linux - Git revert a commit that has some other commit depending on it -

let's have commit a , b , , b depends on a 's modification. want revert a , successful? also, happen if line added 'a' no longer present? git report revert resulted in conflict. git status show unmerged paths. you can resolve conflict other. edit example: $ mkdir foo $ cd foo $ git init $ echo "this line in file" > blah $ echo "this second line in file" >> blah $ echo "this third line in file" >> blah $ git add blah $ git commit -m "first commit" # edit second line in blah $ git commit -am "second commit" # remove second line blah $ git commit -am "third commit" $ git revert head^ #revert second commit error: not revert 4862546... change hint: after resolving conflicts, mark corrected paths hint: 'git add <paths>' or 'git rm <paths>' hint: , commit result 'git commit' $ git status # on branch master # unmerged paths: # (use "gi...

jquery - how to select closest class and its id with closest method -

<div id="demo"> <div class="moduletable"> <div class="demo"> <div class="demo-wrap"> <div class="container" id="button-1">button-1 contents</div> <div class="ctrl"> <div><a href="#buttton-1">button-1</a> </div> </div> </div> </div> </div> </div> jquery $('ctrl').click(function(){ $(this).closest('.container #button-1').width(); // how select class container first , id button-1 } edit <div class="container" id="button-1">button-1 contents</div> <div class="container" id="button-2">button-2 contents</div> <div class="ctrl"> <div><a href="#b...

html - Prevent iframe from loading "src" page upon refreshing -

i'm creating static website , using iframes. problem is, when navigate page, example, code iframe: <iframe marginheight="0" align=top src="aboutus1.php" frameborder=0 scrolling=no border=0 width=800 framespacing=0 id="bodyframeid" name="bodyframename" onload="autoresize('bodyframeid');>" ></iframe> the src attribute pointing aboutsus1.php. now, when navigate page, example, go aboutus2.php reload page, goes aboutus1.php executed src="aboutus1.php" . question is, how stay on current page (aboutus2.php) if reload page? edit: click here live example click link above. first page see about cti . now, try clicking on partners menu refresh page. goes about cti page. how prevent going about cti page when page reload? you store current page location in session, , on reload load url stored in session. you'd need server side technology. in html don't store things. might able us...

asp.net mvc 4 - Telerik grid tabstrip remains disable -

we had application in mvc 3 working fine.but have converted mvc 4 .but tabs in grid not working/opening . when tab clicked displays #tabstripedit-3 in url . 3 means 3rd tab clicked . showed in url , remain @ first tab . i have searched lot. can getting answer.kindly help.thanks in advance.i had posted question yesterday no 1 answered me. thats y posting again because high priority task me.

objective c - Multiple colors in NSTextField -

i need change color words repeating in each line in nstextfield. i'm using dictionary separate each line , dictionary has , array separates words data, i'm checking if words repeated , want change color or highlight words repeating.. not sure how it. the program word frequency , show type-token, mean frequency , words repeating (text colour/highlighted) any great. right i'm assigning text text field .txt file imported. got repeating words , everything.. need show which. current code: -(nsmutabledictionary*) computewords:(nsmutabledictionary *)linesdic{ int count = (int)[linesdic count]; int numberofwords = 0; int numberofdiffwords = 0; nsmutabledictionary* wordcomputation = [[nsmutabledictionary alloc]init]; nsmutabledictionary* duplicates = [[nsmutabledictionary alloc]init]; (int x = 1; x<=count; x++) { nsmutablearray* duplicatewords = [[nsmutablearray alloc]init]; nsmutablearray* counter = [[nsmutablearray alloc]init]...

javascript - Resizing and compressing AJAX images in Node/AngularJS application -

i'm building app in angularjs, built on node/expressjs. have list of images hosted externally (and have no access them compress them @ source). the issue is, these images quite large - ~200kb 600x600 image. don't want serve such large files users, on mobile data caps , whatnot. is there service (or node module) allow middleman-style way of compressing images angularjs serves user? google pagespeed service (a surprising number of people haven't heard of this, check out, it's awesome) absolutely perfect, except doesn't work ajax images/angularjs. you have services http://kraken.io/ - matter of hooking url pattern api call optimized image. problem such services aren't scalable (at least cheaply), since using third party bandwidth , processing power. i advice caching files somehow, on side of things, though. or other way around - hook optimizing changes image list, , serve optimized files end. doing angular doing each user's computer: limi...

asp.net - A generic error occurred in GDI+ when viewing a 1200 Dpi Tiff Image -

i have created tiff viewer , can view tiff images. except when @ high resolution 1200 dpi. there workaround in code causing problem? public function gettiffimage(path string, page integer) image dim ms memorystream = nothing dim srcimg image = nothing dim returnimage image = nothing try srcimg = image.fromfile(path) ms = new memorystream() dim frdim new framedimension(srcimg.framedimensionslist(0)) srcimg.selectactiveframe(frdim, page) srcimg.save(ms, imageformat.tiff) returnimage = image.fromstream(ms) catch ex exception throw ex srcimg.dispose() gc.collect() gc.waitforpendingfinalizers() end try return returnimage end function thanks in advance in experience error message misleading , it's caused outofmemoryexception . i'd wager you're losing memory because you'...

c++ - How to write VLC plugin that can interact with the operating system -

i need find out if possible , how (i not care language c/c++, lua, python ...) make vlc plugin purpose called vlc player , @ specific times of video stream action. the action need open udp socket , send data read file comes along video played. i need make subtitle reader on it's best can initialize udp socket , send read data server. i not sure creation of udp socket possible in lua maybe better option binary c/c++ plugin can't find example. in general @ best requirements are: load settings file @ vlc launch need triggered player @ specific times of video stream get file name of source video stream open file (script) same name different extension open udp socket compose message send message continue loop until end of video stream any information, example or site, link appreciated. looks like create control interface module. written in c/c++ within vlc context , in turn need (re-) compiled each platform target. have @ audioscrobbler module see h...

android - java.lang.NoClassDefFoundError: org.jboss.netty.bootstrap.ClientBootstrap -

i using http://fyrecloud.com/amsler#mysql_replication replicate mysql sqlite when tried run faced error after clicking start sync button 07-31 11:36:35.243: e/androidruntime(7158): fatal exception: main 07-31 11:36:35.243: e/androidruntime(7158): java.lang.noclassdeffounderror: org.jboss.netty.bootstrap.clientbootstrap 07-31 11:36:35.243: e/androidruntime(7158): @ com.fyrecloud.amsler.synchronizer.init(synchronizer.java:67) 07-31 11:36:35.243: e/androidruntime(7158): @ com.fyrecloud.amsler.synchronize.oncreate(synchronize.java:54) 07-31 11:36:35.243: e/androidruntime(7158): @ android.app.activity.performcreate(activity.java:5008) 07-31 11:36:35.243: e/androidruntime(7158): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1089) 07-31 11:36:35.243: e/androidruntime(7158): @ android.app.activitythread.performlaunchactivity(activitythread.java:2023) 07-31 11:36:35.243: e/androidruntime(7158): @ android.app.activitythread.handlelaunchact...

Overwrite method inside an objective-c class as in Java -

i use statement extending class without needs of writing whole separate file. supposing classfromframework class being part of framework included in library. public classfromframework { public string mymethod() { // operations } //lot of other methods.... } then in class following: import com.framework.classfromframework; public myclass { public void method() { classfromframework m = new classfromframework() { @override public string mymethod() { // operations... } } m.mymethod(); } } i wonder if can achieve same objective-c without declaring new combination .h .m files , import in using class. you can make new subclass, , override methods, new classes must in own .h & .m files. that's how obj-c operates. in case, make sense have additional files. you can call parent method word super. done time when subclassing viewcontroller, such in viewdidload.

model view controller - Writing a MVC application with Perl CGI -

i have client wants me design new web app scratch the problem wants me use core modules come perl (5.10 or 5.12) is there way write mvc apps cgi? i know catalyst, mojolicious , dancer , how easy mvc them, have no clue on how cgi alone are there code examples see , inspire from? (i've googled didn't find use) also, mojo , dancer, there way can generate links (routes mojo, , rails) cgi? thanks first off, what's reason "core modules only" restriction? mean can't write new modules of own? effective solution undoubtedly convince client let use cpan. if you're allowed write own non-core modules, able away including new module named "prancer" looks suspiciously dancer? (i.e., grab dancer source tree , s/dancer/prancer/g across whole thing, add project.) but, if else fails... yes, it's possible @ least use mvc principles , strong separation of concerns under cgi.pm, although won't have actual framework helping un...

Swiftmailer crashes without php error -

i have web app allows user upload pdf , email via swiftmailer. pdfs, process fails. i can verify crashes php script, yet returns no php error. there's 500 error server, if there's 500 error, php has log of error was. i have verified crashes @ $mailer->send($message); line oddly, pdfs crash it, , same pdfs work fine on development server identical code. what causing php crash without error message? after running several tests, found error logging happening of time, not others. didn't figure out why so, however, tried renaming php-errors.log file php start new, fresh log file, , errors getting logged properly. don't know why worked, i'll take it.

http - Failing to connect to a web server with Java -

i got strange task: connect webserver using java though i'm php programmer. used program java @ university it's been few years since. i took code sample stack-overflow. runs fine, no compilation errors no exceptions, but, don't see outgoing connection when sniff fiddler, , server side script doesn't see incoming connections either. any ideas of can wrong? or, how debug situation? string urlparameters = "param1=a&param2=b&param3=c"; string request = "http://example.com/index.php"; url url = new url(request); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setdooutput(true); connection.setdoinput(true); connection.setinstancefollowredirects(false); connection.setrequestmethod("post"); connection.setrequestproperty("content-type", "application/x-www-form-urlencoded"); connection.setrequestproperty("charset", "utf-8"); connection.setrequ...

linux - Vagrant chicken-and-egg: Shared folder with uid = apache user -

my vagrant box build base linux (scientific linux), during provisioning (using shell scripts), apache installed. i changed vagrant file (v2) to: config.vm.synced_folder "public", "/var/www/sites.d/example.com", :owner => "apache", :group => "apache" which works if box provisioned , rebooted. now, after vagrant destroy && vagrant up error: mount -t vboxsf -o uid=`id -u apache`,gid=`id -g apache` /var/www/sites.d/example.com /var/www/sites.d/example.com id: apache: user not exist which clear - during initial run, apache not yet installed. an ugly workaround of course basic provisioning synced_folder commented out, comment in , reboot. is there clean trick solve that? in way vagrant up runs without interruptions, if box new. ryan sechrest has dealt extensively problem . one of presented solutions is: set permissions of directories 777 , files 666 config.vm.synced_folder "/users/ryan...

zend framework2 - ZF2 trigger service or event in background -

maybe knows how best tackle problem. i have zf2 application in client can upload file. file contains orders , needs processed. if trigger event starts processing file right away, client cannot move on (to other things). trigger event in background starts processing file while action returns next page client or can go on , fill in other stuff. of course can solve cron jobs... maybe there way zf2 more event driven? possible trigger event (or service) in background so: public function csvuploadaction() { $id = (int) $this->params()->fromroute('id', 0); $form = new csvform($id); // validating , stuff... if ($form->isvalid()) { // more stuff.. $this->geteventmanager()->trigger('readcsvinbackground', $this, $parameters); return $this->redirect()->toroute('publications', array( 'action' => 'edit', 'id' => $id )); // etc.. } i have...

asp.net mvc - Directory browsed instead of showing view -

i have project on tested stuff related experimentation: .net mvc - controller/view , physical path? now can't display normal mvc view: on http://mvc4testsomething/folder/index , view displayed. on http://mvc4testsomething/folder/ , "http error 403.14 - forbidden" error. here's current routes: routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( "default", "{controller}/{action}/{id}", new { controller = "home", action = "index", id = urlparameter.optional } ); routes.maproute( "folder", "folder/{action}/{id}", new { controller = "folder", action = "index", id = urlparameter.optional } ); web.config has: <directorybrowse enabled="false" showflags="date, time, size, extension" /> if change directorybrowse t...

gsp - grails: scaffolding create view for domain with hasMany relation -

let's assume following (simplified) domain classes: class person { static hasmany = [stringproperties: stringproperty] static constraints = { } } and class stringproperty { string name string value static constraints = { name blank:false value blank: true } } when scaffolding generates create view, there no option in gsp create stringproperty person. does plugin exist or know best practice, can render sort of create ui allows create members of hasmany relation. i'm asking before take time modify scaffolding templates. this 1 of areas plugin or enhanced scaffolding welcomed community. if had time take information presented here , make plugin it. have used approach few times , works well.

coldfusion - selectTag() is not prepending to label in CFWheels -

in cfwheels settings.cfm , have following code: set(functionname="selecttag", labelplacement="before", prependtolabel="<div class='field field-select'>", append="</div>", appendtolabel="", class="field-select"); set(functionname="select", labelplacement="before", prependtolabel="<div class='field field-select'>", append="</div>", appendtolabel="", class="field-select"); in form view have following code: <cfoutput>#selecttag(name="pin[typeid]", options=types, objectname="pin", property="typeid")#</cfoutput> however, in generated output, html within prependtolabel attribute not outputted. append attribute is working though; of course breaks formatting / layout of page. output html <select class="field-select" id="pin-typeid" ...

c# - How to exit test with failer even if there is catch around it? -

problem is: need exit test fail message. using microsoft.visualstudio.testtools.unittesting assert.fail("message"); gets caught via try catch. can done exit test failer not catchable? say test has inside: ...remoteservereventhandler(e => /*some logic */ assert.fail("message")) yet gets handeled via servereventhandler while want exit failure in test. in catch block, @ end should write throw , re-throw same exception in calling function or next block executing.

arrays - need a batch to search in all available drives and display a file which is in one or more places -

need windows batch file search in available drives , display file in 1 or more places. how below thing using array? my scenario: check drive:/programfiles/test/config.xml in available drives(a,b,..z). if file exits in 1 or more place ,list discovered files in c:/programfiles/test/config.xml e:/programfiles/test/config.xml in way has check each , every drive , has display if file there. then have choose option list ie 2 use e:/programfiles/test/config.xml . so should return me u have selected e:/programfiles/test/config.xml . vijai k you can iterate on lists of items for : for %%d in (c d e f g h ... x y z) you can check file existing if exist filename : if exist %%d:\programfiles\test\config.xml and use echo output text: echo %%d:\programfiles\test\config.xml this should give enough write batch file yourself.

Ruby on rails How to remove added columns and insert new columns through a migration file -

hi created ruby on rails migration file follows , in first stage created tables then want add columns , remove columns , modified follows class createmt940batches < activerecord::migration def change create_table :mt940_batches |t| t.string :account_number t.string :transaction_reference_number t.string :information_to_account_owner t.string :file_name t.binary :raw_data_transaction t.string :sha1_checksum t.timestamps end def self.down remove_column :account_number, :transaction_reference_number, :information_to_account_owner end def self.up add_column :mt940_batches, :created_by, :updated_by, :integer end end end but when ran rake db:migrate nothing has happens. how accomplish task . want change model created migration file. um looking way this. thank in advance you should add remove / add column in separate migration file. class foomigration < activerecord::migration def down rem...

asp.net - Invalid Object Name Error in Function in SQL -

i have following function defined alter function [dbo].[getxmlvalues](@business_id int, @id varchar(30)) returns varchar(30) begin declare @xmlvalue varchar(30) set @xmlvalue = (select top 1000 t.content.value('(/xmldatapairdocument/dataitem[@id=sql:variable("@id")]/@value)[1]', 'varchar(100)') tblapplications t t.business_id =@business_id) return @xmlvalue end when hit f5 command executes successfully/... but when try execute using following query : select * [getxmlvalues](1,'sadfj') it shows error saying : invalid object name 'getxmlvalues'. what reason ? , error?? this scalar function, not table-valued function. select dbo.[getxmlvalues](1,'sadfj') should work. you can't treat table, i.e. select * ... , need select result directly above. see types of functions more details.

uploading a file from iOS mobile application to SharePoint -

i'm working on sharepoint mobile solution i'm using web services exposed in server/_vti_bin/sitedata.asmx , server/_vti_bin/lists.asmx , server/_vti_bin/copy.asmx . i'm able fetch list of sites , document libraries , files using services defined in server/_vti_bin/sitedata.asmx . i'm trying upload image file photo albums available in ios sharepoint . this, tried using copyintoitems web service, in i'm getting following error response. <copyresult errorcode="destinationinvalid" errormessage="the copy web service method must called on same domain contains destination url." destinationurl="http://xxxxserveripxxxxxx/shared documents/image1.png"/> but came know service used if file uploaded same source(i.e., sharepoint). there other way upload file available in iphone sharepoint. also tired addattachment service defiend in server/_vti_bin/lists.asmx i'm unable identify input parameters requires list name , l...

xcode - Apple Mach-O Linker Error (Cannot built my app when i select iOS device) -

Image
i built app uses zbarsdk barcode scan, app works fine when running on simulator, when try archive on real device error shows up: you compiling app armv7s architecture zbarsdk isn’t compiled armv7s . either compile zbarsdk armv7s (preferred) or don’t compile app armv7s .

c# 4.0 - how to add a new option to context menu of hyperlink in an email for Outlook 2010? -

i did add new menuitem hyperlink context menu. need find hyperlink right-clicked. what got whole email item office.iribboncontrol.context, outlook.explorer 1 selection. selection turns out outlookitem. it have email body. may have multiple hyperlinks in inside it. must way hyperlink because other menu items work: open, select, copy hyperlink. any ideas? sunday has passed, sorry. i´ve had same problem , found following solution: public void oncustomhyperlinkmenuclick(iribboncontrol control) { explorer explorer = control.context explorer; if (explorer != null) { document document = explorer.activeinlineresponsewordeditor; if (document != null && document.windows != null && document.windows.count > 0) { microsoft.office.interop.word.selection selection = document.windows[1].selection; if (selection != null && selection.hyperlinks != null &...

maven - Converter class in sub-project not found in main project -

i'm working on large project consists of 10 sub-projects. we're using eclipse development, jboss 7 app. server. our projects use jsf 2.1, spring 3.2, hibernate 4.2 , primefaces 3.3 jsf implementation. there 2 "core" projects other projects references, , these projects referenced other 8 projects, , 1 project -let's project a- (of 8) references 1 -let's project b-. now, problem is; project uses entities of "core" projects , project b includes jsf converters. when try use entity in selectonemenu, "converter" not found error. (note: converters working!) i added converter definition project b's faces-config.xml, still same error. how can use converters other project? thanks. here "getasobject" method : @override public object getasobject(facescontext facescontext, uicomponent uicomponent, string value) { if (value == null || value.trim().equalsignorecase("")) { ret...

c# - Check if a DLL is changed after memory load -

i'm try find fast , effective way allow dll check if code it's changed on memory. i'd inserted thislib.dll class function tht use like: var assembly = assembly.getexecutingassembly(); module[] thismodule = assembly.getloadedmodules(); foreach (module in thismodule) { if (i.name == "thislib.dll") { modulehandle m= i.modulehandle; byte[] dllmemory = new byte[??? how thislib.dll memory size ???]; dllmemory = ??? how thislib.dll memory data ??? } } i need check if hash(memory thislib.dll) equal hash(filesystem thislib.dll)!

Server Error in '/' Application. IIs -

server error in '/' application. the resource cannot found. description: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review following url , make sure spelled correctly. requested url: /account/examples/fio.aspx version information: microsoft .net framework version:4.0.30319; asp.net version:4.0.30319.18044 this page trying assess here now: http://localhost/<mysitename>/account/examples/fio.aspx but when writing , debugging site in visual studio ,everything worked fine , page here /account/examples/fio.aspx since morning.i have no idea how improve it. add below code web.config file. browser show full error message. <configuration> <system.web> <customerrors mode="off"/> </system.web> </configuration>

java - ThreadLocal & Memory Leak -

it mentioned @ multiple posts: improper use of threadlocal causes memory leak. struggling understand how memory leak happen using threadlocal . the scenario have figured out below: a web-server maintains pool of threads (e.g. servlets). threads can create memory leak if variables in threadlocal not removed because threads not die. this scenario not mention "perm space" memory leak. (major) use case of memory leak? permgen exhaustions in combination threadlocal caused classloader leaks . an example: imagine application server has pool of worker threads . kept alive until application server termination. deployed web application uses static threadlocal in 1 of classes in order store thread-local data, instance of class (lets call someclass ) of web application. done within worker thread (e.g. action originates http request ). important: by definition , reference threadlocal value kept until "owning" thread dies or if threadlocal no...

How to logout from a login page in asp.net -

whenever click on logout button redirect me login page when im clicking on button redirect me last visited page. not using membership or windows authentication. session.abandon(); response.cache.setcacheability(httpcacheability.private); response.cache.setcacheability(httpcacheability.nocache); response.redirect("loginform.aspx"); if using session destroy session value on logout button click , can put check in app webpages if(session["sessionvaribale"].equals(null)) { response.redirect("logoutpage url"); }

php - Replace uploaded document on confirm not working -

my requirement follows: when user uploads file should check " file exists ", if file exists must show confirm box if 'ok' have replace , if cancel reverse. following code if (file_exists($path . $documentname)) { $msg = $documentname . " exists. "; ?> <script type="text/javascript"> var res = confirm('file exists want replace?'); if (res == false) { <?php $msg = 'file upload cancelled'; ?> } else { <?php if (move_uploaded_file($_files["document"]["tmp_name"], $path . $documentname)) { $msg = $documentname . " file replaced successfully"; $successurl = $document_path . $documentname; } else $msg = $docu...

android - Relative Layout align an item below and to the middle of another item -

Image
i using relative layout , want align textview below , in middle of button shown in attached image. have can bottom using below, cant figure out how align horizontal centers. easiest way put image , textview relative layout <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:src="@drawable/ic_launcher" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/imageview1" android:layout_centerhorizontal="true" android:text="textview" />...

html - How to read whitespace element in XML node from java -

here sample code <myelement> </myelement> i try take above node value few spaces java variable, gives me empty string variable. how can read contain of xml node white space i not 100% sure, maybe helps you. presume have xml this <?xml version="1.0" encoding="utf-8" standalone="yes"?> <root> <myelement> </myelement> </root> as didn't tell you're using, made example in sax. aware not fastest way if have huge xml read. public class test { public static void main(string[] args) throws parserconfigurationexception, saxexception, ioexception { defaulthandler myhandler = new myhandler(); saxparserfactory factory = saxparserfactory.newinstance(); saxparser parser = factory.newsaxparser(); parser.parse(new file("empty.xml"), myhandler); } } the handlerclass callbacks: public class myhandler extends defaulthandler { private ...

html - Change free text sorting - OTRS ITSM -

hi want show free text fields in change overview , edited agentitsmchangeoverviewsmall.dtl file , added code change free text. change free text field visible in change overview enable sort can other attributes. here code: <th class="changefreetext1 $qdata{"css"}"> <a href="$env{"baselink"}action=$env{"action"};$data{"linksort"};sortby=changefreetext1; orderby=$lqdata{"orderby"}">$text{"changefreetext1"}</a> </th> <td> <div>$text{"$data{"changefreetext1"}"}</div> </td> can tell me whats missing in code. the backend kernel::system::itsmchange changesearch() not support ordering freetext fields, unfortunately, should add well.

android - how to set layout for a fragment? -

it's multi tap activity >> i'm trying set layout each tab doesnt work ! shows nothing in both tabs ! here's code public class game extends activity { public static context appcontext; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.game); //actionbar gets initiated actionbar actionbar = getactionbar(); //tell actionbar want use tabs. actionbar.setnavigationmode(actionbar.navigation_mode_tabs); //initiating both tabs , set text it. actionbar.tab roundtab = actionbar.newtab().settext("round 55"); actionbar.tab scoretab = actionbar.newtab().settext("score 55"); //create 2 fragments want use display content fragment roundfragment = new roundfragment(); fragment scorefragment = new scorefragment(); //set tab listen...

Copy comments that are after the end of root tag using XSLT -

i have xml needs reordered , stored in file. have done xslt , works fine. if there comments after xml ends these comments not copied. need xslt statement copies comments present after root tag ends below code explains following original xml <company> <employee id="100" name="john" > <salary value="15000"/> <qualification text="engineering"> <state name="kerala" code="02"> <background text="indian"> </employee> </company> <!--this file contains employee information--> <!--please refer file information employee--> xslt transformation code <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxs...

java - Multiple ports and threading -

i designing android software have listen n-amount of ports, lets 10. every 100ms want check out if ports have new udp-packet. after receiving packet, data inside should passed ui-thread. my question should use 1 thread receive data different ports or should create own thread every port, each timed run @ 100ms interval? practice in these cases? when port has data, deserialized object, used update data in views in ui-thread. i'm quite new socket-programming , more advanced concurrent-programming have been hesitating time without finding answers web. having thread per socket seems overkill , unless time de-serialize object excessive won't see benefit. personally (and bas pointed out; there's not in it) start out simple , have single thread checking 10 ports round-robin , sleeping between checks. if start find thread taking time processing data , time between each port being checked high can add more threads pool @ point.

android - Grid item not clickable -

i have used 1 gridview calendar in application.the gridview calendar working correctly , displayed element want.my problem when click grid item not clickable.thanks my gridview: <linearlayout android:id="@+id/gridlayoutid" android:layout_width="fill_parent" android:layout_height="fill_parent" > <gridview android:id="@+id/gridviewid" android:layout_width="fill_parent" android:layout_height="match_parent" android:horizontalspacing="-1px" android:numcolumns="7" android:stretchmode="columnwidth" android:textdirection="anyrtl" /> </linearlayout> my grid rows: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="200dp" android:layout_height="fill_parent" android:background="@drawable/gridcal" andr...

c# - DevExpress Updating on Gridview with combobox column -

<dx:aspxgridview id="grid" clientinstancename="grid" runat="server" keyfieldname="projectid" width="100%" enablerowscache="false" onrowupdating="grid_rowupdating" autogeneratecolumns="false" oncelleditorinitialize="grid_celleditorinitialize"> <settings showgrouppanel="true" /> <settingsediting mode="inline" /> <columns> <dx:gridviewcommandcolumn visibleindex="0"> <editbutton visible="true" /> </dx:gridviewcommandcolumn> <dx:gridviewdatatextcolumn fieldname="projectid" readonly="true" visibleindex="0"/> <dx:gridviewdatacolumn fieldname="projectname" visibleindex="1" /> <dx:gridviewdatacolumn fieldname="projectinfo" visi...

python - Error: command 'gcc' failed: No such file or directory -

i'm trying run a python setup.py build --compiler=mingw32 but results in error mentioned in subject: error: command 'gcc' failed: no such file or directory but capable of running gcc command prompt (i have added path env var): >gcc gcc: fatal error: no input files compilation terminated i'm running on windows 7 64-bit. python27. specific source i'm trying build: openpiv previous post on issue. any help/advice/solutions appreciated. after hours , hours of searching, i've discovered problem between mingw , python. don't communicate 1 another. there exists binary package of mingw (unofficial) meant use python located here it fixes problem!

Wait for process to finish before proceeding in Java -

essentially, i'm making small program that's going install software, , run basic commands afterwards prep program. however, happening program starts install, , moves on following lines (registration, updates, etc). of course, can't happen until it's installed, i'd find way of waiting on first process before running second. example, main.say("installing..."); process p1 = runtime.getruntime().exec(dir + "setup.exe /silent"); //wait here, need finish installing first! main.say("registering..."); process p2 = runtime.getruntime().exec(installdir + "program.exe /register aaaa-bbbb-cccc"); main.say("updating..."); process p4 = runtime.getruntime().exec(installdir + "program.exe /update -silent"); call process#waitfor() . javadoc says: causes current thread wait, if necessary, until process represented process object has terminated. bonus: exit value of subproce...

javascript - Bookmarklet not working on IE9 -

this code works on firefox , chrome not ie9. works on same domain in ie9 fails on other domains. console shows me script1002 : syntax error. have code in jsp , loading script tag using {domain}/path controller. ( function(){ var v = "1.9.1"; if (window.jquery === undefined || window.jquery.fn.jquery < v ) { var done = false; var script = document.createelement("script"); script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; script.onload = script.onreadystatechange = function(){ if (!done && (!this.readystate || this.readystate == "loaded" || this.readystate == "complete")) { done = true; initbookmarklet(); } }; document.getelementsbytagname("head")[0].appendchild(script); } else { initbookmarklet(); ...

mysql - Reduce SQL statement with sum of col of result -

select *, (a / 100) a_calc, (select sum(a_calc) foo c = ? , d = ?) a_calc_sum foo c = ? , d = ? order a; the purpose here want return rows matching original query (without sum) , have mysql calculate sum of a_calc me instead of issuing separate query. without subselect seems first row in query correct sum attached. any ideas how reduce above query? i think want avoid running subquery every row - here's how: select *, / 100 a_calc, a_calc_sum foo join (select sum(a / 100) a_calc_sum foo c = ? , d = ?) x c = ? , d = ? order a;

Access MemberName/PropertyMap from ResolutionContext in an Automapper custom ValueResolver -

i need trace complex (i.e. non-default) mappings in our project. to achieve this, i'm using custom value resolver, , publishing out log event during resolution. part of message i'd know destination member being mapped, hoping find in source.context.membername - null. valueresolver: public class resolver : ivalueresolver { public event mappingeventhandler mappingevent; public delegate void mappingeventhandler(mappingmessage m); public resolutionresult resolve(resolutionresult source) { var src = (sourcedto)source.context.sourcevalue; if (!string.isnullorwhitespace(src.status) && src.status == "alert") { var newvalue = source.value + " - fail"; var fieldname = source.context.membername; //always null mappingevent(new mappingmessage(fieldname , newvalue)); return source.new(value, typeof(string)); } return source; } } ... , usag...

c# - How to cache .Count() queries in NHibernate.Linq? -

how cache result of such query: session.query<entity>().count(e=> e.property == someconstant) i cannot place cacheable() after it, , if place before count(), fetch entire result set, wouldnt it? adding cacheable before count will cause aggregate count results cached . can seen sql generated example below. domain , mapping code public class entity { public virtual long id { get; set; } public virtual string name { get; set; } } public class entitymap : classmap<entity> { public entitymap() { id(x => x.id).generatedby.identity(); map(x => x.name); cache.readonly(); } } the test code itself. using (var session = nhibernatehelper.opensession()) using (var tx = session.begintransaction()) { session.save(new entity() { name = "smith" }); session.save(new entity() { name = "smithers" }); session.save(new entity() { name = "smithery" }); session.save(new ent...

windows - WinAPI: InternetCloseHandle function closes the handle but not the connection -

i call wininet\internetopenurla , wininet\internetreadfile , when i'm done call wininet\internetclosehandle returns true. means handle closed, connection still in established state. why doesn't connection close when call wininet\internetclosehandle ? wininet can cache , reuse connections future requests same server.

sql server - SQl , multiple questions ( parameters in a join and putting a column into a row -

i trying group table date (mm/yyyy) , invoicetype, have tried putting in code below keep getting error 'invalid column date'. select right(convert(varchar(10), case_createddate, 103), 7) date, case_invoicetype, sum(case_totalexvat) cases ca case_primarycompanyid = 1111 group ca.date, case_invoicetype i tried this: group year(case_createddate), month(case_createddate) but error: case_createddate invalid in select list because not contained in either aggregate function or group clause any ideas ? thanks you need include non aggregated columns select in group clause. ca.date not in select, suspect want this: select right(convert(varchar(10), case_createddate, 103), 7) date, case_invoicetype, sum(case_totalexvat) cases ca case_primarycompanyid = 1111 group right(convert(varchar(10), case_createddate, 103), 7), case_invoicetype

javascript - Recursive function causes other calls to fire multiple times -

i'm working on quiz game, wherein user presented quote , has guess author: function startgame(quotes) { askquestion(quotes[0], 0, 0); function askquestion(quote, question, score) { var q = "<span class='quo'>&ldquo;</span><em>" + quote.quote + "</em><span class='quo'>&rdquo;</span>"; $('.choice').css('visibility', 'visible'); $('#questions').html(q); $('.choice').click(function(e){ $('.choice').css('visibility', 'hidden'); e.preventdefault(); var nextq = (question + 1); var btntxt = (nextq < number_of_questions ? 'next...' : 'final results'); if ($(this).attr('data-author') === quote.author) { score++; $('#questions').html('<h1>correct.</h1><a class="btn next">' + btntxt ...

javascript - Return checked option from array -

Image
i using radio boxes save values array, issue having trying automatically check checkbox corresponding value after page refresh or whatever i have tried following; <h3 style="margin-bottom: 0px;">floating</h3></br> <input type="radio" name="lu_ban_data[noticetype]" value="multi"<?php echo ('multi' == get_option( 'noticetype' ))? 'checked="checked"':''; ?> /></input> <h3 style="margin-bottom: 0px;">floating</h3></br> <input type="radio" name="lu_ban_data[noticetype]" value="floating"<?php echo ('floating' == get_option( 'noticetype' ))? 'checked="checked"':''; ?> /></input> the value being saved when click either 1 array (size=6) 'noticetype' => string 'multi' (length=5) corresponding checkbox isnt being checked. anyone...

wait - QuickTest Professional - Using Type method on SwfObject -

i'm developing automated test suite application uses text fields are, however, rather recognized swfobjects. part of automation, i'd type person's name 1 of objects. naturally, i'm using type method it's 1 available swfobject. sometimes, if swfobject("edit_field").type "joe smith" application glitches , qtp manages fill field in structurally similar yet different string instead, such "jo smith" or "joe snith". rather nondeterministic , results produced can vary significantly. sometimes, editable field gets filled correct text, of times doesn't. no amount of wait or waitproperty(visible) managed solve far. has come across issue before , if so, offer insight solving it? might worth mentioning application queries db in background whenever types text field. many thanks, paul. hi paul try out.. set keyboard = createobject("wscript.shell") swfobject("edit_field").click keyboard.sendkeys...