Posts

Showing posts from January, 2010

c# - The name 'GridView1' does not exist in the current context Glossary.aspx.cs -

glossary.aspx here html code site. plan add login people can edit table based upon active directory. <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title spellcheck="true">lexis nexis glossary</title> </head> <body> <form id="form1" runat="server"> <div style="margin-left: 720px"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div> <asp:sqldatasource id="tedglossary" runat="server" connectionstring="<%$ connectionstrings:glsry_taylor %>" selectcommand="select [termtext], [defnbr], [defvernbr], [deftext], [amplifyingexplanationtext], [seealsotext], [authoritativesrctext], [scopename], [domnname], [governancestatename], [lastupdttimestamp] [glossary] order [termtext]"></asp:sqldatasource> <asp:gri

jquery - select parent node if all children have assigned class -

i looking efficient way traverse unordered list contains multiple levels contain class .selected. if ul li in group have class .selected, need add class .selected parent li of child ul. <ul> <li>one <-- li adds class .selected if children have .selected <ul> <li class="selected">red</li> <li class="selected">green</li> <li class="selected">blue</li> </ul> </li> <li>two <ul> <li class="selected">red</li> <li>green</li> <li class="selected">blue</li> </ul> </li> <li>three</li> </ul> if children in given ul have class .selected add class .selected parent li, in case li containing text "one" parent li have class .selected added. i need happen when page l

asp.net mvc - cannot use Html helper in partial view? -

background i have following method in controller [httpget] public actionresult getmodulepropertyname(string moduletypevalue) { var modulekindid = _repository.getmodulekindid(moduletypevalue); var modulepropertynames = _repository.getmodulekindpropertynames(modulekindid); return partialview(modulepropertynames); } modulepropertynames may contain list of strings of null. what want do i want create text box each string passed partial view placeholder or label string, user type text there later retrieve. what i've been doing i'm doing following right now, says cannot resolve symbol textboxfor @foreach (var names in model) { <div class="input-block-level">@html.textboxfor(names, new {@placeholder = names})</div> } here web.config of area i've been working on <?xml version="1.0"?> <configuration> <configsections> <sectiongroup name="system.web.webpages.razor" type=&q

javascript - How to add emmet support in ace js code editor? -

i trying embed ace code editor in project. initializing code editor following code , want enable emmet js features. can see ext-emmet.js extension in src directory of ace.js pre-packaged version i need in enabling emmet extension features. here initialization code. var e = ace.edit("editorid"); // id of code editor div e.settheme("ace/theme/monokai"); e.getsession().setmode("ace/mode/html"); e.setbehavioursenabled(true); e.getsession().settabsize(2); obviously adding ace.js on top of page. can provide more details if needed. see lines 533-537 in ace demo. basically need load emmet source script (e.g. https://github.com/nightwing/emmet-core/blob/master/emmet.js ) , ace extension /src/ext-emmet.js call require("ace/ext/emmet"); requirejs executes script , after call editor.setoption("enableemmet", true); . see jsbin.com/ace-emmet/1/edit live demo.

javascript - Url has ?_=*Number* after each GET call? -

i have been setting mvc project webapi. have working not know why calls have additional pieces url's. example: /api/user/zholen?_=1373490280823 can explain me number @ end for? seems attached calls , ones call via javascript. i using amplify.js when making these calls javascript. noticed number increments per call ***23, 24, 25 etc. i send cookie each call stores information current logged on user. i not sure which, if any, of these things causing number generated. jquery adds ajax urls prevent caching. to prevent this, pass cache: true option.

Programatically Add Main LinearLayout and Button to Android App -

