Posts

Showing posts from January, 2010

Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - Resize the images after uploading! -

html form <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" /><p /><input type="submit" value="uplaod" /> </form> php function function createresizedimk($img, $imgpath, $thumbdir, $suffix, $by) { // add in suffix after '.' dot. $newnamee = explode(".", $img); $newname = ''. $newnamee[0] .''. $suffix .'.'. $newnamee[1] .''; // imagemagick doesnt '/' , 'x' characters in command line call. // , workout size based on '$by'. $uploadedimg = ''. $imgpath .'/'. $img .''; $newresized = ''. $reducedir .'/'. $newname .''; list($width, $height, $type, $attr) = getimagesize("$imgpath/$img"); $newwidth = ($width/$by); $newheight = ($height/$by); $newres = ''. $neww

How to add ASP.NET MVC view in ASP.NET? -

i have asp.net mvc view contains plain html. wanna use this same view in asp.net. how can this?? possible? i developing application contains both asp.net mvc , asp.net. wanna use same usercontrol accross application. can provide link/suggestions same. so, what's problem - put markup 'ascx' user control or use webcontrol , use across app. work both webforms , mvc. make sure you not trying access incompatible features - in other words, use asp.net platform features not specific webforms or mvc. since mentioned plain html without postbacks, mvc helpers, etc. there should not issues.

Not able to create a virtual directory by the same name in IIS -

i wanted know whether iis exhibits behavior in other windows 7 systems well. what happening when create virtual directory , delete time later , not able create virtual directory same name again in iis. i wanted know how can create virtual directory same name deleted virtual directory. what have achieve same .. suggestion???

linux - Ldap mapping users and groups -

i have question mapping users in openldap. possible set somethings this: group 1: cn=groups_name1,ou=groups,dc=company,dc=com , memberuid in group: memberuid: test and in second group, other user: group 2: cn=groups_name2,ou=groups,dc=company,dc=com , memberuid in group: memberuid: test2 and after set projects , access it: cn=projects_name,ou=projects,dc=company,dc=com , in project memberuid: cn=groups_name1,ou=groups,dc=company,dc=com is possible? the restriction posix groups can contain users, not other groups. depending on want do, nis netgroups allow other netgroups members.

How to send sms via php? -

possible duplicate: sms web application sample code send mail via php // in case of our lines larger 70 characters, should use wordwrap() $message = wordwrap($message, 70); // send mail('caffeinated@example.com', 'my subject', $message); ?> is there codes send sms via php code. if there no option php. solution send sms freely through php. how can this. particularly within in india. please refer these links http://www.sephiroth.it/tutorials/flashphp/sms/ http://www.ozekisms.com/index.php?owpn=327 http://www.theukwebdesigncompany.com/articles/article.php?article=1583 http://www.nowsms.com/discus/messages/1/1113.html

winapi - Cursor flashing on the non-client area when using IDirect3DDevice9::SetCursorProperties -

i have application running under direct3d9. application using direct3d hw cursor api ( idirect3ddevice9::setcursorproperties et al.) control cursor. works fine: when inside of application window, cursor specified setcursorproperties shown when outside of application window, normal os cursor displayed needed desktop or other windows the problem non-client area of window (the title bar, screen edges). when moving in non-client area, cursor corresponding function of area breifly shown, once stop moving, cursor set in setcursorproperties shown again. what correct way use idirect3ddevice9::setcursorproperties default os cursors on window non-client area? after experimenting various things, following change in application has solved issue me: in window procedure, when wm_setcursor received, remember result of condition (lparam&0xffff)==htclient in global variable cursorinclient when global variable cursorinclient false, avoid calling idirect3ddevice9::show

How To Asynchronously Read/Write A Named Pipe In C# -

