Posts

Showing posts from January, 2010

html - How to use divs instead of tables -

i trying create following table layout, want use div instead of table: ------------------ | | | | cell1 | cell2 | | | | | |--------| | | | | | cell3 | | | | ------------------ i want height of cells set content (i.e. no height: style) i have tried using float:left on cell1, can't seem cells 2 , 3 behave. edit js fiddle here: http://jsfiddle.net/utzr3/ html: <div class="list-row"> <div class="list-left">cell1 </div> <div class="list-right"> <div class="list-title">cell2</div> <div class="list-filters">cell3 </div> </div> </div> <div class="list-row"> <div class="list-left">cell1 </div> <div class="list-right"> <div class="list-title">cell2</div> <

java - Jar permissions codebase for third party jars -

i have issue application after taking jre 7_25 version. java swing application throwing permission , codebase required on console third party jars. for swing jar added permissions , codebase in manifest file asking third party jars well. there command or option fix issue? i saw in stack overflow there same question choose extract third party jars , add codebase , permissions in it. cannot because don't have access production server , feel not permanent solution. i googled day no luck. please give me suggestions this.

iphone - Prevent files from being backed up to iCloud -

i want save file document folder , don't want icloud backing up, saw can use method: - (bool)addskipbackupattributetoitematurl:(nsurl *)url { assert([[nsfilemanager defaultmanager] fileexistsatpath: [url path]]); nserror *error = nil; bool success = [url setresourcevalue: [nsnumber numberwithbool: yes] forkey: nsurlisexcludedfrombackupkey error: &error]; if(!success){ nslog(@"error excluding %@ backup %@", [url lastpathcomponent], error); } return success; } and want ask if need call every time create new file in document folder? whenever create file or folder should not backed up, write data file , call method, passing in url file. instead of it, can call method document folder once.

c# - Monitor.Wait() causing elements of the queue to be skipped -

i'm trying pass elements 1 queue next space becomes available. fixedsizequeue example saw here . printing out elements added , removed queue turns out of them skipped. think happens when monitor.wait(queue) called. can me solve this? class fixedsizequeue<t> : queue<t> { private readonly queue<t> queue = new queue<t>(); private readonly int maxsize; public fixedsizequeue(int maxsize) { this.maxsize = maxsize; } public new void enqueue (t item) { lock (queue) { while (queue.count >= maxsize) { monitor.wait(queue); } queue.enqueue(item); if (queue.count == 1) { // wake blocked dequeue monitor.pulse

java - Jboss AS 7 Hibernate Configuration -

i'm trying configure hibernate in jboss 7.1.1 i put persistence.xml in web-inf folder <?xml version="1.0" encoding="utf-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"> <persistence-unit name="actionbazaar" transaction-type="jta"> <provider>org.hibernate.ejb.hibernatepersistence</provider> <jta-data-source>java:/actionbazaards</jta-data-source> <properties> <property name="hibernate.show_sql" value="true" /> </properties> </persistence-unit> </persistence> obs: jboss 7.1.1 have module hibernate 4 , have datasource named java:/actionbazaards but error: can't find persistence unit named actionbazaar in deployment "actionbazaar.war" when try use: @persistencecontext(unitname="actionbazaar") private entitymanager entitymanager; you trying

asp.net mvc 4 - Calling Javascript Function from ascx -

from html section of ascx file, how can call javascript function? <div> <% if(foo(...)) %> // calljavascriptfunction() ... you can't, code run once in browser there isnt way answer. you need approach problem different direction. either move javascript code server side code, post information need in form there on server side when need it, or use web service run server side code javascript code. what problem trying solve?

javascript - How to make Zepto compatible with Browserify? -

