Posts

jQuery Ajax Render Fragments OR Whole Page -

i'm in throes of building application wraps mess of legacy code. page working on, need substitute fragment divs constructed on back-end -- or else need replace entire page altogether. idea there dynamically controlled flow needs satisfied before can forward legacy product. substituting fragments works fine, seen in below my_body_content swap. trouble comes when i'm trying render not fragment, whole page, in "body" swap. @ point page goes blank. i want similar errors returned server. want nice rest 404 error messages displayed on screen, legacy-product 404s show in legacy-product 404 page. yes, requirements project weird. that's not problem can fix. here's jquery invocation, names changed protect guilty: $.ajax({ url: "places/things", type: "post", data: json.stringify(somebadassobject), datatype: "text", accepts: "text/html", contenttype: "application/json; charset=...

Eclipse RCP- org.eclipse.ui.plugin missing -

i've written eclipse rcp application runs fine in eclipse, however, packaging standalone application has been tricky. i've worked way though few class path errors, i'm getting new one. after running export wizard , launching application, throws classdeferror , classnotfoundexception, it's looking org.eclipse.ui.plugin.abstractuiplugin. did not find in copy of eclipse sdk, , downloaded sdk again sure, , still couldn't find it. found jar online supposedly contained fiel along other eclipse packages, however, got this: nosuchmethoderror: org.eclipse.ui.plugin.abstractuiplugin: method ()v not found i figure problem more did wrong rather class missing, i've gone though configurations , i'm sure required packages , dependencies included. ideas? download , install new version of adt plugin 21.0.0.

c# - Global Variables vs. ASP.NET Session State -

this going sound rather naive, i'm developing web application spans multiple pages. of these pages instantiate same class object w/ methods accesses cms using api. currently, when user starts creating content, i'm storing variables folder id content located in session variable. my question this: can instantiate single instance of class can used across pages without having on every page? if so, each person accessing page given own version of class? assume using static variables , methods isn't way go since shared in memory. , also, where/how declared if going used globally in web application in .net c# application? i recommend making base class inherits system.page. have page code behind inherit that. then, inside base class, create property reference object. example, this: public class basepage : system.web.ui.page { public foo currentfoo { { return (foo)session["foosessionob...

C# Maintain 3 threads and close one if it takes to long -

this code using call 3 threads. for (int = 0; < 3; i++) { new thread(() => { processeventlogtesting(); }) {isbackground = true }.start(); } i thinking adjusting this public static int threadcounter = 0; if (threadcounter < 3) { threadcounter ++; (int = 0; < 3; i++) { new thread(() => { processeventlogtesting(/*somewhere in here code says */threadcounter--;);}) {isbackground = true }.start(); } } } however, think not best way this. also, want put in new timer says if thread x goes on 20 minutes, kill thread x. appreciated. since don't know thread does, try private object lockobject = new object(); private int threadcounter = 0; public int threadcounter { { lock(lockobject) { return threadcounter; } } set { ...

c# - LongListSelector Data Virtualization -

does longlistselector support data virtualization? read on several blogs does, can't work. here tried: provided ilist implementation itemssource list. problem list calls getenumerator() instead of this[int index] list item. so question: how implement data virtualization longlistselector ? as said, longlistselector still based around getenumerator when rendering ilist types. control need rewritten support purpose. while blogs might support it, none of them says how, i'm not inclined believe them. longlistselector's default render items. as loading of data, can done progressive using observablecollection. got example project shows how use observablecollection in combination longlistselector. basically allow progressively add more groups and/or, more data groups, , ui should update accordingly.

Taking picture without using Media Intent in android -

i developing application have take picture without using media intent i-e without previewing camera.how can can me in regard. waiting reply altaf you cannot take picture without preview. whether preview offered intent or preview create surfaceview when use camera object, there has preview.

eclipse - How do I relocate my Android project in SVN? -

i set svn repository android project wrong way , appreciated correcting it. i created standard svn repository follows (i did not create root "svn" folder because plan store 1 project in repository) : http://myserver/myproject /trunk /branches /tags when checked in project went root folder instead of /trunk folder. had folders: http://myserver/myproject /trunk /branches /tags /myproject /src /res /...etc i've been working way while, using eclipse , (i think) subversive svn connectors. know nothing svn command line. need move project trunk folder should have done beginning. copied myproject folder trunk folder copy/pasting in svn repositories view in eclipse , renamed old folder, have: http://myserver/myproject /trunk /myproject /src /res /...etc /branches /tags /myproject.old /src /res /...etc how project start using /tru...

sorting - Ordered Many-Many Relationship in Doctrine? -

attempting link categories websites , using websitecategory refclass. websitecategory has column rank , indicates order in categories should retrieved when call $website->getcategories() i'm stumped, didn't think difficult. can help? was not able doctrine order relationship natively (like damien suggesting) instead, added getcategories() function model runs proper query , returns result set.

java - JTree Not Refreshed When Called on Different Location But On Same Event-Dispatching Thread -

i have been struggling jtree . cannot refresh after add new tree node ( defaultmutabletreenode ). able refresh when code adds tree node called within gui class, not outside it. here code adds node jtree : public class treeviewer extends jpanel implements treeselectionlistener { jtree tree; defaultmutabletreenode rootnode; defaulttreemodel treemodel; public void modifyjtree(string name) { defaultmutabletreenode childnode = new defaultmutabletreenode(name); treemodel.insertnodeinto(childnode, rootnode, rootnode.getchildcount()); } } when called in main method, gui failed refresh after node added. experimented several ways put on event-dispatching thread, not work. tried on main thread, , failed. code examples provided below: public static void main(string[] args) throws exception { final treeviewer viewer = new caseviewer(); // omit code sets gui , displays // calls modifyjtree on event-dispatching thread // , not work ...

ruby - rails attaching database entry to logged in user -

i'm new rails , done setting login system. however, want able make new blog post , attach account when logged in. how can attach post user_id list previous posts? define model posts ( should have column name user_id ) model post < activerecord::base belongs_to :user end in user model model user < activerecord::base has_many :posts end with above defined associations user_id foriegn key user model can posts user below user.find(id).posts

uiscrollviewdelegate - How to "stick" a UIScrollView subview to top/bottom when scrolling? -

you see in iphone apps gilt. user scrolls view, , subview apparently "sticks" 1 edges rest of scrollview slides underneath. is, there text box (or whatever) in scrollview, scrollview hits top of view, "sticks" there rest of view continues slide. so, there several issues. first, 1 can determine via "scrollviewdidscroll:" (during normal scrolling) when view of interest passing (or re-appearing). there fair amount of granularity here - differences between delegate calls can hundred of points or more. said, when see view approach top of scrollview, turn on second copy of view statically displayed under scrollview top. have not coded this, seems lack real "stick" - view first disappear reappear. second, if 1 setcontentoffset:animated, 1 not delegate messages (gilt not this). so, how callbacks in case? use kvo on "scroll.layer.presentationlayer.bounds" ? well, found 1 way this. when user scrolls flicking , dragging, uiscrollv...

C++ Format for cout << Automatically -

if had simple class 2 variables, x , y, , function tostring() returns formatted string data. when call cout << simpleclass << "\n"; anyone know way have simpleclass.tostring automatically called return correctly formatted string? i'm guessing there's way operator functions, don't know how this. if you're asking how define such operator, template<class chart, class traitst> std::basic_ostream<chart, traitst>& operator <<(std::basic_ostream<chart, traitst>& os, simpleclass const& sc) { return os << sc.tostring(); }

version control - How can I find the name/location of an SVN repository? -

i have number of files under version control svn, , i'm trying switch git . however, has been long time since made repository, , have forgotten url. is there way url of subversion repository associated given file? do like: svn info <file> run on given checked out file repository. should give more information file status , repository url.

Seam EntityQuery Many-to-Many Joins, Distinct, and Oracle -

i'm seam newbie in established project, lot of code use borrowed , i'm not sure how things work. problem using query object extended entityquery list page search , sort capabilities needs search across many-to-many relationship , separate many-to-one relationship must used sort. because many-to-many relationship has joined in allow search capability, query returns duplicate records each assignment. that's not big deal because added "distinct" ejbql , worked fine. however, when try order other many-to-one relationship, oracle throws error. appears oracle not accept order column not in select clause when using distinct keyword http://ora-01791.ora-code.com/ , , http://oraclequirks.blogspot.com/2009/04/ora-01791-not-selected-expression.html . here relationships defined in entities: [subject m:m jobfunction] (obviously through assignment table [subject o:m subject_jobfunction m:o jobfunction]), , [subject m:o type]. because need search subject jobfunction, joine...

Javascript: open & close new window on image's onMouseOver & onMouseOut, but only if new window onMouseOver = true -

thank helping me javascripting problems. current problem need open & close new window on image's onmouseover & onmouseout, respectively, if new window onmouseover == true don't want new window close. i sure there simple solution, can't seem figure out way cancel image's onmouseout="closedetails();" if user hovers on new window. below of code dealing with. in advance help. <body> <img name="img1" id="img1" onmouseover="windowdelay(this);" onmouseout="closedetails();" src="images/127.jpg" height="240" width="166"/> </body> <script language="javascript" type="text/javascript"> // opens movie details pop-up after // half second interval. function windowdelay(thatimg) { winopentimer = window.settimeout(function() {opendetails(thatimg);}, 2000); } // function open // new window when mouse moved on image function op...

osx - Is Lion (gold master) part of the iOS Developers Program? -

i know beta versions of lion available ios dev program members, final release of lion available download? i trying avoid paying lion twice (once via app store , once via joining dev program). pre-release versions of os x part of mac dev program, not ios dev program. for it's worth, when logged in mac app store today, showed installed (i had downloaded gm build few weeks ago). deleted downloaded gm , let me download again free, apparently being member of mac dev program , having downloaded beta version allows release version free!

c# - Memory allocation on object creation -

how memory allocated in stack in heap when instantiate class/struct student? i guess id = 4 bytes reference (32 bit machine) , name = 4 bytes reference , facultyadvisor = 4 bytes reference. totally 12 bytes in stack , actual size in heap. heap size may vary depends upon value assign fields(id, name, facultyadvisor) uses object obj(student obj = new student()) the same struct right? public class student { int id; string name; professor facultyadvisor; } public struct student { int id; string name; professor facultyadvisor; } assuming 32 bit clr (references 64 bit on 64 bit clr) , taking account heap allocation student class student{} class professor{} stack: 4 bytes heap: 4 bytes (int) + 4 bytes (professor reference) + 4 bytes (string reference) + 12 bytes (object header) = 24 bytes class student{} struct professor{} stack: 4 bytes heap: 4 bytes (int) + size of processor + 4 bytes (string reference) + 12 bytes (object header) = ?? bytes struct stu...

Any way to return PHP `json_encode` with encode UTF-8 and not Unicode? -

any way return php json_encode encode utf-8 , not unicode? $arr=array('a'=>'á'); echo json_encode($arr); mb_internal_encoding('utf-8'); and $arr=array_map('utf8_encode',$arr); not fix it. result: {"a":"\u00e1"} expected result: {"a":"á"} {"a":"\u00e1"} , {"a":"á"} different ways write same json document; json decoder decode unicode escape. in php 5.4+, php's json_encode have json_unescaped_unicode option plain output. on older php versions, can roll out own json encoder not encode non-ascii characters, or use pear's json encoder , remove line 349 433.

jQuery - Problem loading new image src -

Image
** edit ** image showing needed done. when admin clicks on unapproved (x) comment automatically approves , image changed check mark , vice versa. i using following jquery code, having problems loading new image src on click. <script> $(document).ready(function(){ $(".disapprovecomment").click(function() { var id = $(this).children("p").text(); $.ajax({ type: "post", url: "/comments/disapprovecomment/"+id, async:false, success: function(msg){ //using $(this).(".disapprove")... not work $(".disapprove").attr("src","/img/icons/approve.png"); } }); }); }); </script> this view file <?php if($comment['comment']['approved'] == 1){ echo '<div class="disapprovecomment"><p style="display:none">'; echo $comment['comment...

c# - Usage of Stream more than once -

i trying upload image file repository using httppostedfile.inputstream , resize different thumbnail sizes using same stream. step 1. using stream sm = httppostedfile.inputstream able upload file successfully. step 2. use same stream resize image different sizes. error saying stream being used. suppose if skip step 1 , perform step 2, able resize inputstream (images) different size. letting me use inputstream once. how can achieve process both step 1 , 2 sequentially ? i did try storing inputstream variable , used separate copy each step no luck. can suggest/help me ? thank you did set stream.position 0 before reusing it? by storing in multiple variables you're duplicating reference same object in memory.