i have windows form hosts custom user control. user control fires seperate process (a .exe) creates , initializes namedpipeserverstream. once process initializes namedpipeserverstream, user control connects namedpipeclientstream. this works fine. on windows form have button called "check updates". when button pressed, namedpipeclientstream sends message server, server responds messagebox saying "i've been told check updates". can tell client > server communication working fine. here's problem. server supposed send message client telling it's checking updates (so user control can update status after verying command received server). whenever happens, locks up. now going assume because attempting both read , write named pipe @ same time? below code snippets both server , client. (both these snippets run in seperate threads in respective processes not block ui) gupdater (the named pipe server): private void waitforclientcommands() {

Android EditText background text -

is there way set background text of edittext? instance, have login screen 2 edittext views, 1 username , 1 password. want text "username" , "password" written inside edittext, , once user touches text disappears once user deleted own entry, text re-appears. is there property or should implement on own events , stuff? the hint property take care of you.

javascript - Replacing DIV content based on variable sent from another HTML file -

i'm trying javascript working: i have html email links page contains variable in link (index.html?content=email1). javascript should replace div content depending on variable 'content' is. <!-- original div --> <div id="email"> </div> <!-- div replacement function --> <script type="text/javascript"> function replacecontentincontainer(id,content) { var container = document.getelementbyid(id); container.innerhtml = content; } </script> <!-- email 1 content --> <script ="text/javascript"> var content = '<div class="test">email 1 content</div>'; replacecontentincontainer('email1',content); } </script> <!-- email 2 content --> <script ="text/javascript"> var content = '<div class="test">email 2 content</div>'; replacecontentincontainer('email2',content); } </script> any ideas

javascript - window.location = window.location not work in IE7 -

to refresh page using window.location = window.location works fine firefox not ie7 any idea?? thanx call reload method instead location.reload(true)

access control - Looking for a simple "WCF+ACS+Windows Azure" walkthrough -

i spent last 2 hours trying walk through microsoft's "web services , identity in windows azure exercise 1: using windows identity foundation wcf service in windows azure" purports show how host secured wcf service in azure. unfortunately, walkthrough ridiculously complicated whopping 151 steps. i've tried complete first part of walkthrough 3 separate times without luck. i'm pretty sure i'm following instructions written there's subtlety in there (certificate setup, configuration chaanges, etc.) it's i'm missing critical detail. in either case 151 steps order of magnitude difficult mere mortals follow. anyway, in rgard appreciated.... check out bidnow sample. lot less complicated. http://code.msdn.microsoft.com/bidnowsample also, check out samples on http://acs.codeplex.com/

Pre-commit SVN Hook + image optimization script -

i wondering if had tried make pre-commit svn hook "smush" images before commit using smushit, punypng or optimization script. i tried looking on google looks nobody ever tried this. i need advices and/or feedbacks. thanks ! pre-commit hooks should not modify transaction committed. svn book : while hook scripts can anything, there 1 dimension in hook script authors should show restraint: not modify commit transaction using hook scripts. while might tempting use hook scripts automatically correct errors, shortcomings, or policy violations present in files being committed, doing can cause problems. subversion keeps client-side caches of bits of repository data, , if change commit transaction in way, caches become indetectably stale. inconsistency can lead surprising , unexpected behavior. instead of modifying transaction, should validate transaction in pre-commit hook , reject commit if not meet desired requiremen

haskell - Are infinite lists useful for any real world applications? -

i've been using haskell quite while now, , i've read of real world haskell , learn haskell. want know whether there point language using lazy evaluation, in particular "advantage" of having infinite lists, there task infinite lists make easy, or task possible infinite lists? here's utterly trivial day-to-day useful example of infinite lists come in handy: when have list of items want use initialize key-value-style data structure, starting consecutive keys. so, have list of strings , want put them intmap counting 0. without lazy infinite lists, you'd walk down input list, keeping running "next index" counter , building intmap go. with infinite lazy lists, list takes role of running counter; use zip [0..] list of items assign indices, intmap.fromlist construct final result. sure, it's same thing in both cases. having lazy infinite lists lets express concept more directly without having worry details length of input list or keep

nhibernate - Application_BeginRequest() Object reference not set to an instance of an object -

i getting error in mvc application when trying create connection. i'm using nhibenate along ninject. global.asax.cs file: namespace web.ui { public class mvcapplication : ninjecthttpapplication // system.web.httpapplication { public static isessionfactory sessionfactory { get; set; } public void createsessionfactory() { sessionfactory = (new configuration()).configure().buildsessionfactory(); } public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults ); } protected override ikernel createkernel() { re

php - codeigniter -> having trouble loading multiple libraries/classes -

ok, in base controller (page.php) have following code works fine: $this->load->library('siteclass'); $mysite = new site_model(); the siteclass library references model named site_model , instantiates based on data received model. good. now want load library can instantiate object well. add page.php: $this->load->library('memberclass'); $mysite = new member_model(); but following error: message: undefined property: memberclass::$site_model filename: libraries/loader.php line number: 1035 from can tell, seems loader class, when being applied memberclass, somehow still referencing site_model instead of member_model. i've checked code , calling correct files. here's siteclass.php looks like: if ( ! defined('basepath')) exit('no direct script access allowed'); class siteclass extends controller { function __construct() { parent::controller(); $this->load->model('site_model&

eclipse - Setting up Android Development Environment on Windows 7 -

i want start learning android developement. have windows 7 home premium operating system. problem not able setup environment of developing android. here have done till now. i have installed java (both 32 bit , 64 bit versions) i have installed android sdk (installer_r08-windows.exe) i have not yet downloaded tools or platforms or adt. i have downloaded 32 bit eclipse. (eclipse-sdk-3.5.1-win32.zip) i stuck @ eclipse setup. strange thing observed that, not install. when click on eclipse.exe, starts running there only. still not sure if eclipse installation proper? so, assumed eclipse working fine. when try installing new programs in eclipse, eg google plugin, gives error. i want know, going wrong? mistakes doing? can guide me complete step step procedure setup android development environment on windows 7? thanks in advance. jay to 5: eclipse don't have normal installer, zip file can extract , run anywhere. to 6: errors get? (i update answer when deliv

javascript - How to get alf_ticket in Alfresco Share 3.4 -

i've been using context.properties.alfticket ticket custom stuff i've been working before, migrated alfresco 3.0 3.4. now can't find authentication ticket in alfresco share - there way this? whether in javascript (server-side, of course) or freemarker. edit: added bounty. i'll give bounty whoever gives me code sample on how alf_ticket in document-details.get.js or document-details.get.html.ftl . in alfresco webscript use session.ticket , should available in share to. link alfresco 3.4 javascript api useful, don't think references anywhere on alfresco site.

wss 3.0 - How to edit the top level default.aspx in WSS3 site with VS(2010)? -

i can open default.aspx of sub-site no problem.( file open,type or browse url ) but can't open default.aspx of top-level site or wss site, in vs2010. i have use spd. is there permission set somewhere? you can edit sharepoint sites in vs 2010. indirect way download default.aspx, edit in vs 2010 , upload back. cumbersome , not recommended. sharepoint designer preferred way edit sharepoint sitse.

jquery - How to associate an event with only one object? jqplot -

im using jqplot draw charts. great tool, lacks simple clickhandler option each chart. its plugins highlighter, draggable , cursor register interest in capturing click/mouse-events jqplot canvas adding jqplot.eventlistenerhooks (eventlistenerhooks.push(['jqplotclick', callback]); example. or 'jqplotmousedown' or such available. after making plot usual $.jqplot(target, data, options); $.jqplot.eventlistenerhooks.push(['jqplotclick', myfunc]); and sure enough myfunc gets called wherever click on plot, event , neighbour , datapos , gridpos . neighbour interesting, contains data point if there click on it. data need make popup close gridpos aditional information on datapoint. but problem if have 2 charts on same page , want register different callbacks each jqplot. now, when register second myfunc2, clicks on second plot go through myfunc aswell! do need make changes jqplot? directions, whatsoever? thanks this isn't well-documented, ca

yaml - Rails 3 render problems -

i writing script allows user pass format via url parameter. have json , xml working needed, can't yaml working. case params[:format] when "xml" respond_with(@labels) when "json" respond_with(@labels_hash.to_json) when "yaml" render :text => @labels_hash.to_yaml end for reason when pass format=yaml in url script tries force download file. reason why happen? working code: case params[:format] when "xml" respond_with(@labels) when "json" respond_with(@labels_hash.to_json) when "yaml" respond_with(@labels_hash) |format| format.yaml { render :text => @labels_hash.to_s } end end try: adding :yaml respond_to :yaml in controller, , : respond_to |format| ....other formats.... format.yaml { render :yaml => @labels_hash } end

c# - Extract content in paragraph Tags -

Image
i have following html in string , have extract content in paragraph tags ideas?? link http://www.public-domain-content.com/books/coming_race/c1p1.shtml i have tried const string html_tag_pattern = "<[^>]+.*?>"; static string striphtml(string inputstring) { return regex.replace(inputstring, html_tag_pattern, string.empty); } it removes html tags dont want remove tags because way how can content paragraph tags secondly makes line breaks \n in text , and applying replace("\n","") dose not helps 1 problem when apply int urlstart = e.result.indexof("<p>"), urlend = e.result.indexof("<p>&nbsp;</p></td>\r" ); string paragraph = e.result.substring(urlstart, urlend); extractedcontent.text = paragraph.replace(environment.newline, ""); <p>&nbsp;</p></td>\r appears @ end of paragraph urlend dose not makes

visual studio - Do not compile t4 file -

suddenly, after doing tfs 2010 get, visual studio 2010 attempting compile .tt file if c#. moreover, anytime set "build action=none", build action gets mysteriously reset compile. breaking our builds on desktop. can builds work on desktop closing reopening vs. our builds on tfs totally broken because of this. do? the template generates (totally ok) c# file, need project build. i tried changing file extension .tt .donotbuilddammit had no effect. are chance using clairus t4 plugin (or t4 intellisense provider)? if so, try making sure files not open when change buildaction setting. visual studio builds intellisense based on compile action of files. provide intellisense files marked "compile". because of that, change build action when file open, , change whatever before when checking in, closing file, closing visual studio , when opening visual studio (in case crashed) see: http://forums.clariusconsulting.net/viewt

Initializing objected created in .NET CollectionEditor with a specific reference -

i need initialize new objects created collectioneditor specific reference. more specifically, have object, pipeline, can edited in propertygrid. object contains collection of markers. markers need reference pipeline in order calculations. currently, propertygrid pipeline has entry markers. clicking on ellipse button brings collectioneditor. editing properties fine, need set current pipeline new markers created. i'm not sure of best way that. there events can monitor? need create custom collectioneditor (but how know specific pipeline?)? you need create custom collectioneditor , custom propertydescriptor class. propertydescriptor can store pipeline object gets passed collection editor overriding propertydescriptor.geteditor. let pipeline create new markers objects , required initialization. here code started: public class mycollectioneditor : system.componentmodel.design.collectioneditor { private pipeline _pipeline; public mycollectioneditor(type

android - Extract base url from full url -

any quick way extract base url full url? e.g., if have http://test.example.com/abcd/test.html - want http://test.example.com . i can string parsing - wanted know if there in uri can directly. what about: import java.net.url; import java.net.malformedurlexception; try { url url = new url("http://test.example.com/abcd/test.html"); string baseurl = url.getprotocol() + "://" + url.gethost(); } catch (malformedurlexception e) { // }

xml - Creating a child class of XElement that still keeps a reference to the original XElement and preserves the tree structure -

to start things off, let me explain i'm working class inherits xelement class. new class called mxelement . adds new functionality navigating through xml tree, more information regarding attributes, that's not particularly important. problem have xml tree filled xelement objects. however, when create new mxelement object xelement object before, copy of object. means changes make object not effect original tree. i suppose i'm asking way build in functionality mxelement class , keep references original xelement objects. if possible, prefer keep mxelement child class instead of building lot of extension methods xelement . i reworked entire idea , instead of using child class, used xpath modify tree. for future ideas, know if there still solution original problem, solution chose current problem.

php - suggestions for unit testing exceptions -

consider method might throw exception descriptive text: if ($somecondition) { throw new \whatever\exception('dilithium exhausted'); } and elsewhere in method block might throw same exception, different text: if ($anothercondition) { throw new \whatever\exception('differentialator exploded'); } while writing unit tests class, create failure cases can verify these 2 exceptions thrown properly. in these failure cases, prefer to: a) use @exceptionexpected in test method's docblock trap generic \whatever\exception class , subsequently ignore getmessage() text, assuming got right one? (seems bad idea.) or: b) use try/catch , assert caught exception's getmessage() text equals exact descriptive string you're expecting? (more resilient means changing tests whenever change error wording.) or: c) create separate exception each error case (e.g., \whatever\dilithiumexception , \whatever\differentialatorexception) , use @exceptionexpected eac

c# sorting list by substring -

i have list of strings: \\\\tecan1\\tecan #1 output\\15939-e.esy\r\n \\\\tecan1\\tecan #1 output\\15942-e.esy\r\n \\\\tecan1\\tecan #1 output\\15945-e.esy\r\n \\\\tecan1\\tecan #1 output\\15948-e.esy\r\n \\\\tecan1\\tecan #1 output\\15951-e.esy\r\n \\\\tecan1\\tecan #1 output\\15954-e.esy\r\n \\\\tecan1\\tecan #1 output\\15957-e.esy\r\n \\\\tecan1\\tecan #1 output\\15960-e.esy\r\n \\\\tecan1\\tecan #1 output\\15963-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15940-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15943-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15946-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15949-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15952-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15955-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15958-e.esy\r\n \\\\tecan_2\\output on tecan 2\\15961-e.esy\r\n \\\\tecan-5\\output\\15941-e.esy\r\n \\\\tecan-5\\output\\15944-e.esy\r\n \\\\tecan-5\\output\\15947-e.esy\r\n \\\\tecan-5\\output\\15950-e.esy\r\n \\\\tecan-5\\output\\15953-e.esy\

iphone - alSourcePlayv question -

i want play multiple audio sources using alsourceplayv. me initialisation of buffers please. many thanks! http://www.hollance.com/2011/02/soundbankplayer-using-openal-to-play-musical-instruments-in-your-ios-app/

css - I want to apply a overlay image on hover -

Image
but struggling. code have css is: #gallery img { width:700px; height:213px; margin:0; padding:0; } so thought ... #gallery img:hover { width:700px; height:213px; position: relative; z-index:10000; background: transparent url(../images/imgoverlay-zoom.png) no-repeat center center; } would work, doesnt. the image transparently overlaying on hover is: what doing wrong. think may have corrupt css tag somewhere. any appreciated. make #gallery have background image rather having image tag inside it... otherwise it'll on top of background. have div inside has :hover pseudo-class. if still doesn't work, take out word transparent . or not overlay image , swap original image combined image?

python - How to get property from ReferenceProperty class when downloading App Engine data using bulkloader? -

i want download app engine data can operate on efficiently locally (i'm generating pdfs based on it). how can define column referenceproperty gets populated particular property of referenced model rather key or id? here model classes: class department(db.model): name = db.stringproperty() class user(db.model): userkey = db.stringproperty(required=true) secret = db.stringproperty() dept = db.referenceproperty(department, required=true) however, though have described property_map in bulkloader.yaml so: - kind: user connector: csv connector_options: property_map: - property: __key__ external_name: key export_transform: transform.key_id_or_name_as_string - property: dept external_name: dept import_transform: transform.create_foreign_key('department') export_transform: transform.key_id_or_name_as_string - property: secret external_name: secret - property: userkey external_name: userkey

c# - Which encoding to use in App.Config? -

following config file causes error because of & in 'url' value: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key ="url" value ="http://www.example.com/?user=admin&password=1234"/> </appsettings> </configuration> the question encoding use key/value in config file ? (i.e url encoding ...) this xml file. such, must xml-escape reserved characters: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key ="url" value ="http://www.example.com/?user=admin&amp;password=1234"/> </appsettings> </configuration> programmatically can perform type of escaping using system.web.httputility.htmlencode method. yes, name suggests html specific encoding, in experience equivalent xml escaping.

javascript - Ext Js Listview columns are not hiding or widening properly -

i have ext js listview attempting rid, or make id column smaller. right it's following code this.rellist = new ext.list.listview({ singleselect: true, store: this.buildstore(), columns: [{ header: 'id', dataindex: 'id', hidden: true }, { header: 'name', dataindex: 'name', }] }); when listview displayed, still shows id column though told hide it. furthermore, if change hidden:true width: 1 make id column small, name column no longer shows , id column takes whole listview. how can hide column? why use id column @ all? can access data via record.data or through store , not need add column

string - Need help with a Windows batch script which should set val of var based on part of a file name -

this not homework - have homework on batch scripting? need automate something. there hard-coded batch script meant run daily systems, , needs work in dynamic fashion. needs input build number, can deduced name of file located @ ... c:\dumplocation\ . not @ batch scripting, , looking batch ninja. if me, code in python myself, cannot expect others install this. powershell not available on every windows computer, batch script lowest common denominator. this should help: http://www.techsupportforum.com/microsoft-support/windows-xp-support/54848-set-variable-based-output-seach-string-batch.html here want script do: dirtolookat = 'c:\dumplocation\' # in location there should single file named # custom_somethingbuild34567client_12345.zip # want extract build number variable effect: buildnumber = '34567' # strings surround build number fixed. # if there more 1 zip file build number in it, # need print warning , pick largest one. # can rest. the following should well

XNA GIF Animation Library problem -

hey guys, trying use xna gif animation library found online, when running , keep givving me exception said "the size of data passed in large or small resource." gifanimationcontenttypereader (int = 0; < num; i++) { surfaceformat format = (surfaceformat) input.readint32(); int width = input.readint32(); int height = input.readint32(); int numberlevels = input.readint32(); frames[i] = new texture2d(graphicsdevice, width, height, false, format); (int j = 0; j < numberlevels; j++) { int count = input.readint32(); byte[] data = input.readbytes(count); rectangle? rect = null; frames[i].setdata<byte>(j, rect, data, 0, data.length); } } at line "frames[i].setdata(j, rect, data, 0, data.length);" donno how, data length huge though anyone know hows happen thx the n

php - Array of two types -

i have 2 arrays : array ( [0] => mon [1] => sun ) array ( [0] => array ( [date] => 2010-12-20 [hours] => 4 ) [1] => array ( [date] => 2010-12-19 [hours] => 2.0 ) ) how combine both as: array ( [0] => array ( [date] => 2010-12-20 [hours] => 4 [day] => mon ) [1] => array ( [date] => 2010-12-19 [hours] => 2.0 [day] => sun ) ) thanks - haan // copy array 2 result array. $combined = $arr2; // add new key 'day' value first array. for($i=0;$i<count($combined);$i++) { $combined[$i]['day'] = $arr1[$i]; } see it

apache - htaccess : redirect an iphone user unless -

i've been reading on syntax constructing htaccess rules no matter try, can't want do. i aiming redirect iphone visitors subfolder on domain, easy enough: rewritecond %{http_user_agent} iphone rewritecond %{request_uri} !^/iphone rewriterule .* http://domain.com/iphone/ [r] this redirects iphone users aren't trying go http://domain.com/iphone . however, don't want redirect users trying go domain.com/app (this url has own redirect apple app store page, want iphone users redirected there well, rather iphone version of site). tried this: rewritecond %{http_user_agent} iphone rewritecond %{request_uri} !^/app rewritecond %{request_uri} !^/iphone rewriterule .* http://domain.com/iphone/ [r] i thought /app condition should work in parallel /iphone condition, seems iphone visitors domain.com/app still being redirected munch5aday.com/iphone/ . very grateful suggestions! add line rewriteengine off directory's .htaccess file. adding answer avoid

tutorial to write tinymce plugins? -

i using jquery tinymce. developing advanced tinymce same wordpress. i give edit option images. need of tinymce plugins tutorial learn fast , write plugin. moxiecode reworked website. new link short tutorial on howto create plugin http://www.tinymce.com/wiki.php/tutorials:creating_a_plugin

Does Symfony sfLucenePlugin support the symfony1.4 using propel as ORM? -

does symfony sfluceneplugin support symfony1.4 using propel orm? sfluceneplugin integrates symfony , zend search lucene instantly add search engine application. plugin auto-detect orm layer, supports propel.

c++ - NetworkManager and Qt Problem -

i still new using qt4/dbus, , trying list of acccess points qt api send/receive dbus messeges. got following error: org.freedesktop.dbus.error.unknownmethod method "getaccesspoint" signature "" on interface "org.freedesktop.networkmanager.device.wireless" doesn't exist the code is: qstringlist *netlist = new qstringlist(); qdbusconnection sysbus = qdbusconnection::systembus(); qdbusinterface callnm("org.freedesktop.networkmanager","/org/freedesktop/networkmanager","org.freedesktop.networkmanager.device.wireless",sysbus); if(callnm.isvalid()) { qdbusmessage query= callnm.call("getaccesspoints"); if(query.type() == qdbusmessage::replymessage) { qdbusargument arg = query.arguments().at(0).value<qdbusargument>(); arg.beginarray(); while(!arg.atend()) { qstring element = qdbus_cast&l

javascript - jquery validation working on some browsers, but not on others -

why work people, , doesn't others? others click button , doesn't work. started doing after added nospaces validation method. suggestions appreciated. <form method="post" action="#" id="client_form" class="order-form"> <input type="text" id="user_name" name="user_name" class="req nospaces" /> </form> <button id="client_next_btn"><?php echo($content->getstring('order')); ?></button> <script type="text/javascript"> $(function () { jquery.validator.addclassrules('req', { required: function (el) { return $(el).is(':visible') } }); var nums = ['0','1','2','3','4','5','6','7','8','9']; var letters = ['q','w','e','r','t','y','u','i','o','p','a',&

.net - Handling configuration errors - global.asax? -

i have web application uses third party connector access salesforce. when set works should. contacts salesforce populates application using membership providers. however when loose connection salesforce site goes down throwing "configuration error". able handle error more gracefully if possible. there way this, maybe in global.asax? best case able disable connection still having website , running. any thoughts? you have many options: try-catch-finally page_error method application_error method web.config file if want display error message on parts of page, use try-catch , can continue other transactions not require connection. or can use page_error catch unhanded errors on page-level or application_error (you using global.asax file) exceptions not handled try-catch , page_error method. if prefer redirect different error page use section on web.config. for references, can read these articles: http://www.4guysfromrolla.com/articles/081209-1.aspx

Django Schemas Postgresql -

for few days i'm trying following right django i.c.w. postgres: i have 1 database multiple schemas. there 2 kinds of schemas: app site the app schema can used sites , site schemas visible specific database user. for example: (sites, every site has different schema) site1 site2 site3 (apps, every app has different schemas or can placed within 1 schema): app app1 app2 or app1 app2 is there way achieve django?

ipad - touchesbegan didn't detected in UIImageView -

hi have 5 imageviews, off them subviews in navigation bar. want tapcounts each imageview, think have use touchesbegan method. actually, there's no touch event detected in every imageview. precisely, touchesbegan detected in toolbar. hierarchy : uiviewcontroller -> uitoolbar -> uinavigationbar -> uiimageview this code : -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event{ int indexsegment = _docsegmentedcontrol.selectedsegmentindex; cgrect frametouch; if (indexsegment == 0) { frametouch = frame; }else if (indexsegment == 1) { frametouch = frame1; }else if (indexsegment == 2) { frametouch = frame2; }else if (indexsegment == 3) { frametouch = frame3; }else if (indexsegment == 4) { frametouch = frame4; } uitouch *touch = [touches anyobject]; //--image 0-- cgpoint gesturestartpoint0 = [touch locationinview:imageview]; if (cgrectcontainspoint(frame, gesturestartpoint0)) { [nsobject cancelpreviousperformrequestswi

python - UnicodeEncodeError in Mako Template -

i have following files dummy.py #!c:/python27/python.exe -u mako import exceptions mako.template import template print "content-type: text/html" print #variable = "we" variable = "我们" template = template(filename='../template/dummy.html', output_encoding='utf8') try: print template.render(variable=variable) except: print exceptions.html_error_template().render() dummy.html (saved in utf-8 format) hello world 哈罗世界 ${variable} i had refereed instruction http://www.makotemplates.org/docs/unicode.html however, still error unicodedecodeerror: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128) anything had missed out? template = template(filename='../template/dummy.html', default_filters=['decode.utf8'], input_encoding='utf-8', output_encoding='utf-8')

c# - RegEx for the <li></li> tags -

i working on c# winform application. in application, have snippet this: <ul> <li>abc <li>bbc <li>xyz <li>pqr </li></li></li></li> </ul> but, want output like.. <ul> <li>abc</li> <li>bbc</li> <li>xyz</li> <li>pqr</li> </ul> is there method using thing can done? can suggest me regex problem? thanks. regards. its simple without using fancy regex try below, can implement own code 1. first remove </li>'s snippet line.replace("</li>","") 2. read each line starts <li> if (line.startswith("<li">) 3. , append </li> @ end line+ ="</li>" 4. combine line resstring += line;

Arabic languge in android -

android still not support arabic language in last version 2.3 , maybe not in 3.0 also any way programmer if want make arabic support how start make support arabic ? because found companies samsung , htc add arabic support there devices mean every body if has knowledge system can add support. can body guide me how start ? thank you android 3.0 honeycomb has official native support arabic. source: xda-developers , http://bit.ly/honeycomb-arabic , ardroid as smart phones, cyanogenmod 7 has decent arabic support .

Help with SQL Stored procedure -

i need sql stored procedure, haven't got alot of experience it. have table "dbo.lookup_country". contains 3 fields: id, name, code. wrote stored procedure retrieves country name code. select name lookup_country code = @code i need adjust stored procedure if there 0 results has see if there results searching id: select name lookup_country id = @code so need kind of 'if' structure: if (select name lookup_country code = @code) == 0 results select name lookup_country id = @code is possible? thx thx everyone, used this: declare @name nvarchar(50) -- insert statements procedure here set @name = (select name dbo.lookup_country code = @code) if @name != '' select name dbo.lookup_country code = @code else select name dbo.lookup_country id = @code put results of first select variable, can count on result, , if 0 search id. to learn more how use if statement check out article, if using sql server, but, if using differe

c# - Can we write independent of machine(i.e. independent of OS) code in asp.net? -

as have read msil manages code make independent of machine;but have read dot net provide windows independence not plateform. please explain if theoretically , technically .net provides platform independence. practically there no implementations microsoft of .net outside windows obvious reasons. there mono other platforms compatible need check if part of framework using supported on mono. of asp.net supported.

java - how to start stop tomcat server using CMD? -

i set path tomcat , set variables like java_home=c:\program files (x86)\java\jdk1.6.0_22 catalina_home=g:\springwork\server\apache-tomcat-6.0.29 classpath=g:\springwork\server\apache-tomcat-6.0.29\lib\servlet-api.jar;g:\springwork\server\apache-tomcat-6.0.29\lib\jsp-api.jar;.; when go bin folder , double click on startup.bat tomcat starts , when double click on shutdown.bat tomcat stops. but want using cmd start , stop tomcat. , in folder write command startup.bat server start , when write shutdown.bat server stop. add %catalina_home%/bin path system variable. go environment variables screen under system variables there path variable edit variable , add ;%catalina_home%\bin variable click ok save changes. close opened command prompts open new command prompt , try use command startup.bat .

What is RevertToSelf()? - C#.net -

i don't understand reverttoself() in .net application. checking msdn definition reads definition as the reverttoself function terminates impersonation of client application. so current user context changes sysadmin context stopping client's context? calling reverttoself() code run on sys admin mode? update okay happens if call reverttoself() in asp.net application? let consider dont start impersonation. if call reverttoself() revert application pool identity? reverttoself terminate impersonation have actively enabled. may set application impersonate user account. reverttoself has no effect unless you're using impersonation. calling reverttoself code run administrator, if application run administrator begin with, , within application configured impersonate account.

php - how can i allow url fopen on .htaccess? -

i want allow url_fopen on php.ini settings set on, dnt have access on shared server, how can use .htaccess file allow hapen, :)) if host disabled security reasons, cannot override it, defeat purpose of disabling it.

memory of the USB devices in power 2? -

why memory of usb devices in powers of 2? because memory devices array of bytes or words. such there address (index) , data both binary numbers. 1 megabyte memory have 20 bit address "bus" , 8 bit data bus. these buses physically constructed 1 electrical conductor per bit, 1meg device have 20 address pins , 8 data pins. in dram, there may multiplexing, half of address sent on 1 clock cycle , other half on clock cycle - can reduce number of physical pins , traces on circuit board. making 2meg memory out of such chips easy, connect address , data pins , use "chip select" pin determine 1 being accessed via 21st address bit. partitioning memory in non-power-of-2 scheme requires lot more circuitry , interconnection complexity figure out chip data in, , means not using every bit combination of address lines mean less efficient use of circuitry. hope helps.

c# - okay, exactly where should i create dynamic controls -

i have been active on 2 questions regarding dynamic controls, answer re-creating on postback, question where correct place this here 2 questions question one question 2 we our dynamic control creation overriding createchildcontrols having looked through lot of controls in reflector, telerik controls thought correct, many people should created in init. should continue using createchildcontrols or init correct way... why seem such area of confusion.. in truth, both accomplish same thing. if developing controls organization, putting in init fine (as in work though "technically place should be", ms has created method expect go. if telerik, creating controls else use, put in createchildcontrols class. why? because, people expect, , ms wants control developers do. have concerned in situation (especially if controls develop aren't sealed), can override different methods, , you've seen lot of people override init class make code work way want

Is it possible to convert this jquery chain returning a string into an array without a separate iteration? -

i have html snippet following <tr class="new"> <td> <input name="id" type="checkbox"/> <span>9</span> </td> <td> // other stuff... </td> </tr> // other table rows <tr class="new"> <td> <input name="id" type="checkbox"/> <span>12</span> </td> <td> // other stuff... </td> </tr> currently, .find('.new').find('input[name="id"]:checked').next().text().trim(); gives me string "912". is there anyway can array [9,12] or ["9","12"] without having explicitly iterate through list of inputs returned .find snippet? open changing query in order avoid iteration. you can use .map() , this: var arr = $('.new input[name="id"]:checked + span').map(function() { return $.trim((this).text()); }).get(); if want a

How to use SSL with a WCF web service? -

i have web service in asp.net running , works fine. need access methods in web-service using ssl. works perfect when contact web-service using http:// https:// "there no endpoint listening @ https://...". can please me on how set web.config support both http , https access web service. have tried follow guidelines can't working. some code: my testservice.svc: [servicecontract(namespace = "")] [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] public class testservice { [operationcontract] [webget(responseformat = webmessageformat.json)] public bool validuser(string email) { return true; } } my web.config: <system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" /> <behaviors> <endpointbehaviors> <behavior name="serviceaspne

jQuery not calling form .submit() when using Ajax on IE -

i using jquery plugin magic during .submit of form (creates hidden string , writes <input type="hidden"> item). on ie works if submit form via post, if use ajax, .submit callback never called. here example of flow: <script type="text/javascript"> (function (jquery) { jquery.fn.createhidden = function () { // 1. want have called $(this).submit(function () { var hiddentext = $(document.createelement('input')); hiddentext.attr('name', 'hidden'); hiddentext.attr('type', 'hidden'); hiddentext.val('1'); $(this).append(hiddentext); alert("1"); }); // 2. came workaround $(this).parents('div.formwrapper').submit(function () { var form = this.children('form'); if (form && form.t

oop - Using JSON notation, how do I create a public method in javascript? -

in example: var circle = { radius : 9, getarea : function() { return (this.radius * this.radius) * math.pi; } }; from this page 's encapsulation topic, getarea private, how public? that's not json notation , that's javascript object literal notation. (json subset of object literal notation. doesn't allow functions, requires double quotes, , doesn't support octal or hex.) getarea isn't private, can call it. page quoted incorrect. if want patterns private methods in javascript, here's roundup desciptions of various trade-offs (including memory cost of crockford model, common form).

java - SWT StyledText - Table with MeasureItem listener jumps to top -

i have styledtext widget embedded table controls. however, once add measureitem listener adjust size of table cells, table appears @ top of styledtext widget first time scroll, remaining there until scroll way expected location. is known issue? doing wrong? code snippet: import org.eclipse.swt.swt; import org.eclipse.swt.custom.paintobjectevent; import org.eclipse.swt.custom.paintobjectlistener; import org.eclipse.swt.custom.stylerange; import org.eclipse.swt.custom.styledtext; import org.eclipse.swt.graphics.glyphmetrics; import org.eclipse.swt.graphics.rectangle; import org.eclipse.swt.layout.filllayout; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.event; import org.eclipse.swt.widgets.listener; import org.eclipse.swt.widgets.shell; import org.eclipse.swt.widgets.table; import org.eclipse.swt.widgets.tablecolumn; import org.eclipse.swt.widgets.tableitem; public class jumpingtable { public static void main(string[] args) { // initial

java - Connecting to Sharepoint using HttpClient -

i trying connect sharepoint 2007 using httpclient 4. authentication scheme ntlm , wrote implementation based on (http://hc.apache.org/httpcomponents-client-ga/ntlm.html). when try connect supplying ntcredentials (username,password,host & domain), 500 error saying "the requested function not supported". i trying understand error. know error is? , why occuring? thanks

python - Storing Templates and Object-Oriented vs Relational Databases -

i'm designing custom blog software, , have run conundrum regarding database design. software requires there multiple content types, each of require different entry forms , presentation templates. my initial instinct create these content types objects, serialize them , store them in database json or yaml, entry forms , templates simple strings attached "contenttypes" table. seems cumbersome, however. there established best practices dealing design? use case should consider object database? if should using object database, should consider? working in python , prefer capable python library, can move java if need be. please not store templates (that might altered user) in database. there's no sane way migrate staging environment production if have deal doffs of database dumps. dumping software right 1 reason. apart i'd store source (user editable part) in database plus "precompiled version" either directly in database (for faster retr

python - Autocorrelation of a multidimensional array in numpy -

i have 2 dimensional array, i.e. array of sequences arrays. each sequence calculate autocorrelation, (5,4) array, 5 results, or array of dimension (5,7). i know loop on first dimension, that's slow , last resort. there way? thanks! edit: based on chosen answer plus comment mtrw, have following function: def xcorr(x): """fft based autocorrelation function, faster numpy.correlate""" # x supposed array of sequences, of shape (totalelements, length) fftx = fft(x, n=(length*2-1), axis=1) ret = ifft(fftx * np.conjugate(fftx), axis=1) ret = fftshift(ret, axes=1) return ret note length global variable in code, sure declare it. didn't restrict result real numbers, since need take account complex numbers well. using fft-based autocorrelation : import numpy numpy.fft import fft, ifft data = numpy.arange(5*4).reshape(5, 4) print data ##[[ 0 1 2 3] ## [ 4 5 6 7] ## [ 8 9 10 11] ## [12 13 14 15] ## [16 17 18 19]] da