Image
there no xml this. question why button not show on screen? i have added layout setcontentview , added button. why not show? package com.my.layoutexample; import android.app.activity; import android.os.bundle; import android.widget.button; import android.widget.linearlayout; public class mainactivity extends activity { @suppresswarnings("deprecation") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); linearlayout mainlayout = new linearlayout(null); mainlayout.setlayoutparams(new linearlayout.layoutparams( linearlayout.layoutparams.wrap_content, linearlayout.layoutparams.wrap_content)); mainlayout.setorientation(linearlayout.vertical); setcontentview(mainlayout); button button = new button(null); button.settext("send"); button.setlayoutparams(new linearlayout.layoutparams( linearlayou

html - Margin-bottom not working correctly in responsive design -

i have odd problem in using margin-bottom in class responsive design. example html <div class="space-bottom"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque commodo sollicitudin molestie. in lacus purus, posuere non lacus eu, pharetra suscipit arcu.</p> </div> css .space-bottom{margin-bottom: 10px} the class "space-bottom" margin bottom of 10px not work in mobile device. if insert in media query weird. when change "class" "id" html <div id="space-bottom"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. pellentesque commodo sollicitudin molestie. in lacus purus, posuere non lacus eu, pharetra suscipit arcu.</p> </div> css #id space-bottom{margin-bottom: 10px} it seems work. don't need insert attribute inside media query there no issue css in first example; may noticing margins <p> element , <div> colla

mysql - Count and performs an insert or an update -

hi want know if possibile thing in 1 query. $qrystring="select * votes userid='$userid' , messageid='$messageid'"; $qry = $pdo->prepare($qrystring); $qry->execute(); $resultarray=$qry->fetchall(); $num=count($resultarray); if ($num==0) {$qrystring= "insert votes (userid, value, messageid) values ('$id', '$value', '$messageid')" } else { $qrystring = "update votes set value='$value', userid='$id' , messageid='$messageid' " } doing perform @ least 2 queries. it's "grotesque" method (with performance ripercussions) or right way? assumine userid has unique index: insert votes (userid, value) values (:id, :value) on duplicate key update value = values(value); also, since you're using pdo, should using placeholders in prepared statement, not interpolating variables, showed above.

c - Dynamic Allocation of 2D Array -

i implementing graphs using adjacency matrix, unable solve segmentation fault. can me in guiding dynamic allocation of 2 dimensional matrix? want know how 2-d array stored in memory , how accessed. #include<stdio.h> #include<stdlib.h> struct graph{ int v; // represent number vertex... int e; //to represent number edge..... int **adj; // 2 dimensional matrix form adjacency matrix... }; struct graph *adjmatrixofgraph(){ int i; //for scanning edges between them .... int u,v; // loop while initliasing adjacency matrix... struct graph *g=(struct graph*) malloc(sizeof(struct graph)); // if(!g){ printf("memory error"); return; } printf("number of vertices"); scanf("%d",&g->v); printf("%d",g->v); printf("number of edges"); scanf("%d",&g->e); g->adj=(int **)malloc(sizeof(g->v * g

Dynamical output in Python Functions -

when use def, can use **kwargs , *args define dynamic inputs function is there similar return tuples, i've been looking behaves this: def foo(data): return 2,1 a,b=foo(5) a=2 b=1 a=foo(5) a=2 however if declare 1 value unpack, sends whole tuple on there: a=foo(5) a=(2,1) i use 'if' statements, wondering if there less cumbersome. use hold variable store value, return value might kind of large have place holder that. thanks if need generalize return value, this: def function_that_could_return_anything(data): # stuff return_args = ['list', 'of', 'return', 'values'] return_kwargs = {'dict': 0, 'of': 1, 'return': 2, 'values': 3} return return_args, return_kwargs a, b = function_that_could_return_anything(...) thing in a: # stuff item in b.items(): # stuff in opinion simpler return dictionary, access parameters get() : dict_return_value = foo() = dict_

ipad - How do i ensure my contents are upto date when displayed in iOS UIWebview -

i learning management system(lms) administrator e-learning courses. lms loaded uiwebview of ios native app. in scenario, 1) how make sure e-learning courses loads date files , not cache (i not in control of ios app)? 2) ios mobile safari browser there setting clear 'cookies , data'. use option clear cache/cookies make sure mobile safari browser loads date contents. there similar option available clear cache/cookies websites loaded through uiwebview? my target platform ipad ios 6

windows - Why can a socket connect() to its own ephemeral port? -

Image
i can reliably winsock socket connect() if connect localhost port in range of automatically assigned ephemeral ports (5000–65534). specifically, windows appears have system-wide rolling port number next port try assign local port number client socket. if create sockets until assigned number below target port number, , repeatedly create socket , attempt connect port number, can socket connect itself. i first got happen in application repeatedly tries connect port on localhost, , when service not listening establishes connection , receives message sent (which happens redis ping command). an example, in python (run nothing listening target port): import socket target_port = 49400 def mksocket(): return socket.socket(socket.af_inet, socket.sock_stream, socket.ipproto_tcp) while true: sock = mksocket() sock.bind(('127.0.0.1', 0)) host, port = sock.getsockname() if port > target_port - 10 , port < target_port: break print port whi

