Posts

Showing posts from August, 2014

xml - Is it possible to restrict elements to a max occur in a "choice" block? -

i need solve following problem. //pseudo algorithm you have 4 elements: elm1, elm2, elm3, elm4 elm1 occurs 0-2 times elm2 occurs 0-1 times elm3 occurs 0-n times elm4 occurs 0-n times they can ordered in way, occur restricted given count. //pseudo end it seems combination of sequence , choice, both indicators have characteristic, don't allow me desired behavior. sample: elm4 elm1 elm2 elm1 elm3 elm3 elm3 elm4 please rescue me before i'll insane :) chris if n values not big , you're desperate can make content model accounted every possible combination, grows complex exponentially. the best solution use tool supports xml schema 1.1 (such xerces or saxon ), relaxes restrictions on all group occurrence values. section g.1.3 of spec: several of constraints imposed version 1.0 of specification on all-groups have been relaxed: a. wildcards allowed in groups. b. value of maxoccurs may greater 1 on particles in group

uiimage - Iphone - Masking JPG images -

i coding jigsaw puzzle , need mask images create puzzle pieces. i using pictures online server , *.jpg. when mask them, area should transparent black. can add alpha channel programmatically? if yes, can show me how? thanks lot, andrei i found answer: cgimageref imageref = self.cgimage; size_t width = cgimagegetwidth(imageref); size_t height = cgimagegetheight(imageref); // bitspercomponent , bitmapinfo values hard-coded prevent "unsupported parameter combination" error cgcontextref offscreencontext = cgbitmapcontextcreate(null, width, height, 8, 0, cgimagegetcolorspace(imageref), kcgbitmapbyteorderdefault | kcgimagealphapremultipliedfir

apache - XMLSec: What's wrong with the signature? ("Reference for URI has no XMLSignatureInput") -

i'm using apache-santuario 1.4.4 generate signed message: <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-sec="http://schemas.xmlsoap.org/soap/security/2000-12"> <soapenv:header> <ds:signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:signedinfo> <ds:canonicalizationmethod algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/> <ds:signaturemethod algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:reference uri="#ds-om"> <ds:transforms> <ds:transform algorithm="http://www.w3.org/tr/2001/rec-xml-c14n-20010315"/> </ds:transforms> <ds:digestmethod algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:digestvalue>8nzkh.....99alyeu4=</ds:digestvalue> </ds:referen

.xltx to .xltm - VSTO project conversion -

currently have excel 2007 template project workbook extension .xltx. had new requirement template should run macro (a .xltm template). since have lot of ui changes existing template, not want recreate new template project. if change extension of workbook file in template project .xltx .xltm, work fine without loss design , data? tried dummy project , got error, excel cannot open file 'exceltemplate.xltm' because file format or file extension not valid. verify file has not been corrupted , file extension matches format of file. please help. regards, nanda thanks update. yes, cannot rename. template created using vsto not support macros. need recreate template designs using macro enabled tempalte option selection @ time of template getting created. if not, while saving, showning errors template should macro enabled tempaltes. regards, nanda

Dynamic images via PHP and BLOB in Mysql -

i have written php script grabs icon mysql dynamically depending on page on. it works in safari, shows alt tag in firefox , explorer. any on welcome little stuck! code pull in image: echo '<img src="website/_scripts/showicon.php?appid='.$_get['appid'].'" alt="icon" />'; showicon.php page: <?php require(dirname(realpath(__file__)). '/db.inc.php'); mysql_select_db($connection, $table); $appicon = mysql_query("select image_app cc_apps id_app = '1' limit 1", $table) or die(mysql_error()); $ri = mysql_fetch_assoc($appicon); $imagebytes = $ri['image_app']; header("content-type: image/jpeg"); print $imagebytes; ?> i have used script before, (well similar) , works fine on browsers... so needed re-upload images database, , change type image/png, , bobs uncle! thanks comments.

MySQL - SELECT ... WHERE id IN (..) - correct order -

i have following query select * table id in (5,4,3,1,6) and want retrieve elements in order specified in "id in.." meaning should return: 5 .... 4 .... 3 .... 1 .... 6 .... any ideas how that? use field() : select * table id in (5,4,3,1,6) order field(id, 5,4,3,1,6);

iphone - How to set last index values as first while drawing the CPBarPlot? -

i want load cpbarplot last 10 index values when reload data called, function there achieve this.... thanks in advance it's determine data plotted. return 10 in -numberofrecordsforplot: , figure out amount offset index in -numberforplot:field:recordindex: . instance, if data set has 50 points , core plot asks data @ index 5, return point @ index 50 - 10 + 5 = 45 .

