Posts

jquery - jQueryUI - custom handle not working -

i know there's few questions on this, can see doing correctly. alas, no joy. //create , append custom resize (se) handle asset.append($('<button />', {text: 'l'}).addclass('ui-resizable-handle ui-resizable-se')); //give asset resizability asset.resizable({handles: {se: '.ui-resizable-se'}, aspectratio: true}); there no errors, , handle correctly appears, 2 classes. it's drag doesn't happen... i have had drag working, when allow jqueryui generate handle me, not custom handle. this question mentioned bug custom handles fixed, i'm on latest version (1.10.3) not sure what's up. what's not like? if nothing obvious, i'll set fiddle demo. thanks in advance

sublimetext2 - how to create snippet in sublime text 2 -

<snippet> <content> <!doctype html> <html> <head> <style type = "text/css"> </style> </head> <body> <script type = "text/javascript"> </script> </body> </html> </content> <tabtrigger>html_t</tabtrigger> <description>html_css_javascript</description> <scope>html</scope> </snippet> when save h.sublime-snippet, error "no content snippet packages /user/h.sublime-snippet" <snippet> <content><![cdata[ hello, ${1:this} ${2:snippet}. ]]></content> <!-- optional: set tabtrigger define how trigger snippet --> <!-- <tabtrigger>hello</tabtrigger> --> <!-- optional: set scope limit snippet trigger --> <!-- <scope>source.python</scope> --> </snippet> if compare yours co...

linux - Apache Server Slots, Memory, KeepAlive, PHP and SSL - how to speed up -

on debian web server (vps) cpu, 6 gb ram, , fast backbone internet connection, run php application. php runs in "prefork" mode (incl. apc opcache), because whenever search php , mpm worker, there abundant warning regarding thread safety. php application quite large, each server process requires 20 30 mb ram. there sensible data processed application, therefore, connections apache server ssl encrypted. typically, application shows no or few images (about 1-3 files incl css , js per request) , users send new request each 1 minute (30 sec. 4 minutes, depeding on user). recently, application faced big storm of user requests (that planned, no dos, 2.500 concurrent users). while cpu did fine (<50% use), server ran out of slots. point - in prefork mode - each slot requires memory , 6 gb enough "maxclients" 200 slots). problem 1: according apache server-status, slots occupied "..reading..". reading 10 seconds , more, while php processing takes 0.1 2 s...

jquery - How to do an entry in javascript map from ajax call -

i modifying previous question since feel problem closely related putting entry in map ajax call. there nothing wrong map. edit :- i populating map of feeds in following ways key represent url , value represent feeds; channelmap.each(function(key,url,n){ loadfeedfor(url,10); console.debug(feedmap); }); : function loadfeedfor(url,maxposts){ var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url; if(maxposts != null) gurl += "&num="+maxposts; $.getjson(gurl, function(){}) .done(function(data){ feeds = data.responsedata.feed; feedmap.put(url,feeds); }); } but not working. guess have use deffered problem have no idea how. i using map answer . i tried doing same thing in way not using map. calling following function different 3 rss feeds url; function rssfeedsetup(feedid,feedurl,feedlimit){ var feedpointer=new google.feeds.feed(feedurl); //google feed ...

Intercept URL before unload with javascript or jquery -

i'm writing simple chrome plugin intercept new url before page unload , if contains specific string want actions , invalidate redirect! have no idea how do.. can me? you can use onbeforerequest event of webrequest api chrome extensions: chrome.webrequest.onbeforerequest.addlistener( function(details) { // actions // ... return {cancel: true}; }, // block requests matching url {urls: ["*://www.evil.com/*"]}, ["blocking"] ); just make sure have right permissions in manifest.json file: you must declare "webrequest" permission in extension manifest use web request api, along host permissions hosts network requests want access. "permissions": [ "webrequest", "webrequestblocking", "*://*.google.com" ],

asp.net - Is it possible to combine these 2 statements using linq? -

using asp.net 4.0/c# i have list of items. list contains duplicates. this item class: public class pingtreenode { public int tierid { get; set; } public int lenderid { get; set; } public int weight { get; set; } public int seq { get; set; } public pingtreenode(int tierid, int lenderid, int weight, int seq) { tierid = tierid; lenderid = lenderid; weight = weight; seq = seq; } } in first instance want select first item each lenderid. using linq: var tiernodes = new list<pingtreenode>(); tiernodes = tiernodes.groupby(x => x.lenderid).select(x => x.first()).tolist(); however, want add sequence list, starting 1,2,3 etc. separately looping through this: int seq = 1; foreach (var t in tiernodes) { t.seq = seq; seq++; } is possible both group , sequence @ same time using single linq statement? int seq = 1; var...

android - ListView items don't load on screen -

the use case following: want load listview inside viewpager , @ same time set onitemclicklistener on list. can tell why listview doesn't load, i.e. screen stays black. not strip pager works. layout: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:orientation="vertical" android:padding="4dip" > <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="0px" > <android.support.v4.view.pagertitlestrip android:id="@+id/pager_title_strip" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_weight="1" ...