javascript - jquery not loading in html -

i have started web development. have been trying make pages jquery on them, have been having bunch of trouble. code write , link html page won't load, , when @ console in browser, doesn't show scripts being loaded. way can them load wrapping code in <script> tags in html document itself, , works fine. have tried using <script src="source.js"> in <head> tags, before closing <body> tag nothing happens. .css file loads , aside javascript, website works fine. if see else doing wrong, such formatting code itself, or using bad style, please point out well. trying going developer, give appreciated. here files 1 of many sites have trouble with: <!doctype html> <html> <head> <meta content="text/html; charset=windows-1252" http-equiv="content-type"> <link rel="stylesheet" href="dot_grid.css"> <script src="dot_grid.js"></script>

How convert the code of the google maps api v1 to v2? -

how can on google maps api v2? mapview mv = (mapview) findviewbyid(r.id.mvgoogle); mv.setbuiltinzoomcontrols(true); mapcontroller mc = mv.getcontroller(); arraylist all_geo_points = getdirections(17.3849, 78.4866, 28.63491, 77.22461); geopoint moveto = all_geo_points.get(0); mc.animateto(moveto); mc.setzoom(12); mv.getoverlays().add(new myoverlay(all_geo_points)); use fragmentactivity , in oncreate() method: googlemap mmap =((supportmapfragment)getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap(); arraylist <latlng> all_geo_points = new arraylist<latlng>(); all_geo_points.add(new latlng(17.3849, 78.4866)); all_geo_points.add(new latlng(28.63491, 77.22461)); latlng moveto = all_geo_points.get(0); cameraposition cameraposition = new cameraposition.builder().target(moveto).zoom(12).build(); mmap.animatecamera(cameraupdatefactory.newcameraposition(cameraposition)); check map v2 demo .

html - Print Screen to Website -

this question has answer here: using html5/canvas/javascript take in-browser screenshots 3 answers my user need screen shot error message throw website. should directly paste clipboard in website instead convert jpeg. preferable browser firefox. try use zeroclipboard works words not images. appreciated if advice , share links references. simple answer: can't. there no web-standards way read binary data clipboard, not believe flash or silverlight either (flash can expose bitmap data clipboard, under air, i.e. not in browser context). you write small desktop utility program users download , run, take screenshot , upload them, without users have paste image paint, save disk, , upload <input type="file"> .

multithreading - VB.NET Launching Batch File not working after install -

okay, 1 has me stumped beyond belief. have program installed on different machines supposed execute batch file after has completed specific task. batch file configured via our webservice user, , application pulls path string down , executes file @ path. should pretty simple/straightforward, right? the code: private function executebatchfile(batchfilepath string) string try dim psi new processstartinfo(batchfilepath) psi.redirectstandarderror = true psi.redirectstandardoutput = true psi.createnowindow = false psi.useshellexecute = false dim process process = process.start(psi) process.waitforexit() executebatchfile = process.exitcode catch ex exception strappstatus = "error within execution of batch file: " & ex.message logme(strappstatus) return "fail" end try end function now, tricky part. code works when running in dev environment. have yet have issue.

Page limit and total number of pages in Magento -

i have pagination on category page, however, i'm having few problems it. supposedly, if select limit on dropdown on toolbar, number of products display change. if select 20 on dropdown, there should 20 products on first page instead of 5. however, after i've made customizations on paging (moved paging @ bottom of list, added first , last buttons), dropdown no longer works. there need add or change in code work? i've added text before paging says page n of n. then, made changes on php file test how can modify limit dropdown. changed page limit. there instances wherein page becomes page 5 of 2. how can fix this? update: i've managed fix problem 2 making comparisons one's fixed. problem 1, don't have code show since didn't make changes toolbar.phtml dropdown anyway, here's code inside phtml related limit. <select> <?php foreach ($this->getavailablelimit() $_key=>$_limit): ?> <option value="

What happens when credit card expires on recurring paypal payment? -

on recurring paypal payment, happens when cc expires? will send ipn notification? send email seller , buyer? stopped till cc not updated , continues when updated? what happen, many thing dependent on payment on sites. when credit card going expire buyer needs update billing information. buyer e-mail paypal saying going expire , asks user update billing information. if buyer not update billing details payment fail. reason may not fail because may have money in paypal account or funding source. , ipn post sent failed payment. if buyer update credit or debit card information before recurring profile bills should receive payment successfully.

Partitioning and analyzing a java array with multithreaded processing -

i have initialize float[12000] via loop 12000 times. scan array values exceeding threshold value. if value exceeds threshold, manipulate instance variable of object. example: random random = new random(); float[] x = new float[12000]; (int = 0; < x.length; i++) { x[i] = random.nextfloat(); } (int = 0; < x.length; i++) { if (x[i] >= 0.75) { \\ interesting } } basically, have change values of array , 12000 times on new array each time of length 12000. "something interesting" code merely looking index in data structure , calling setter. system time calculations, should take me 13 hours. have 8 processors on machine. how can take advantage of java's multi-threading capabilities? looking thread solutions partition initializing , scanning of arrays. source code using threads appreciated. you can divide among 8 different threads doing this public class worker implements runnable { final private int minindex; // first index, inclusi

php - How do you add in assets to Laravel 4 from the public directory? -

i trying add in assets can't seem find solid answer online. {{}} not interpolating values , literally being written in source code. know why? current hello.php view is: <!doctype html> <html lang="en"> <head> </head> <body> testing <script data-main="{{ url::asset('public/js/main') }}" src="{{ url::asset('public/js/require-jquery.js') }}"></script> </body> </html> you have name file filename.blade.php in order use blade rendering engine. if don't want use blade, can use regular php: <script src="<?php echo url::asset('js/require-jquery.js') ?>"></script> p.s. path wrong (you don't need public/ part).

sql server - How to make Query for that -

Image
i have table structure there have make query in different way table structure id unique identifier code varchar(5) not null recording_date datetime not null max_temp numeric(5,2) not null min_temp numeric(5,2) not null we have data in table.we have data 2013 year , first 3 months. main thing have return's data in such format like please me create query such logic. thanks in advance. presuming have 1 recording per day select datepart(m, month_start) + ' ' + datepart(yyyy, month_start) , max_temp_days , case when denominator = 0 0 else (max_temp_days / denominator) * 100 end percent_max_temp_days , min_temp_days , case when denominator = 0 0 else (min_temp_days / denominator) * 100 end percent_max_temp_days ( select dateadd(month, datediff(month, 0, recording_date), 0) month_start , sum(case when max_temp <= 0 1 end) max_temp_days ,

sockets - Reading incoming request string in python -

is there way can read incoming message client using 'socket' in python? looking way without using socketserver. doesn't work in case. example, have following piece of code 'accept' incoming connection? how can incoming string this? import socket def serve(self): listener=socket.socket() listener.bind(('',6000)) listener.listen(5) while true: sockadd, c =listener.accept() # can write accepted request string??? # there way it? i have tried listener.recv(1024) gives exception. help please, in advance. sockadd socket representing connection client here, use send , receive message client. data = sockadd.recv(1024) check socket documentation , there several samples.

c# - How to Insert image on web page using image name pulled from access database? -

i'm developing website. have access database pull image names want use parameters post images folder using c# code in vs 2010. want know how access image name string , insert asp image element. i'm guessing need store results of "select" query in variable in order pass through "eval" function, i'm guessing , nor have figured out how it. the following section of code established connection database, used datalist control list information on webpage code for. , i'm trying use file name that's in database parameter grab correct image files , post web page. see below in code filename goes here????? see need put filename picture. <asp:accessdatasource id="accessdatasource2" runat="server" datafile="~/app_data/traveljoansdb.accdb" selectcommand="select * [table2]"></asp:accessdatasource> <asp:datalist id="datalist1" datasourceid="accessdatasource2"

php - Contact form with check boxes having troubles -

i need add check boxes contact form have html. <form action="contact.php" method="post"> name<br><input type="text" name="cf_name"><br> e-mail<br><input type="text" name="cf_email"><br> message<br><textarea name="cf_message"></textarea><br> <input type="submit" value="send"> <input type="reset" value="clear"> </form> and here php part of code <?php $field_name = $_post['cf_name']; $field_email = $_post['cf_email']; $field_message = $_post['cf_message']; $mail_to = 'example@example.com'; $subject = 'message site visitor '.$field_name; $body_message = 'from: '.$field_name."\n"; $body_message .= 'e-mail: '.$field_email."\n"; $body_message .= 'message: '.$field_message; $headers = 'from: '.$fi

Couchbase 1.8.0 some queries -

few queries regarding couchbase 1.8.0 does putting blank value deletes key or key remains is is there way keys bucket. there ways flush keys bucket admin panel. thanks no, blank "value", , cannot send null (at least java). need remove using delete operation or ttl. not in 1.8, in couchbase 2.x can create simple view emit(meta.id) , query view.

Android : Download and Share html file issue -

in application want download , share 1 html file. tried following code: button download = (button) findviewbyid(r.id.downloadbtn); download.setonclicklistener(new onclicklistener() { public void onclick(view v) { string file_url= "/* http url*/"; new downloadfilefromurl().execute(file_url); } }); } class downloadfilefromurl extends asynctask<string, string, string> { /** * before starting background thread * show progress bar dialog * */ @override protected void onpreexecute() { super.onpreexecute(); showdialog(progress_bar_type); } /** * downloading file in background thread * */ @override protected string doinbackground(string... f_url) { int count; try { url url = new url(f_url[0]); urlconnection conectio

excel 2007 - a cell containing the same value of another cell in column -

p12100600006 p12100100000 p12100600000 121006 p12100600006 p12100100000 p12100600000 121006 m12200100012 p12100400000 p12110100001 121101 p12200700000 p12100400000 p12100600000 121006 m12200100012 p12100400000 p12110200016 121102 m12200100012 p12100500000 p12100100000 121001 m12200100012 p12100600000 p12100500000 121005 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 p12200700000 p12200100000 p12200700000 122007 m12200100012 p12200100000 p12200600000 122006 p12200100001 p12200200000 p12200400004 122004 r12200100000 p12200400000 p12205200000 122052 r12200100000 p12200400000 p12205200000 122052 r12200

How to fetch Facebook UserName, Email, phoneno etc from Facebook Authentication for Spring Security in Grails -

i using spring security core plugin authentication purpose , facebook authentication spring security facebook login purpose. fb login works fine spring security plugin. have issue on that. how can fetch username, email, phoneno etc of facebook user can save db. here spring security core person.groovy domain class file ... class person { transient springsecurityservice string realname string username string password boolean enabled boolean accountexpired boolean accountlocked boolean passwordexpired byte[] avatar string avatartype ...... more code ........... } here can see added more fields realname(for saving facebook user name), avatar(for saving facebook user profile image) etc. right username saving facebook_100003641451723 . want real name of user can save realname field. idea how can ?? update : i found 1 solution on there grails facebook login using spring security - how know logged in user name but don't know put code ... void oncreate(facebookuser

cross platform - Unable to apply css in moSync -

i want learn cross platform application development.i using mosync tools it.it uses html,javascript,css. native application provide own api written in javascript.i have run simple demo application.but want apply css code not reflected .i dont understand why not applying css code.i included css html given below <link rel="stylesheet" href="style.css" media="screen" type="text/css"> here css code in want apply margin div .edittext { margin:50px 0px 0px 20px; } here html code <div class="edittext" id="ed1" widgettype="editbox" data-placeholder="title"> </div> make sure css file included in project. <div class="edittext" id="ed1" widgettype="editbox" data-placeholder="title">add text </div>

css - Finding specific div element just below span with title text in cucumber -

i using cucumber , capybara test web page following outline. <span> title 1 </span> <span> text </span> <div> link y </div> <span> title 2 </span> <span> text </span> <div> link y </div> <span> title 3 </span> <span> text </span> <div> link y </div> i want click on link below title 2. since links have same name , same css except being asynchronous ajax calls, can use in finder somehow? want design helper method takes title , finds link exact xpath not work. what have tried far: within(find("span", :text => title)) within(find(:xpath, "../div")) click_link 'publish' end end as can tell xpaths not strong point. i've tried going through native getting path of capybara:node:element using: find("span", :text => title).path hoping extract child nbr of title span using div such find(:xpath, "/div[n]" ). .

c# - How to get the value of a two dimensional array in Razor? -

i have jagged array shown below, , array inside c# code: @{ int[][] array = new int[2][4]; // codes here manipulates values of array. } now want get/traverse values in array. code below don't work. when run program got run-time error "index outside bounds of array." for(var = 0 ; < @array.count(); i++){ alert( '@array['i'].length'); } how that? thanks try like foreach(var subarray in array) { @:alert(subarray.length); } but wont length same since statically declared?

c# - The file name or path doesn't exist or used by other program while writing Excel file -

this question has answer here: create excel (.xls , .xlsx) file c# 38 answers i trying create excel file , write data it. here code using. using excel = microsoft.office.interop.excel; excel.application xlapp; excel.workbook xlworkbook; excel.worksheet xlworksheet; object misvalue = system.reflection.missing.value; xlapp = new excel.applicationclass(); xlworkbook = xlapp.workbooks.add(misvalue); xlworksheet = (excel.worksheet)xlworkbook.worksheets.get_item(1); xlworksheet.cells[1, 1] = "muneeb hassan soomro"; xlworkbook.saveas("csharp-excelwrite.xls",excel.xlfileformat.xlworkbooknormal,misvalue,misvalue,misvalue,misvalue,excel.xlsaveasaccessmode.xlexclusive,misvalue,misvalue,misvalue,misvalue,misvalue); //xlworkbook.saveas("csharp-excel.xls", excel.xlfileformat.xlworkbooknormal); xlworkbook.close(true, misvalue, misvalue); xlapp.quit

import - Apply javascript with the script tag -

i have page users can creates own script modify texts on server (don't worry access restricted few users). users have 3 fields can fill, 1 name of rule, expression replace , last 1 replace with: <label id="name">name: </label> <input type="text" name="rulename" size="50" id="rulename"></input> </br> <label id="input">replace: </label> <input type="text" size="50" name="inputstep1" id="inputstep1"></input> </br> <label id="output">by:</label> <input type="text" size="50" id="outputstep1"></input></br> after rules stored in file on server via php post (i'll spare unecessary details of command...). , rules listed in form checkboxes, , want when checkboxes clicked rule applied. the thing come import script file via script tag importing it doesn&

asp.net - Set property of Page on Response.Redirect("Page.aspx") -

i using asp.net 3.5 c# 2008 . i have master page in have grid view have itemcommand event. master page has 2 child pages page1.aspx , page2.aspx . now, page1.aspx has 2 division let div1 , div2 . by default div1 visible , div2 remains hidden . now, requirement when redirect page1.aspx page2.aspx , want div1 visible . while, when click button masterpage's gridview , itemcommand event fired , redirect me page1.aspx @ time need show div2 , want make div1 hidden. i can pass query string on itemcommand event while redirecting page1.aspx using response.redirect("page1.aspx?displaydivtwo=true") , don't want follow such approach. other solution? tried set property before redirection not working. apart session , querystring can use server.transfer feature. can store data in request.items property of page. there on page you're transferring to. alternatively can use server.transfer feature in combination previouspage directive i

extjs - Add color to fieldlabel -

i put red asterisk after fieldlabel in order user must fill field. there way add directly css code in js code? parameter style example asterisk var blablafield = new ext.form.textfield({ fieldlabel : 'name *', allowblank : false, width : 300 }); you have @ least 3 (imo) clean ways archive this: to automatically field didn't allow blank should use custom form extension this. ext.define('ext.ux.form', { extend: 'ext.form.panel', initcomponent: function() { var me = this; me.on('beforeadd', function(form, field){ if (!field.allowblank) field.labelseparator += '<span style="color: rgb(255, 0, 0); padding-left: 2px;">*</span>'; }); me.callparent(arguments); } }); if want 1 field can use afterlabeltexttpl or afterlabeltpl config property , apply <span style="color: rgb(255, 0, 0); padding-left: 2px;">*</span> or can add dire

Table Alignment Issues HTML JavaScript -

i don't know how going work because, not live website, dashboard pulls data chemical analysis program , give browser view of it. issue have 2 tables need aligned @ top of page. 1 aligned left , 1 centered. right have table image logo.gif aligned center below have table meaning/symbol headers aligned left need on same line can show me do? can email picture if need see looks like. know there lot of broken tags, inherited , works except 2 tables on top. <div align="center"> <table border="0" width="800" id="nav" cellpadding="0" cellspacing="0" valign="top" > <tr> <td height="60" width="100%"><p align="center"><img border="0" src="../images/logo.jpg" width="199" height="101"></td> </tr> <tr> <td width="100%" bordercolorlight="#ffffff" borderc

python - "Least Astonishment" and the Mutable Default Argument -

anyone tinkering python long enough has been bitten (or torn pieces) following issue: def foo(a=[]): a.append(5) return python novices expect function return list 1 element: [5] . result instead different, , astonishing (for novice): >>> foo() [5] >>> foo() [5, 5] >>> foo() [5, 5, 5] >>> foo() [5, 5, 5, 5] >>> foo() a manager of mine once had first encounter feature, , called "a dramatic design flaw" of language. replied behavior had underlying explanation, , indeed puzzling , unexpected if don't understand internals. however, not able answer (to myself) following question: reason binding default argument @ function definition, , not @ function execution? doubt experienced behavior has practical use (who used static variables in c, without breeding bugs?) edit : baczek made interesting example. of comments , utaal's in particular, elaborated further: >>> def a(): ... print("a exec

rails 4 engine optional shared helper -

i upgraded engine rails 4 , i'm having problems trying configure optional shared helper. helper assessable::displayhelper has 2 methods render html. what mean optional is the default config desired helper should made available main.app use outside engine, details hidden. (the html generated hash generated engine used main app) an optional generator installs helper in helpers/assessable/display_helper app user can modify if wish. the optional generator works fine, over-riding helper in engine, can't figure out way make default mode work. i've read note helper load order in rails 4 release notes, not sure need change. i've tried adding helper assessable::displayhelper application controller (not preferred) trying include assessable::displayhelper in stubbed helper. a few other stabs in dark produces , error: runtimeerror: circular dependency detected while autoloading constant assessable::displayhelper ... /users/me/.rvm/gems/ruby-2.0.0-p247@ra

process - Using Correlation Sets in Intalio? -

Image
i have screensot shown below. need know how many correlations used , elements belong correlation. , need describe correlated. understand correlation not in example in intalio. need preparation university exam. i grateful help. in outline pane , can see downward arrow, click on , show 2 options , "templates" , "correation". select correlation option . when select 'correlation' option show executable pool in correlation defind. expand , see correlation name. right click on correlation name , select edit option , take 'correlationset definition" window. there can see variables. variables marked checked 1 used correlation. i hope helps you. thanks, sumit taneja

java - Hibernate Annotations together with EntityManager -

i've created jar module hibernate dependency of <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-annotations</artifactid> <version>3.5.6-final</version> </dependency> and jar module compiles properly. jar module referenced war module has hibernate dependency of <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <version>3.6.0.final</version> </dependency> at run-time war module gives exception of org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.dao.annotation.persistenceexceptiontranslationpostprocessor#0': initialization of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in class path resource and followed by java.lang.no

php - Using Parse_Url to strip url and rebuild within a foreach loop -

i want strip host , path elements "url" in array using foreach loop. i doing comparing results different search engines , few "matching" due slight difference how search engines handle sites url's. i have read php manual site, tried googling , read many of questions asked on stackoverflow can not find example dealing stripping elements within array within foreach loop , rebuilding them. i hoping use this: {$url0 = parse_url($url, php_url_host); $url1 = parse_url($url, php_url_path); $url = "$url0$url1";} // foreach loop foreach ($jsonobj->d->results $value) { $resultsb[] = array( 'url' => strip_tags($value->url), 'url' => $value->url, 'title' => $value->title, 'rank' => $i--, 'desc' => $value->description, $b++, ); } any on or other method increase accuracy of matching process appreciated. foreach ($jsonobj->d-&g

c++ - How to prevent overflow when using usual math functions exp() log()? -

all in title. how check possible overflow when using 2 functions exp() , log()? to expand answer of @theotherguy, can cancel operation if overflow occurs. #include <stdio.h> #include <math.h> #include <errno.h> int main(void) { double param, result; errno = 0; param = 1e3; result = exp (param); if (errno == erange) { printf("exp(%f) overflows\n", param); result = param; } printf ("the exponential value of %f %f.\n", param, result ); return 0; }

javascript - Wordpress symbols undefined in proxy called AJAX script -

i working hard populate extjs data grid in wordpress plugin. totally new web programming following may stupid question. i managed write php script delivers webpage embedded java sript code creates extjs data grid in front side , sucessfully queries data using extjs proxy, model , data store. json proxy calls separate getdata.php script (by url) queries database, converts retrieved data json format , returns them echo. works. now intended add debugging code getdata.php script. unfortunately when using if (wp_debug) {} error telling me use of undefined constant wp_debug (which found out debugging network access since database script called proxy , not produce visible output). in other scripts can use wp_debug symbol without problems. any idea why getdata.php doesn't know wp_debug while other scripts of plugin do? update: seems wordpress smybols unknown in getdata.php. update2: ajax scripts need called using special wordpress methods. see answer below. if you&