ipad - CGColorReleaseing strokeColour Causes Crash Before Release Line -

i have little method coregraphics drawing. today using clang in xcode detect , fix memory leaks. told me 'rgbcolourspace' , 'fillcolour' (see code below). wondering why did not alert me 'strokecolour' had not released either. added block @ end of method, releases three. strangely enough, ipad app crash in line indicated below, above line release 'strokecolour' in. // retrieve path supplied bedid cgpathref path = (cgpathref)[self.mydictionary objectforkey:bedid]; // save graphics state can restored later cgcontextsavegstate(self.bitmapcontext); // initialise fill , stroke colour cgcolorref fillcolour = [uicolor whitecolor].cgcolor; cgcolorref strokecolour = [uicolor blackcolor].cgcolor; // set stroke width cgcontextsetlinewidth(self.bitmapcontext, 1.0); // create cgcolorspace cgcolorspaceref rgbcolourspace = cgcolorspacecreatedevicergb(); // add path graphics context cgcontextaddpath(self.bitmapcontext, path); // set fill colour... cgcontextse

java - Quick Sort using recursion on a linked list -

i have quick sort recursion on linked list.... far i've been ok, ran little problem can't see figure out why not working correctly. here object node: public class node { string name; node next; } here program's code: public class quicksortrecusionlinkedlist { public static void quicks(int start, int finish, node head, node tail) { int left = start; int right = finish; node pivot = head; for(int = 0; < ((left+right)/2); i++) { pivot = pivot.next; } node temp = new node(); node leftn = head; node rightn = head; while(right > left) { leftn = head; for(int = 0; < left; i++) { leftn = leftn.next; } while ((leftn.name).comparetoignorecase((pivot.name))<0) { left = left + 1; leftn = leftn.next; } right

ruby on rails: application layout appearing in popup -

in ror application, have link opens popup window. using different stylesheet popup problem it's displaying menubar & banner defined in main application.html.erb. want popup window simple , don't want contain main banner of menu bar , although using seperate stylesheet, main menu/banner still displayed. can please shed light on me. thanks lot help here's documentation if don't want layout render render :layout => false or layout nil

iphone - IS this class Many part of memory Leak -

i confuse class. specially memory management. please guide me nsstring concept @ here. my class is. #import <foundation/foundation.h> @interface itinerary_detail : nsobject { nsstring *itinerary_title; nsstring *itinerary_creator; nsstring *itinerary_identifiere; nsstring *itinerary_created; nsstring *itinerary_modified; } @property (retain) nsstring *itinerary_title; @property (retain) nsstring *itinerary_creator; @property (retain) nsstring *itinerary_identifiere; @property (retain) nsstring *itinerary_created; @property (retain) nsstring *itinerary_modified; -(void) itinerary_initialization; -(void) itinerary_title:(nsstring *) xml_value; -(void) itinerary_creator:(nsstring *) xml_value; -(void) itinerary_identifiere:(nsstring *) xml_value; -(void) itinerary_created:(nsstring *) xml_value; -(void) itinerary_modified:(nsstring *) xml_value; @end and .m class is #import "itinerary_detail.h" @implementation itinerary_detail @s

c++ - how to document generated constructors in doxygen -

we use doxygen document our classes. explicitly document class has generated constructors and/or destructors, indicate i've thought , decided e.g. copying using generated copy constructor safe. however, constructor/destructor not declared , hence doxygen not know function documentation belongs. there ways make doxygen include function comments if function never declared? //! foo class documentation class foo { //! @fn foo(const foo&) //! generated copy constructor ok use //! method documentation void method(); } also wouldn't want write signature of generated files @ all. i guess other option describe in class header. there other approaches? if use = default notion introduced in c++0x default generated constructors, doxygen should pick them up http://www2.research.att.com/~bs/c++0xfaq.html#default i don't know if doxygen has implemented c++0x new keywords , patterns yet though

Android App Inventor: Is it worth learning (yet)? -

i have read allow creating android app without (much) programming skill. i programmer , have developed apps android. app inventor worth while me learn 1 of converting completed apps on app inventor converting in progress apps on app inventor starting new apps app inventor and general limitations? from understand of appinventor platform not going far first 2 goals (converting completed apps , converting in progress apps). it worthwile start new apps. in rapidly putting prototypes together. little have used in platform these biggest limitations. code not portable. forced use appinventor. cannot export/import code java or out of platform. you restricted 1 screen per application. workaround have each screen separate application or fancy layout tricks (hide/show elements). you cannot upload applications developed in appinventor app marketplace. all being said still quite powerful tool. appinventor forums quite active , people have done neat stuff it.