i made changes zepto , hope can use in browserify: ➤➤ git diff diff --git a/package.json b/package.json index 294af90..e4f8fd1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ , "dist": "coffee make dist" , "start": "coffee test/server.coffee" } + , "main": "dist/zepto.js" , "repository": { "type": "git" , "url": "https://github.com/madrobby/zepto.git" diff --git a/src/zepto.js b/src/zepto.js index 93bfe18..cdf8929 100644 --- a/src/zepto.js +++ b/src/zepto.js @@ -787,6 +787,17 @@ var zepto = (function() { return $ })() -// if `$` not yet defined, point `zepto` -window.zepto = zepto -'$' in window || (window.$ = zepto) +// detect module loader jquery +// http://code.jquery.com/jquery-2.0.3.js +if ( typeof module === "object" && module && typeof module.exports === "object" ) { + modul

javascript - Append a div to a new div -

i using ipb , going put each category new tab category div this: <div id='category_100'> <div id='category_104'> <div id='category_102'> <div id='category_101'> and tabs content this: <div class="content"> <div id="content-1" class="content-1"> </div> </div> and categories divs showing want moved content-1 div without duplicate want move div div jjava script how? <script> document.getelementbyid('content-1').appendchild( document.getelementbyid('category_100') ); </script> this worked me how can add more id category_100 i want in 1 script code not repeart scrip code 4 times: <div class="content"> <div id="content-1" class="content-1"> <div id='category_100'> <div id='category_1

iphone - How to create a top fade effect using UIScrollView? -

i've got uiscrollview in app , have seen in other apps when user scrolls, top section fades out on scroll rather dissapearing out. i love effect , want achieve it. ideas how can done? edit: i've put code on github, see here . see my answer similar question. my solution subclass uiscrollview , , create mask layer in layoutsubviews method. #import "fadingscrollview.h" #import <quartzcore/quartzcore.h> static float const fadepercentage = 0.2; @implementation fadingscrollview // ... - (void)layoutsubviews { [super layoutsubviews]; nsobject * transparent = (nsobject *) [[uicolor colorwithwhite:0 alpha:0] cgcolor]; nsobject * opaque = (nsobject *) [[uicolor colorwithwhite:0 alpha:1] cgcolor]; calayer * masklayer = [calayer layer]; masklayer.frame = self.bounds; cagradientlayer * gradientlayer = [cagradientlayer layer]; gradientlayer.frame = cgrectmake(self.bounds.origin.x, 0,

Delete whole element from xml with php -

is there simple way amend following php script include delete button - each item in loop there button submit changes, add button removes element , children. i new php trying understand how use in combination xml - appreciated. here php <?php if(isset($_get['e'])){ //if date submitted, edit //var_dump($_get);die; //load scores xml file $scores = new domdocument(); $scores -> load('content.xml'); //get <games> tag $games = $scores -> getelementsbytagname('brand'); //loop through each found game foreach ($games $game) { $child = $game->getelementsbytagname("id")->item(0); $oldtitle = $game->getelementsbytagname("title")->item(0); $oldscore = $game->getelementsbytagname("schedule_date")->item(0); $oldrow = $game->getelementsbytagname("image")->item(0); $id = $child->nodevalue; if($id==$_get['e&#

python - django-cms and error with CMS_PLACEHOLDER_CONF -

in project have error: " file "/home/xxx/www/yyy/cms/utils/placeholder.py", line 43, in validate_placeholder_name raise improperlyconfigured("placeholder identifiers names may not " django.core.exceptions.improperlyconfigured: placeholder identifiers names may not contain non-ascii characters. if wish placeholder identifiers contain non-ascii characters when displayed users, please use cms_placeholder_conf setting 'name' key specify verbose name. " my settings.py hasn't got cms_placeholder_conf, default {} - empty dict. any idea why have error , not have default settings? your error in line content = placeholderfield(_(u'content'), help_text="plugins") you can't pass translatable string placeholder name(slot) because 1 of translations have non-ascii character, not mention multiple problems arise since string used identifier. here's do: content = placeholderfield(u'content', help_tex

opengl - Unable to call multiple display list glCallList() -

when create display list : gluint tampilkan() { gluint id = 0; id = glgenlists(1); glnewlist(id, gl_compile); //bench glpushmatrix(); glscalef(1.5,0.2,1.5); gambarku(); drawbox(); glpopmatrix(); //backbench glpushmatrix(); gltranslatef(0.0f,2.5f,-1.3f); glscalef(1.5,1.5,0.2); gambarku2(); drawbox(); glpopmatrix(); .... foot using same pattern push-pop matrix glendlist(); //========================================================= return id; }` then call display list in "display" function : glclear(gl_color_buffer_bit | gl_depth_buffer_bit); glpushmatrix(); glloadidentity(); gltranslatef(0.0f, 0.0f, -7.0f); glrotatef(yrot, 0.0f, 1.0f, 0.0f); glcalllist(tampilkan()); glpopmatrix(); glpushmatrix(); glloadidentity(); gltranslatef(0.0f, 0.0f, -5.0f); glrotatef(yrot, 0.0f, 1.0f, 0.0f); glcalllist(tampilkan()); glpopmatrix(); glutswapbuffers(); glflush(); why showing 1 bench? (in other words showing 1 of display list) it should 2 bench translat

Proper way to set off() in jquery hammer events -

i'm wondering best way setting hammer.js configuration on simple document i'm working on. here's code: var tappablearea = $('.content'); var touchablearea = $('.sidebar'); function reloadhammergestures() { tappablearea.hammer().off("doubletap"); touchablearea.hammer().off("swipeleft swiperight"); hammergestures(); } function hammergestures() { tappablearea.hammer().off("doubletap"); touchablearea.hammer().off("swipeleft swiperight"); if (fullscreenmode()) { touchablearea.hammer().on("swipeleft swiperight", function(event) { alert("swiped!"); }); else if (!fullscreenmode()) { tappablearea.hammer().on("doubletap", function(event) { alert("tapped"); }); } } $(document).ready(function() { hammergestures(); }); $(window).resize(function () { reloadhammergesture();; }); and function both loaded on $(document).ready() , (window

algorithm - Solving unbounded knapsack with A* -

i'm trying reconcile 2 seemingly contradictory ideas: the unbounded knapsack optimization problem known np-hard my colleague , think can solve minor variation on in polynomial time using a* sounds crazy, right? that's think! the variation of problem described in terms of cargo plane must unload of goods in order reduce payload plane's capacity. there's set of items each weight , value, , target weight must unloaded -- optimize goods unload have @ least w weight removed, , minimize total value of goods. consider unbounded problem there arbitrarily many items available each of n different types. the proposed solution uses graph starts @ node (vertex) representing nothing unloaded. each unload operation represents edge, graph grows exponentially out starting point every possible combination of goods unloaded. destination node virtual aggregate in combinations total weight >= target considered target node. total weight unloaded far gets stored in eac

.net - Manually Binding a Model to an ASP.NET FormView using model binding -

i trying load details of single product list of products displayed in listview formview control using asp.net 4.5's model binding capability. this hosted in single aspx page decides display using multiview control. in 1 view have listview displays products. in view have formview control display/edit details of single product. when click on single product record in listview, want display view contains formview, , load product formview editing or review. following direction model binding in webforms, have defined "selectmethod" property of formview method takes productid it's parameter. method returns single corresponding product object. understanding somewhere in lifecycle of page method called , formview automatically loaded. now, when click on record in listview view details, fires itemcommand event handler. event handler uses product id selected record , retrieves product corresponds id. the problem comes in need bind product formview. how manually assig

javascript - Making an element draggable without jquery ui? -

i'm trying build image cropper similar twitters - http://jsfiddle.net/yarkr/1/ . i'm stuck on ability drag image. best way without resorting jquery ui ? <div class="canvas"> <span class="window"></span> <img src="http://www.dailystab.com/blog/wp-content/uploads/2009/03/katy-perry-esquire-4.jpg" class="draggable" /> </div> i want able move drag image around inside .canvas div. something work: jsfiddle var thedraggable = null; $(document).ready(function () { $('.draggable').on({ mousedown: function () { thedraggable = $(this); }, mouseup: function () { thedraggable = null; } }); $(document).mousemove(function (e) { if (thedraggable) { thedraggable.css({'top': e.pagey, 'left': e.pagex}); } }); }); and css add this: .draggable { position:absolute; } you rewrite , add form of easing on reposition

java - How to renitialize Default Console I/O Stream -

is possible reopen standard console i/o streams during execution after closing them? public static void main(string[] args) throws ioexception { system.out.println("hello world!!!"); system.out.println("1:" + system.in.read()); system.out.println("" + filedescriptor.in.valid()); //true system.in.close(); system.out.println("" + filedescriptor.in.valid()); //false system.out.println("2:" + system.in.read()); //ioexception system.in.close(); } from this post figure out private static native void setin0(inputstream in); native function used initialize final i/o streams in private static void initializesystemclass() private method after thread initialization. can renitialize i/o streams? edit: as system.in final object cannot modify things like system.in=new inputstream() { @override public int read() throws

html - Images not displaying on website -

the webserver case sensitive seems, thank @david , everyone. website working perfectly. :d so have had make website bakery assignment images not displaying , have no idea why e.g. cookies page perfect cakes page disaster (this first website coding in general terrible) when view website locally images displayed perfectly. hosted www.000webhost.com. website built using dreamweaver. any appreciated, thank in advance. http://beckasbakery.comlu.com/cookies.html http://beckasbakery.comlu.com/cakes.html cookies #smartiecookie img { position: absolute; left: 487px; top: 310px; width: 208px; height: 149px; } #orangecookie img { position: absolute; left: 486px; top: 519px; width: 206px; height: 145px; } #doublechoccookie img { position: absolute; width: 210px; height: 147px; left: 832px; top: 314px; } #chocolatecookie img { position: absolute; left: 838px; top: 546px; width: 207px; height: 148px; } </s

jar - Maven Assembly Plugin: Unpacking overwrites different versions of dependencies -

i using maven assembly plugin generate single jar file dependencies application (unpacked definition in jarlib.xml given here: https://gist.github.com/knyttl/7cc0730ae0fb6947cbda ). dependency.jar can put on class path application.jar , run java -cp application.jar:dependencies.jar my.class.runner . problem multiple versions of same artifacts when unpacking jars. for instance using org.apache.xmlrpc:xmlrpc-server:jar:3.1.3 depends on javax.servlet:servlet-api:jar:2.3 . in application need use different, newer version of javax.servlet , when unpacking, new version skipped , old 1 used instead. is there way ignore dependency given xmlrpc-server ? is there way prioritize newer version of javax.servlet ? is there way create single jar without unpacking dependencies , being able use them -cp application.jar:dependencies.jar ? when tried build jar without unpacking, none of inner jar classes found when running application. sounds want shade plugin - ability create si

ajax - Load data to an open modal - bootstrap twitter -

there input field , href inside modal. href points phpfile, same file modal implemented, load data database , put result input field. the problem when pressing href modal disappear , nothing happen. i know there maybe way load data ajax while modal still open have no idea how it. here code far: trigger: <!-- trigger --> <a href="#setupmodal" data-toggle="modal">open modal</a> modal: <!-- modal box --> <div id="setupmodal" class="modal hide fade"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h3>modal header</h3> </div> <div class="modal-body"> <input type="text" name="inputtext"/> </div> <a href="test.php?getconfig=1"

angularjs - Angular test - DOM updating on element click -

i have test , before test i'm doing such stuff. - going element - hovering element , small tooltip 2 button gonna show - i'm clicking on 1 of buttons , modal var fireevent = function(element, event) { if (element.fireevent) { element.fireevent('on' + event); } else { var evobj = document.createevent('events'); evobj.initevent(event, true, false); element.dispatchevent(evobj); } }; beforeeach(function(){ browser().navigateto('/'); sleep(5); var promise = function() { element('.browse-packshot-item').query(function(elements, done) { var first_element = elements.eq(0); fireevent(first_element[0],'mouseover'); sleep(2); element('#browse-packshots-flyout .browse-packshots-flyout-action').click(); done(); }); };

php - Separator data received via post request -

my problem is: through post request variable "data" in javascript, this: var data = name1 text1 name2 text2 name3 text3; how divide each data element in variable this: var group1 = name1 - text1; var group2 = name2 - text2; var group3 = name3 - text3; then decided put separator in php, character "-" in each group (variable) form, , deal javascript function "split()" string. problem in text there "-" character , other character, how saparare in example without using json? control both server side (php) or client-side (javascript). i'm going make wide assumption php code looks like, since conveniently left out. imagine looks (off top of head, may not work): $response = ''; mysql_query('select name, text mytable'); while ($row = mysql_fetch_assoc()) { $response = $row['name'] . ' ' . $row['text'] . ' ' .$response; } echo $response; you should instead respond object t

html - Image won't resize with browser size -

i trying have image next text. want vertically centered text offset left isn't overlapping text. can achieve whenever resize browser , make smaller image not move. i have tried putting text within text whenever text doesn't center properly. have add link underneath image don't think best way go. here jsbin of problem code: http://jsbin.com/evasix/2/ **i included full code in jsbing because think may being inherited div class. html: <div class="middle"> <div class="side-img"> <h2>millions of entrepreneurs, freelancers, small<br>businesses, , departments inside big<br> organizations rely on our web apps.</h2> <img src="images/img-customerss.png" class="customers"> </div> </div> css: h2 { position: relative; top: -30px; text-align: center; font-size: 45px; color: #232323; font-family: 'crimson text', serif;

neo4j - "snapshot" of nodes at time of transaction -

i have scenario have few products sold during event. these products configured once , can used @ event. have following nodes/relationships: event-[:has_current_inventory]->inventory-[:of_product]->product the inventory here single product, have number of these each event. when transaction occurs, want maintain snapshot of inventory across products sell @ event. thinking of doing way: create new transaction node create new "inventory" nodes of inventory items included in transaction new inventory count link new transaction node "current" inventory nodes (not ones in transaction, of them) replace "has_current_inventory" relationship inventory nodes affected, , give them "archived" relationship. simultaneously, create "has_current_inventory" links new inventory nodes. is there more optimal way implement this? important have snapshot of inventory levels across event when single transaction occurred, or @ arbitrary poi

Best Practice to manage all asset caching (images, css, js, everything) -

i'm working on moderately-sized web application , trying come best solution make browsers use cache , invalidate when there update asset being loaded. according research i've done here , elsewhere, seems in agreement appending ?v={version#} asset such css or js file great way automatically invalidate cache when asset updated. (as per force browser clear cache , better way prevent browser caching of javascript files ) but seems me solution should generalized assets reside on web server. so question is, practice have build script through each src="" attribute across entire website -- whether img, css, or js, , programmatically append ?={timestamp} timestamp time when file last modified. way whenever push dev staging production, files have been modified have changed time stamp, , browser know invalidate cache files. any flaws approach? note: thinking on bit more, timestamp undesirable in case of changes later reverted. therefore, appending ?={md5(fileconte

python - Pandas: unable to change column data type -

i following advice here change column data type of pandas dataframe. however, not seem work if reference columns index numbers instead of column names. there way correctly? in [49]: df.iloc[:, 4:].astype(int) out[49]: &ltclass 'pandas.core.frame.dataframe'&gt int64index: 5074 entries, 0 5073 data columns (total 3 columns): 5 5074 non-null values 6 5074 non-null values 7 5074 non-null values dtypes: int64(3) in [50]: df.iloc[:, 4:] = df.iloc[:, 4:].astype(int) in [51]: df out[51]: &ltclass 'pandas.core.frame.dataframe'&gt int64index: 5074 entries, 0 5073 data columns (total 7 columns): 1 5074 non-null values 2 5074 non-null values 3 5074 non-null values 4 5074 non-null values 5 5074 non-null values 6 5074 non-null values 7 5074 non-null values dtypes: object(7) in [52]: do this in [49]: df = dataframe([['1','2','3','.4',5,6.,'foo']],columns=list('

python - finding a missing tags -

i make test on xml file find place specific tag missing ( tag 'terminal'), test don't work well from xml.dom import minidom xmldoc = minidom.parse('c:\\test\mydoc.xml') #printing number of blocs in xml file itemlist = xmldoc.getelementsbytagname('aclinesegment') print('************') s in itemlist : if s.childnodes['name'].value == 'terminal': print s.childnodes['name'].value here exemple of xml file: <aclinesegment name="t261" description="" aliasname=""> <link_conducting pathb=""/> <terminal name="t1" description="" aliasname=""> <link_terminal pathb=""/> </terminal> <terminal name="t2" description="" aliasname=""> <link_terminal pathb=""/> </terminal> </aclinesegment> <aclinesegment name="t262" description=&qu

design - What's Good for a Technology-based Website's Theme? -

i'm in process of revamping website , wanted other opinions (preferably other web developers/designers) whether dark-based designs idea technology-based website such mine? it looks this plan on redesigning aspects of layout: replace imagery used content background more simplistic solid color, adding slight opacity allow space background through; remove rounded borders. make navigation use less imagery , rely more on standard html , css procedures; accessibility tools moved navigation menu if possible. introduce official mobile theme website, showcasing same content main website, in fluid , adaptive manner. want run default url (no mobile subdomain) , background imagery different. also, recent study showed 44% of web users preferred light-based themes, although study didn't specify types of websites these were. i'm therefore questioning suitability of design tech-based informative site this. alternative 'switch light theme' mode necessary? overall,

asp.net mvc - MVC4 dynamically adding unkown number of editors without repeating a lot of code -

i'm using c#, mvc4 , jquery. requirements given me need able add records database translates editable fields in view. the view has tabs, groups, lines , items need populated depending on in database. have been able achieve want using viewmodel containing list of "tabs"; each tab contains list of "groups"; each group contains list of "lines" , each line contains list of "items". what ends happening me need repeat lot of code same editors. want avoid. so in view i've got like: @for (int tabindex = 0; model.tabs != null && tabindex < model.tabs.count; tabindex++) { <div id="tab-@model.tabs[tabindex].tabid" class="tab-content"> @for (int groupindex = 0; model.tabs[tabindex].groups != null && groupindex < model.tabs[tabindex].groups.count; groupindex++) { <legend>@model.tabs[tabindex].groups[groupindex].name</legend>

php - Generating random numbers without repeats -

i'm building website randomly display yelp listing each time page refreshed. yelp search api returns 20 listings in array. right now, using php's function rand(0,19) generate random listing every time page refreshed ( $businesses[rand(0,19)] ). can refer me smarter method randomize? want show 20 listings once before of them repeated. preferred method handle problem? the below answer doesn't work because numbers recreated every time refresh page. i'm guessing need store numbers i've used already? $numbers = range(0, 19); shuffle($numbers); // handle yelp response data $response = json_decode($data); $random = rand(1,19); $business = $response->businesses; echo "<img border=0 src='".$business[$random]->image_url."'><br/>"; echo $business[$random]->name."<br/>"; echo "<img border=0 src='".$business[$random]->rating_img_url_large."'><br/>"; ?>

Increment value in array php -

i trying make function grabs days have events in database user. instance if there 2 events on jan 23, 2013 add jan 23, 2013 array. got work adds days (without adding same day twice) want able how many dates on each day. on jan 23, 2013 have 2 events in day. i hope makes sense... have code further aid. php function (grabbing each day has events) //gets upcoming days have events user public function get_upcoming_days_with_events() { $return_array = array(); $date_in=null; $user_id = $this->session->userdata('id'); $query =$this->db->select()->from('events')->where('user_id', $user_id)->get(); foreach ($query->result_array() $event => $row) { $date = strtotime($row['date_due']); if (sizeof($return_array) != 0) { foreach ($return_array $date_in_array => $row) { $d = $row['full_date']; if (

Django - Userena not sending email -

i've installed userena app , have running. can register no emails being sent out. i'm overriding signup form if makes difference. i'm not getting error messages , can see users being created in database. settings.py email_backend = 'django.core.mail.backends.dummy.emailbackend' email_use_tls = true email_host = 'smtp.gmail.com' email_port = 587 email_host_user = 'email@gmail.com' email_host_password = 'password' forms.py from django.utils.translation import ugettext_lazy _ userena.forms import signupform models import userprofile, refuserage, refuserreference, refusersport, refuserview django.contrib.auth.models import user class signupformextra(signupform): age_pick = forms.modelchoicefield(queryset = refuserage.objects.all()) ref_pick = forms.modelchoicefield(queryset = refuserreference.objects.all()) sport_pick = forms.modelchoicefield(queryset = refusersport.objects.all()) view_pick = forms.modelchoicefiel

WPF MVVM Bind User Control to Main Window View Model -

i asked similar question while here wpf mvvm user control . got answers, way off, guess wasn't clear in want do.... i working on wpf application using mvvm. app built using component based approach, have user controls i've defined used throughout application. example, have address control. want use multiple places throughout application. here's example. see here: http://sdrv.ms/1ad775h the part green border address control. control has own view model. when place on window or other control, need tell pk of customer load addresses for. created customer id dependencyproperty: public partial class addressview : usercontrol { public addressview() { initializecomponent(); } public static dependencyproperty customeridproperty = dependencyproperty.register("customerid", typeof(int), typeof(addressview), new uipropertymetadata(0, addressview.customeridpropertychangedcallback, addressview.customeridcoerce, true)); public

delphi - auto-align forms when they are shown -

i have 4 fourms, , when form1 shows(), calls show other 3. how can make when shows other forms auto align first one? -form 1 shows -need form2 attach left of form 1 -need form3 attach bottom of form 1 -need form4 attach right of form 1 so looks 1 form 4 different sections. reason center form (form 1 ) run opengl , other 3 forms controls if need such function suggest using the tjvformmagnet component of jvcl (jedi visual component library). otherwise calculate clientrect & position of side forms whenever mainform moves or resizes catching appropriate messages via wndproc method.

ruby on rails - In rspec/capybara, I need a version of "within" that checks all descendants, not just children -

i have snippet of code designed count number of list items in dropdown menu: within ('#campaign_duration_in_days_input') page.all('li').count.should eql(4) end that returns 0, although there 4 list items descendants of div (not direct children). how can count of descendants? i can't see wrong code. within works indirect descendants direct children. throw error if argument #campaign_duration_in_days_input looks element exists. so looks not finding li elements. if plain old html select dropdown should looking option elements? if not try save_and_open_page before within inspect dom see happening.

handlebars.js - jQuery event doesn't fire on Handlebars template -

this first time using stackoverflow. makes sense. i'm using tabletop.js , handlebars bring data google spreadsheet. when data loaded each 1 has radio button associated needs trigger event when selected (at moment alert box). my problem when click nothing happens. if hardcode in exact same code (not pulled in spreadsheet) alert fires normal. below link demonstrate http://jsfiddle.net/danieltramacchi/zgsvy/ code fire event $(document).ready(function () { $(".sem-box").on("change", function () { var location = $(this).find("h3").html(); alert(location); }); }); the radio buttons appear fire alert if click image remove , pull in data spreadsheet. any appreciated! try: $("#seminar").on("change", ".sem-box",function () { var location = $(this).find("h3").html(); alert(location); });

Spyne. Set Array fixed number items -

i create model in spyne array attribute , need fix number items in array. i.e. model looks like: class mymodel(complexmodel): __namespace__ = 'myns' string_field = string(**{'min_occurs': 1, 'max_occurs': 1, 'nillable': false}) array_field = array(integer(**{'max_occurs': 16, 'min_occurs': 16, 'nillable': false}), **{'min_occurs': 1, 'max_occurs': 1, 'nillable': false}) so, mean need objects string attribute , array 16 integer items, code direct xml like: <myns:mymodel> <!--optional:--> <myns:string_field>?</myns:string_field> <myns:array_field> <!--zero or more repetitions:--> <myns:integer>?</myns:integer> </myns:array_field> </myns:mymodel> there 1 integer item in myns:array_field instead 16. what's wrong in code or there possible set number of of array's items need to? tha

java - GdxRuntimeException: File not found -

i'm following this tutorial on libgdx , i've hit bit of snag. finished 'loading assets' section. when tried run it, instead of getting rain sound , pink background, tutorial claims, errors wazoo. here's drop.java: package com.badlogic.drop; import com.badlogic.gdx.applicationlistener; import com.badlogic.gdx.gdx; import com.badlogic.gdx.audio.music; import com.badlogic.gdx.audio.sound; import com.badlogic.gdx.graphics.gl10; import com.badlogic.gdx.graphics.texture; public class drop implements applicationlistener { texture dropimage; texture bucketimage; sound dropsound; music rainmusic; @override public void create() { // load images droplet , bucket, 64x64 pixels each dropimage = new texture(gdx.files.internal("droplet.png")); bucketimage = new texture(gdx.files.internal("bucket.png")); // load drop sound effect , rain background "music" dropsou

Need some help in searching a text from page in jquery? -

i searching text page. function working fine problem on clicking search button search first .but when user click again search button should go next search not going. on clicking next going next.i need same functionality on next , search button. here fiddle http://jsfiddle.net/ravi1989/wjlmx/28/ function searchandhighlight(searchterm, selector) { if (searchterm) { var searchtermregex, matches, selector = selector || "#realtimecontents"; try { searchtermregex = new regexp('('+searchterm+')', "ig"); } catch (e) { return false; } matches = $(selector).text().match(searchtermregex); if (matches != null && matches.length > 0) { $('.highlighted').removeclass('highlighted'); $span = $('#realtimecontents span'); $span.replacewith($span.html()); var txt = $(selector).text().replace(searchtermr

cookies - User registration and logging in a server for Node.js. -

i starting take on rather ambitious project (for level of web programming experience). suffice level of web programming in rather minimal. understand basic html/css/js. rather going learn beginning want project , learn go. chose use node.js little familiar js. so first step in endeavor make user registration , log in system. want following: create system user register entering email , password automatically log user in next time accesses site persistent log in within session i asking examples or tutorials regarding node.js. know have start beginning appreciate help. some fundamentals need learn are: how user automatically logged in when visiting url. example, when go gmail.com in browser, directly takes me inbox. how user information passed computer server? how usernames , passwords received , checked in server side? node provide assistance in doing this? i assume these questions understand level of web programming , appreciate in getting started. book recom

python - Understanding the proxies parameter in requests module -

i'm using requests module in script, , want understand proxies parameter in get() method. this answer has posted following code illustrate usage of proxies parameter: http_proxy = "10.10.1.10:3128" https_proxy = "10.10.1.11:1080" ftp_proxy = "10.10.1.10:3128" proxydict = {"http":http_proxy, "https":https_proxy, "ftp":ftp_proxy } r = requests.get(url, headers=headers, proxies=proxydict) here questions: why passing more 1 proxy get() ? how get() use them? try 1 one? given proxy say, a.b.c.d:port , how know protocol type? when buy premium proxies hidemyass.com , sends proxies in ip:port format , doesn't send protocol type. should pass requests.get() method? i've these doubts because don't know proxies in general , how work. great if explains well. .get() uses proxy key in dictionary matches scheme of url. is, if access ' http://www.google.com/ ', proxy key 'http&

php - mbstring function overload using ini_set() -

i want able set mbstring.func_overload within php file using ini_set() , example: ini_set( 'mbstring.func_overload', 7 ); $foo = 'é'; echo "expected output: 1 1\n" , "output: " , strlen( $foo ) , mb_strlen( $foo ); outputs: expected output: 1 1 output: 2 1 on manual page says: this setting can changed php.ini file. this explains unexpected behaviour. should instead?

php - prev() and next() return no result -

prev() , next() return no result, current() , end() , reset() can see here: http://flamencopeko.net/songs_scans_skip_2.php http://flamencopeko.net/songs_scans_skip_2.txt <?php echo current($arrfiles); ?> <br />prev: <?php echo prev($arrfiles); ?> <br />next: <?php echo next($arrfiles); ?> <br />end: <?php echo end($arrfiles); ?> <br />reset: <?php echo reset($arrfiles); ?> end goal make skip buttons change large scans. must done in js. i'm fine both php , js, fail see how write needed functions. this makes array: <?php $arrfiles = array_diff(scandir("scans", 0), array(".", "..")); $arrfiles = array_values($arrfiles); $intcountfiles = count($arrfiles); ?> you call prev after call current , internal pointer in array go out of rang. not come unless call reset or end . so after have called current , pointer point index 0 , called prev . pointer