Posts

linux - How can I use the vm_operations struct to intercept page faults to a particular set of pages? -

i create kernel module when given id of process can lookup task struct , memory map. when finds should attach function serve page faults particular set of pages (namely heap pages). set vma->vm_ops->fault of needed vma. can easier, if hack heap allocator , replace mmap s mmap_anonymous mmap of special device. code related: http://lxr.free-electrons.com/source/mm/memory.c?v=3.12#l3676 3689 static int handle_pte_fault(struct mm_struct *mm, 3690 struct vm_area_struct *vma, unsigned long address, 3691 pte_t *pte, pmd_t *pmd, unsigned int flags) 3692 { 3693 pte_t entry; 3694 spinlock_t *ptl; 3695 3696 entry = *pte; 3697 if (!pte_present(entry)) { 3698 if (pte_none(entry)) { 3699 if (vma->vm_ops) { 3700 if (likely(vma->vm_ops->fault)) /* here */ 3701 return do_linear_fault(...

c# - VS2012 Debugger can watch variables from third party reference only once -

i sorry vague title, have trouble describing in 1 clear sentence issue, answers me both solution , knowledge surrounding it. so! i have small form application use test new dynamics 2013 web services. added third party reference microsoft.xrm.sdk.dll references. (i named specific dll, occurred me other third party dlls, wanted give bit more context) here small sample of code of line execute in application : retrieveallentitiesresponse response = (retrieveallentitiesresponse) m_orgproxy.execute(raerequest); console.write(response); the type retrieveallentitiesresponse's full type {microsoft.xrm.sdk.messages.retrieveallentitiesresponse} . basically, first time debug application, able watch variable , hover on it, etc. + response {microsoft.xrm.sdk.messages.retrieveallentitiesresponse} microsoft.xrm.sdk.messages.retrieveallentitiesresponse on other hand, let's stop application, restart , break @ same place, not able watch variable. response ...

php - File upload form does not work with large files -

i have pretty standard upload form. few text inputs, file upload input, recaptcha, , submit button. under normal use, can upload small file fine. form data redirected page in action attribute, , while bunch of things done in php , sql handles uploads. however, when trying upload 40 mb file, not work. @ first, thought captcha, since gave me errors failing type in correct words. after disabling captcha, found variables defined $_post['input'] not being passed through. php errors such as: notice: undefined index: name in /var/www/upload.php on line 18 where line 18 $name=$_post['name']; i 1 of these every input in form. this telling me post not being set because form not working when sending large files, question simply...why? , of course, what's solution? edit: relevant code: submit form: <form action="/upload.php" method="post" enctype="multipart/form-data"> <ul> <li> <in...

android - How do I get Bitmap from a TransitionDrawable -

i have transitiondrawable bitmap need. when use getcurrent() drawable, apparently result still transitiondrawable . truth transitiondrawable created in class using final transitiondrawable td = new transitiondrawable(new drawable[] { new colordrawable(android.r.color.transparent), drawable }); where drawable bitmapdrawable. if try cast as bitmap bmp = (bitmapdrawable) transitiondrawable.getcurrent(); then class cast exception. for context, transitiondrawable in line 378 of imageworker of bitmapfun. transitiondrawable inherits layerdrawable can use finddrawablebylayerid(int id) specific drawable. example: using btn_toggle_bg.xml android sources (4.4.1) <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+android:id/background" android:drawable="@android:drawable/btn_default_small" /> <item android:id="@+android:id/toggle" android:drawable="@android:drawable/...

java - indexOf null exception -

public int indexof(x item) { node <x> current = head; int c = 0; if (current.getvalue().equals(item)) { return c; } while (current != null) { current = current.getlink(); c++; if (current.getvalue().equals(item)) { return c; } } return -1; } . @test public void testindexof() { llist<string> b = new llist<string>(); (int = 0; < 20; i++) b.add("str" + i); assertequals(19, b.indexof("str0")); assertequals(0, b.indexof("str19")); assertequals(-1, b.indexof("not found")); } for reason last assertion bringing error nullpointer exception. made when reach null return -1, trying return in third assertion in test, missing here? the problem this: while (current != null) { current = current.getlink(); you ensure current not null . . . change current in way makes possible null again. ...

ios - Zooming in UIScrollView - Unable to zoom beyond single image and scroll -

i have array of images loading nsurl scroll in , pinch zoom. able implement scroll part when try zoom image beyond first one, scroll stuck , scale on image. here code: scrollview = [[uiscrollview alloc]initwithframe:cgrectmake(0, 100, screen_width, self.view.bounds.size.height)]; scrollview.showshorizontalscrollindicator = false; scrollview.maximumzoomscale = 4.0; scrollview.minimumzoomscale = 1.0; scrollview.delegate = self; [self.view addsubview:scrollview]; (int i=0; i<[listofimageszoom count]; i++) { imageview = [[uiimageview alloc] initwithframe:cgrectmake(leftmargin, self.scrollview.bounds.origin.y-100, screen_width, self.view.bounds.size.height-100)]; // [imageview setimage:[uiimage imagenamed:@"img_def.png"]]; nsstring *urlimage1 = (nsstring*)[listofimageszoom objectatindex:i]; nsstring *productimageurl1 = [urlimage1 stringbyreplacingoccurrencesofstring:@"~" withstring:@""]; nsstring *productimageurl2 = [productimage...

c# - url rewrite : how to remove value from url and make seo friendly url -

url rewrites work me. there's 1 more thing: i wanted remove value url , parse seo friendly url for example: http://www.abc.com/bus/22/data-mapping-tech/loc want parse url this: http://www.abc.com/bus/data-mapping-tech/loc here, dont want response.redirect , all. how can handle in process level? i think looking asp.net routing. this enables programatically transport users pages correspond different more readable (seo friendly) path read more here on msdn