unix - Is mongodb running? -

i have installed mongodb , php drivers on unix server. my question how can tell if mongodb running? there simple command line query check status? if start once shell keep running if exit shell (this doesn't seem case). how can make mongodb connection persistent , auto start on server reboot? i can run: -bash-3.2$ su password: [root@xxx]# cd /var/lib [root@xxx]# ./mongodb-linux-i686-1.6.5/bin/mongod ./mongodb-linux-i686-1.6.5/bin/mongod --help , startup options wed feb 23 08:06:54 mongodb starting : pid=7271 port=27017 dbpath=/data/db/ 32-bit ** note: when using mongodb 32 bit, limited 2 gigabytes of data ** see http://blog.mongodb.org/post/137788967/32-bit-limitations ** warning: running in openvz. known broken!!! wed feb 23 08:06:54 db version v1.6.5, pdfile version 4.5 wed feb 23 08:06:54 git version: 0eb017e9b2828155a67c5612183337b89e12e291 wed feb 23 08:06:54 sys info: linux domu-12-31-39-01-70-b4 2.6.21.7-2.fc8xe

objective c - ASIHTTPRequest (ASIS3ObjectRequest) - File not downloaded -

i'm having issue accessing downloaded file. can see downloaded data coming through using didreceivedata delegate method never see file in directory once request finished. also, fwiw i'm requesting .zip file bucket. -(void)downloadzipfile { asis3objectrequest *request = [asis3objectrequest requestwithbucket:bucket key:keypath]; [request setsecretaccesskey:secretaccesskey]; [request setaccesskey:accesskey]; [request setdelegate:self]; [request setdownloaddestinationpath:[[self documentsdirectory] stringbyappendingpathcomponent:@"test.zip"]]; [request startsynchronous]; } - (void)requestfinished:(asihttprequest *)request { nserror *error; nsfilemanager *filemanager = [[nsfilemanager alloc] init]; nslog(@"documents directory: %@", [filemanager contentsofdirectoryatpath:[self documentsdirectory] error:&error]); //logging contents of documents directory shows file downloaded not there [filema

php - phpBB3 auto-login -

i've integrated phpbb3 forum existing website. i've been able make registration process add user phpbb db well. now i'm facing problem trying user auto-login forum when logs in website. have here done that? can't find relevant on google posts seem talk 'phpbb external webpages' , how can use phpbb sessions on other webpages. i'm trying initiate login when member logs in website, , following tutorials found on google let users log in site when log in forum (which other way around). thanks <?php define('in_phpbb', true); $phpbb_root_path = '../phpbb3/'; //the path phpbb relative script $phpex = substr(strrchr(__file__, '.'), 1); include("../phpbb3/common.php"); ////the path phpbb relative script // start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); $username = request_var('username', 'john'); $pas

asp.net mvc - Should IDependencyResolver.GetServices using Unity return the default (unnamed) registration -

i've question implementation of mvc's idependencyresolver.getservices when using unity dependency injection. there several example implementations found, of have been implemented work around problem of unity throwing exceptions when trying resolve unregistered types. usualy getservices implemented this: ienumerable<object> idependencyresolver.getservices(type servicetype) { try { return _container.resolveall(servicetype); } catch { return new list<object>(); } } what of concern me, , have been unable find confirmation either way, resolveall not return default (unnamed) registration. see here . the documentation idependencyresolver not make same statement. does know whether idependencyresolver.getservices should return registered instances or named instances (using unity parlance)? try below code. hope work. return (servicetype.isclass && !servicetype.isabstract) || _container.isregist

Regex: Extract parts of url before and after last period -

i have url (http://www.something.com/subdirectory/image.jpg) , split url 2 parts using regex: 1) capture first part of url before last period (http://www.something.com/subdirectory/image) 2) capture last part of url after last period (jpg) the file extension not jpg. i have come far capturing string before first period instead of last: /([^.]*)\.(.*)/ edit: here's i'm trying do. replace current src adding "_on" end of image name. $(this).attr("src").replace(/(.*)\.([^.]+)$/, "$1_on.$2") thanks in advance , help, b try with /(.*)\.(.+)/ i think it'll works.

Objective-C game development? -

if apple announce own gaming console did in past , i'm sure not support c++/c# games. question is objective-c such fast , powerful write efficient game engine ? cocos2d effective objective-c graphics engine, along box2d physics engine , cocosdenshion audio engine can make nice games. objective-c is fast, small-footprint language. seeing how runs on successful embedded mass-market platform - iphone. i'm not sure justification give c++/c# better choice games? noted here, cached message sends faster c++ virtual method calls.

Sending email from Drupal contact form, but GMail marks it as "Forged" -

my drupal site sends email gmail account, emails sent go spam folder, , gmail puts bar message "this message forged , did not originate account." although can create filter prevent them going spam, want start sending newsletters, , suspect they'll have same problem. i suspect problem way i've set either php or drupal send mail. far know it's using sendmail function. i've set address "info@..." ... site domain. tips on how can make set outgoing mail won't refused gmail (and presumably other major mail providers)? i suggest article on right track. http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

ajax - $string is not showing up in php search -

just got ajax/php search issue link not showing on search page. echo results showing $string isn't. thanks help. //echo $query; $result = mysqli_query($link, $query); $string = ''; if($result){ if(mysqli_affected_rows($link)!=0){ while($row = mysqli_fetch_array($result,mysqli_assoc)) { echo '<p> <b>'.$row['title'].'</b> '.$row['post_id'].'</p>' ; $string .= "<p><a href='set-detail.php?recordid=".$row['post_id']."'>".$row['title']."</a></p>"; } } else { echo 'no results :"'.$_get['keyword'].'"'; } i don't see echo $string . if put echo command in there $string may begin work.

sharepoint - data binding not displaying data using InfoPath form -

i have simple workflow employee can request product. product submission designed in infopath. manager gets approve or reject decision. added tasks manager using "collect data user" action in spd, added reject or approve checkboxes. but, want design form can see requester of product, product information stored in list (lets lista) workflow runs on. for this, click on managerapproval.xsn in forms box in spd. added new data connections lista, , selected option required information. then, added requestername, productname etc in form using queryfields. there queryfields , datafields, difference between them ? i publish form, doesn't display value empty text boxes, when manager approving request. don't know whats wrong ? thanks edit : using datafields, can see data. but, see id of product not value (eg see 1,2 not proda, prodb). and, see whole list of products in lista, intend see values current item. there repeating section in infopath form, when drag fields form

c# - .epub file in SSIS -

can 1 suggest me way, load data .epub file in ssis or other way?? it's easy ssis. epub files zipped, need uncompress task writes working directory. following that, files either xml or xhtml , can processed xml tasks. i'm not sure drm issues though.

python - Problem using the with-statement -

why doesn`t work: class x: var1 = 1 def __enter__(self): pass def __exit__(self, type, value, traceback): pass class y: x = x() y = y() y.x z: print z.var1 i get: print z.var1 attributeerror: 'nonetype' object has no attribute 'var1' change definition of x to class x(object): var1 = 1 def __enter__(self): return self def __exit__(self, type, value, traceback): pass with assigns return value of __enter__() method name after as . __enter__() returned none , assigned z . i changed class new-style class (which not critical make work).

Show XML string in html SPAN tag -

i have string values in dataset. in composite control, in rendercontent add dataset values html table cells using span tags. works great until have xml string in dataset. in rendercontrol have code like: output.write(@"<span id=""valuespan{0}"" action=""edit"" type=""text"">{1}</span>", this.id + row["id"], row["value"]); row["value"] contains string value of: <?xml version="1.0" encoding="utf-8"?><testdata>need display xml string in span</testdata> the result see "need display xml string in span" not xml data " <?xml version="1.0" encoding="utf-8"?><testdata>need display xml string in span</testdata> ". think need let html know value. how??? you'll need escape < , > characters, transforming them corresponding character entities &lt; , &g

swapping via jquery? -

i have button want user click , turns spinner this thinking have this... <form method="post" id="new_resource" class="new_resource" action="/resources"> <div class="field"> <input type="text" size="30" name="resource[url]" id="resource_url"> <input type="hidden" value="5" name="resource[course_id]" id="resource_course_id"> </div> <div class="actions"> <input type="submit" value="create" name="commit" id="resource_submit"> </div> </form> so need if clicks on submit form button id="resource_submit display spinner...i thinking of putting spinner below input tag in span or image tag wasnt sure best way... here jquery far $('form').submit(function(e){ $(this).find('#resource_submit').hide(); e.preventdefau

php - Confusing IF clauses -

i'm making search engine, , i've made query put different types of search want (e.g. username, city, age etc.). i've come part have if statements output correct results, reason can't figure out how selects if statement i'd want to. the script echoes out block of if has been executed debugging, , says "age" block executed instead of "county" want. here's code, , record; normal , age ifs work fine, suspect syntax error can't see. doing wrong logic wise? first if if(($searchfromage == null || $searchfromage == "nooption") && ($searchtoage == null || $searchtoage == "nooption") && ($searchcounty == null || $searchcounty == "nooption") && ($searchcity == null || $searchcity == "by")){ echo "normal"; } age if elseif(($searchfromage != null || $searchfromage != "nooption") && ($searchtoage != null || $searchtoage != "nooption")){ e

c# - Alphanumeric sorting using LINQ -

i have string[] in every elements ends numeric value. string[] partnumbers = new string[] { "abc10", "abc1","abc2", "abc11","abc10", "ab1", "ab2", "ab11" }; i trying sort above array follows using linq not getting expected result. var result = partnumbers.orderby(x => x); actual result: ab1 ab11 ab2 abc1 abc10 abc10 abc11 abc2 expected result ab1 ab2 ab11 .. that because default ordering string standard alpha numeric dictionary (lexicographic) ordering, , abc11 come before abc2 because ordering proceeds left right. to want, need pad numeric portion in order clause, like: var result = partnumbers.orderby(x => padnumbers(x)); where padnumbers defined as: public static string padnumbers(string input) { return regex.replace(input, "[0-9]+", match => match.value.padleft(10, '0')); } this pads zer

sql server - Performance of Non Clustered Indexes on Heaps vs Clustered Indexes -

Image
this 2007 white paper compares performance individual select/insert/delete/update , range select statements on table organized clustered index vs on table organized heap non clustered index on same key columns ci table. generally clustered index option performed better in tests there 1 structure maintain , because there no need bookmark lookups. one potentially interesting case not covered paper have been comparison between non clustered index on heap vs non clustered index on clustered index. in instance have expected heap might perform better once @ nci leaf level sql server has rid follow directly rather needing traverse clustered index. is aware of similar formal testing has been carried out in area , if results? to check request created 2 tables following scheme: 7.9 million records representing balance information. an identity field counting 1 7.9 million a number field grouping records in 500k groups. the first table called heap got non clustered ind

xcode - Running Instruments to check for leaks on iPhone without developer license -

i'm trying run instruments on iphone app i've compiled debug, self signed (no developer license), , copied phone. if select run with instruments xcode, first organizer complain app installed, , instruments doesn't anything. if try go directly instruments, app not listed in pull-down menu of available processes. oh, , can't run app in simulator because dylib i'm using compiled arm, , if select simulator (which changes architecture i386), source fail compile. any thing obvious i'm missing? unfortunately, need enrolled in ios developer program (yearly paid subscription) in order sign , run applications on testing devices. alternative avoid paying go jailbreak route (which won't provide details about, despite being legal in countries such us).

writing a php script -

how write php script , execute in web page?suppose there web page www.somepage.com , want find out specific word in page...i know search without script since searching functionality provided browser how write script , find out that...i mean need know method 1 can execute script...please usefull.. <?php $html = file_get_contents("http://www.somepage.com/"); $find = strpos($html, "specific word"); ?> $find contains location of word in html.

java - Programmatically create Google Apps Domain -

i working on project involves google apps provisioning api. without getting detailed purpose or inner workings of project, ask simple question: there way programmatically create google apps business domain (especially reseller)? after tooling around provisioning api while find ways add , remove users nothing pertaining whole domains. there api available google apps resellers, if 1 of them should access it.

.net - Make model class from view in ASP.NET MVC -

in asp.net mvc 1 can create typed views suppose if view has been made, possible derive model it? like create model view. possible scenario be: designer makes view (with forms) , developer create model form possible? yes. you translate <input type="text" data-format="int" name="price" /> public int price { get; set; } devil in details though.

tsql - SQL Server 2000 - How do I alter a column from text to ntext? -

i'm trying alter table signatures alter column html ntext; cannot alter column 'html' because 'text'. how go altering column? or rename html htmlold , create new column html ntext. update new column data html old, drop htmlold column. (incidentally when move away sql server 2000, need start getting rid of these text , ntext columns deprecated , not available in next version of sql server.)

c++ - Redirect FROM stderr to another file descriptor -

my program calls library functions print stderr. want intervene write calls file descriptor #2 instead sent somewhere else. here first attempt: bool redirect_stderr (int fd) { return dup2 (2, fd) > 0; } here, fd obtained open("/foo/bar",o_append|o_creat) after function returns true, std::cerr<<"blah" goes terminal , not file. what doing wrong? thanks. update thanks, larsmans, i'm not there yet... void redirect_stderr_to (const char * output_file) { int fd = open (output_file, o_append | o_creat, s_irusr | s_iwusr); if (fd < 0) { throw runtime_error; } else { if (-1 == dup2 (fd, stderr_fileno)) throw runtime_error; std :: cout << (std::cerr ? "fine\n" : "bad\n"); char x [100]; std :: cerr << "output " << getcwd (x, 100) << " / " << output_file << " yie

performance - Raising an Event in .net - perfomance implications -

throwing exception costly in terms of writing performance code. raising event? hence theoretical querstion .net clr crowd: memory implications concerning raising event 1 subscriber? 1 000 000 subscribers? how calculate these implications? raising 1 event euqal calling member method of (the otherwise handler) subscriber directly? "raising event" means "calling delegate" - potentially multicast delegate many invocations in list. each of these pretty cheap... not more direct method call usually, although there situations more expensive. (iirc, call delegate has been created via interface method more expensive.) i recommend write natural code start with, , test see if performs enough. can't think of quicker way call bunch of subscriber methods. suspect it's cheap iterating on list of interface implementations , calling interface method on each, , may cheaper in situations.

c# - Clarification about how ColorMatrix transformations work -

i'm doing work on image processing app (for fun) , struggling understand how colormatrix transformations work. basics of linear/affine transformations, , can fine replicating examples online, i'd grasp why works instead of being satisfied works. for example, doing simple transformation on image produce negative (each color converted respective complimentary) uses following matrix: [-1, 0, 0, 0, 0] [0, -1, 0, 0, 0] [0, 0, -1, 0, 0] [0, 0, 0, 1, 0] [1, 1, 1, 0, 1] i understand -1 cosine of 180degrees, rotation needed "flip" color it's complementary, don't understand how color vector can multiplied against above matrix , produce correct complementary vector. for instance, if pixel has color vector of [247, 255, 0, 255, 1] (using rgbaw space), performing multiplication against above matrix produces [-247, -255, 0, 255, 1], isn't correct since real complementary color of above [8, 0, 255, 255, 1]. i'm missing obvious here , happy admit i'

android - Help in peer-to-peer wifi -

i ask experienced. should realize application university allows connection among 2 or more terminal android in way wifi. thing asks connection peer-to-peer in how terminals must able converse among them without using access-point or other. it's possible thing? have read existence of technology "wifi direct" have not found further information on it, libraries, sdk, or guide available? whom give me useful info yes can. need connect on same ssid. google "wifi ad hoc network."

javascript - How to implement this image preloader into my php file? -

i want have images processed via ajax preloaded visually rather usual loading of images see them build top bottom. please take here . see there want have in php file visually. the part pictures loaded database following: $sql = "select * `fabric`".$filter; $result=mysql_query("$sql"); //echo $sql; $data = ""; $ii = 0; $m = 0; while($myrow = mysql_fetch_array($result)){ $ii++; $m++; if ($m == 1) $data = $data."<div class=\"page current\">"; elseif ($ii == 1) $data = $data."<div class=\"page\">"; $data = $data."<a href=\"#\" title=\"".$myrow['name']."\" class=\"show_fabric\" rel=\"".$myrow['id']."\"><img src=\"".$image_directory.$myrow['thumbnail']."\" width=\"100 px\" height=\"100 px\"><div class=\"fb_name\">".$myro

linq - LinqKit PredicateBuilder with EF 4 CPT 5 table relationships? -

i'm using linqkit predicatebuilder (http://www.albahari.com/nutshell/predicatebuilder.aspx) method searching. how relationships built (entity framework 4 cpt 5 poco): public class musicsheet { [key] public int id { get; set; } public string title { get; set; } public string key { get; set; } public virtual icollection<author> authors { get; set; } } public class author { [key] public int id { get; set; } public string name { get; set; } public string bio { get; set; } public virtual icollection<musicsheet> musicsheets { get; set; } } i need able build predicate checks musicsheet (the title contains specific search term) name or bio of author might contain search term. here have: var predicate = predicatebuilder.false<musicsheet>(); foreach (var term in terms) { string keyword = term; predicate = predicate .or(s => s.title.contains(keyword)); // todo check author name & bio } any sug

In GNU Grep or another standard bash command, is it possible to get a resultset from regex? -

consider following: var="text more text , yet more text" echo $var | egrep "yet more (text)" it should possible result of regex string: text however, don't see way in bash grep or siblings @ moment. in perl, php or similar regex engines: $output = preg_match('/yet more (text)/', 'text more text yet more text'); $output[1] == "text"; edit: elaborate why can't multiple-regex, in end have regex multiple of these (pictured below) need able of them. eliminates option of using lookahead/lookbehind (as variable length) egrep -i "([0-9]+) +$user +([0-9]+).+?(/tmp/flash[0-9a-z]+) " example input requested, straight lsof (replace $user "j" input data): npviewer. 17875 j 11u reg 8,8 59737848 524264 /tmp/flashxxu8pvmg (deleted) npviewer. 17875 j 17u reg 8,8 16037387 524273 /tmp/flashxxibh29f (deleted) the end goal cp /proc/$var1/fd/

multithreading - Java re-doing a piece of code ... using threads -

let's have code: public class helloworld { public static void main(string args[]) { system.out.println("hello world!"); } } using threads, there way can make hello world echo continuously every 5 seconds? this version repeats hello world message continuously, while allowing user terminate message-writing thread: public class helloworld { public static void main(string[] args) throws exception { thread thread = new thread(new runnable() { public void run() { try { while (!thread.currentthread().isinterrupted()) { thread.sleep(5000); system.out.println("hello world!"); } } catch (interruptedexception e) { thread.currentthread().interrupt(); } } }); thread.start(); system.out.println("press

asp.net - Loading gif to run using JQuery -

i'm using asp.net 3.5 webforms. basically, when user causes sort of postback (button click, switch tab, change dropdown, etc), want loading gif pop , end right after page loads. have asp.net solution (updateprogress) gets messy if use more 1 updatepanel. i'm not great jquery or javascript, figured must have solved problem before. any help/assistance appreciated. i don't know asp.net assume can access elements user can click on , create postbacks, first step @ jquery's click() function: http://api.jquery.com/click/ with this, can show hidden html element contains little loading gif hide page under page has loaded, use this: #loader { display: block; position: fixed; width: 100%; height: 100%; top: 0; left: 0; background: url(../image/ajax-loader.gif) no-repeat center center #f1ede5; z-index: 2147483647; } ... <div id="loader"></div> you can nice gif animation http://ajaxload.info/

javascript - Is it possible to delete the object itself, not the reference -

var = { "example" : true }; var x = [a], y = [a]; delete x[0]; console.log(y); in above code, possible have deleted, not reference in x ? that's garbage collector. long there's reference object, not garbage collected. if want cleaned up, make sure there no more references. so answer question, no, there's no way explicitly destroy object. if a , y[0] still referencing it, can't x variable. to clear, x[0] not referencing a . pointing same object in memory a referencing.

python - Finding words that are the reverse of each other in a file -

sorry newbie question, got starting. want simple program in file reverse words, wrote source, doesn't work. after goes second "for" loop, doesn't go first loop, instead ends program. clue? def is_reverse(word1, word2): if len(word1) == len(word2): if word1 == word2[::-1]: return true return false fin = open('list.txt') word1 in fin: word1 = word1.strip() word1 = word1.lower() word2 in fin: word2 = word2.strip() word2 = word2.lower() print word1 + word2 if is_reverse(word1, word2) true: print word1 + ' opposite of ' + word2 edit: tried loop file vs list, , got curious (to me) result. if use code works: def is_reverse(word1, word2): if len(word1) == len(word2): if word1 == word2[::-1]: return true return false fin = open('list.txt') fin2 = ['test1','test2','test3','test4','test5'] word1 in fin: word1

tomcat6 - content-length header in response not present despite commenting transfer-encoding in axis2.xml -

i have axis2 service running on tomcat 6.0.18 axis2 1.3 version. i disabled chunking commenting transfer-encoding element , changed http 1.0 shown below: <transportsender name="http" class="org.apache.axis2.transport.http.commonshttptransportsender"> <parameter name="protocol">http/1.0</parameter> <!-- <parameter name="transfer-encoding">chunked</parameter> --> i implemented lifecycle interface in service implementation class. here init() method code: public void init(servicecontext arg0) throws axisfault { // todo auto-generated method stub arg0.getconfigurationcontext().setproperty(httpconstants.header_transfer_encoding_chunked,boolean.false); arg0.getconfigurationcontext().setproperty(httpconstants.http_protocol_version, httpconstants.header_protocol_10); messagecontext responsemessagecontext =

asp.net - loop through datatable to create a string that looks like this -

i want loop through datatable column called sdescr , created string looks this. dim labels string() = {"north", "south", "east", "west", "up", "down"} this trying , not working dim labels string() each row datarow in tablegraph.rows labels = labels " ' " + row.item("sdescr") + " '," next row thank help, test them tomorrow , see works best , mark 1 correct. do instead dim labels string() dim labelslist list(of string) = new list(of string) each row datarow in tablegraph.rows labelslist.add(row.item("sdescr")) next labels = labelslist.toarray() if need comma delimited list instead can do dim commalabels string = string.join(labels, ",")

.net - SQL Server 2008 vs Visual Studio 2010 Express version of SQL Server -

i'd know benefits of using sql server 2008 on version installed default visual studio 2010 express (i think microsoft sql server compact 3.5 sp2). as far know, possible create applications using mdf database files visual studio, , applications work fine; , there doesn't seem gui manage databases (unless ones integrated in vb.net etc.) in cases need use non compact version of sql server? compact lacks of features of normal sql server: procedural t-sql - select case, if, features distributed transactions native xml, xquery/qpath stored procedures, views, triggers role-based security number of concurrent connections 256 database size support 4gb (express 10gb believe) on other hand compact supports non-admin installation option , hosted in application process.

c# - Tracing Linq expression evaluation -

i'm wondering if it's possible write "passthrough" extension method iqueryable write debugstring whenever queryable evaluated, in other words, debug print should side-effect of evaluation. something like: var qr = somesource.where(...).orderby(...).trace("somesource evaluated @ {0}", datetime.now) var qr2 = qr.where(...); when construct linq query , pass data source object, i'd know when , how object evaluate query. suppose can achieved in other ways, example wrapping ienumerable.getenumerator, i'd generically linq query. i've done similar, more complex (because manipulates expressions processes them). in order accomplish it, created wrapper class implemented iqueryable , contained reference thing wanted query. made pass interface members through referenced object except provider property, returned reference class created inherited iqueryprovider. iqueryprovider has methods called whenever query constructed or executed. if

html - float:left problem -

i have 3 div in page. named blok1, blok2 , blok3. i'm adding {float:left;} blok1 div getting result: screenshot link i want result. screenshot link2 try this: <style type="text/css"> #wrap div { border: 1px solid #000; float: left; margin: 5px; padding: 5px; } #div3 { clear: left; } </style> <div id="wrap"> <div id="div1">div1</div> <div id="div2">div2</div> <div id="div3">div3</div> </div>

vba - create an outlook rule to create folders if needed based on text in subject line -

i'm looking clear way use vba read subject line of email when received in order either create new folder or use existing folder move email into. have seen vba examples none address new mail methods found in vba editor outlook. check out this article , methods 2 , 3, guess point in right direction.

java - OAuth with Signpost and Apache Commons HTTP -

so i'm working signpost oauth library java. i'm running complications using apache commons http library it. take @ following code: url url = new url("http://api.neoseeker.com/forum/get_pm_counts.json"); httprequest request = (httprequest) url.openconnection(); consumer.sign(request); request.connect(); system.out.println("response: " + request.getresponsecode() + " " + request.getresponsemessage()); this taking this example . can see request used httpurlconnection , because i'll using apache commons http library, changed httprequest object. now, i'm getting errors when call connect() , getresponsecode() , , getresponsemessage() , because functions httpurlconnection . functions httprequest use can code compile , run correctly? thanks! signpost has seperate module using apache's http client. need use commonshttpoauthconsumer this. this module lives here - http://code.google.com/p/oauth-signpost/download

Can I have SEO-friendly web pages with SharePoint 2010 for Internet Sites? -

i'm starting out sharepoint 2010 internet sites, of i've seen both in app , in example sites format of url pretty fixed. for example, reference sites i've seen hav home page 'pages/default.aspx'. i'd have '/home'. possible? if so, simple or pretty involved? reference sites saw looking sites. i'm surprised have such ugly urls. thanks in advance help! check post http://blog.mastykarz.nl/friendly-urls-sharepoint-site-4-steps-iis7-url-rewrite-module/ there no ootb features this. write custom http modules friendly urls.

javascript - jQuery Submit Refreshing Page -

the following code intended purely ajax post request, instead seems post via ajax , browser navigates response. the html... <div id="bin"> <form class="add" method="post" action="/bin/add/"> <p>i'm interested! save later.</p> <input type="hidden" name="product_id" value="23423"> <input type="submit" value="save"> </form> <form style="display:none;" class="remove" method="post" action="/bin/remove/"> <p>i changed mind--i'm not interested.</p> <input type="hidden" name="product_id" value="23423"> <input type="submit" value="unsave"> </form> </div> the jquery... $('#bin form').submit(function() { $.post($(this).attr('a