Posts

Showing posts from March, 2011

objective c - strike through a selected row in NSTableView -

objective c - strike through a selected row in NSTableView - i new mac app.in application have booked history tableview.when user click on "withdraw" button,i want strike through selected row of tableview.and getting tableview content nsarraycontroller.i don't know how it.if 1 knows,guide me do. in mac osx,not in ios. one way obtain utilize nstextview within table cell , bind attribute string array controller. in array controller can alter relative value adding attribute of type nsstrikethroughstyleattributename . objective-c cocoa nstableview nsarraycontroller nsattributedstring

forms - Django: Radio buttons "checked" after validation -

forms - Django: Radio buttons "checked" after validation - i'm having modelform django works fine. validates fine, problem: input field (a couple of radio buttons) doesn't checked="checked" after returning bad validation, user has go on radio buttons again. seems stupid. is there way django set checked="checked" on radio buttons on validation? django forms validation radio-button

symfony2 - BorisMorel / LdapBundle is calling connect even on non-restricted area -

symfony2 - BorisMorel / LdapBundle is calling connect even on non-restricted area - i have integrated borismorel / ldapbundle version 2.0 symfony version 2.0.16 ^/admin area , works, there's 1 issue - ldap bundle engaged ^/api not want. api should not utilize ldap. thought adding is_authenticated_anonymously ^/api access_control alternative should help, doesn't - trying connect. security.yml: security: firewalls: restricted_area: pattern: ^/admin anonymous: ~ provider: ldap imag_ldap: ~ form_login: login_path: /login check_path: /login_check logout: path: /logout target: /login providers: ldap: id: imag_ldap.security.user.provider encoders: imag\ldapbundle\user\ldapuser: plaintext access_control: - { path: ^/api$, roles: is_authenticated_anonymously } - { path: ^/login, roles: is_authenticated_anonymously }...

r - url in CRAN extension manual -

r - url in CRAN extension manual - aesthetics question cran manuals. how create urls description field reddish , function when clicked (like first url in url field)? 1 appears reddish in manual first url in th url field, , of links (such in bugreports field) don't work.. here's description (chopped down): package: bundle type: bundle title: stuff version: 0.2.1 date: 2012-05-09 author: me maintainer: bob <bob@gmail.com> depends: r (>= 2.15), imports: gridextra suggests: plyr lazydata: true description: bundle awesome. note: qdap not compiled mac users. installation instructions mac user or other os users having difficulty installing qdap please visit: http://trinker.github.com/qdap_install/installation license: gpl-2 url: http://trinker.github.com/qdap/ https://github.com/trinker/qdap bugreports: https://github.com/trinker/qdap/issues collate: 'adjacency_matrix.r' and manual: https://dl.dropbox.com/u/61803503/qd...

jquery - javascript: Avoid browser scrolling back to top on content insertion -

jquery - javascript: Avoid browser scrolling back to top on content insertion - i thought easy solve, can`t seem find solution anywhere. it's annoying javascript 'feature?'. every time add together content div document gets scrolled top. how can avoid annoying behaviour? n = 0; function addcontent() { div = document.getelementbyid('content'); for(var = 0; < 100; i++) { n++; div.innerhtml = div.innerhtml + n + '<br />'; } } </script> </head> <body> <div id="content"></div> <a href="#" onclick="addcontent()">more content</a> ex: http://jsfiddle.net/hqp2q/ the problem here , when click on anchor link , onclick event handler registered element fired. now default behavior anchor tag navigate href attribute of own. in case both happens , url navigated "#". "#" acting bookmark , browser html element has id , sa...

How to Create a XMPP Chat Client in Android with Openfire? -

How to Create a XMPP Chat Client in Android with Openfire? - i newbie android. wanted create xmpp chat client along force notifications. have installed openfire , server ready testing on local machine. at point doing 1. creating xmpp connection in async task 2. onpost creating chat manager protected void onpostexecute(final boolean success) { if (success) { if (connection != null) { chatmanager = connection.getchatmanager(); chat newchat = chatmanager.createchat("shobhit", new messagelistener() { public void processmessage(chat chat, message message) { //do } }); } } } but totally confused if doing correctly. read somewhere on stackoverflow async should used little duration activities , connection can timed out here. i found these probable solutions: runnable, handlers create servi...

asp.net mvc 3 - Property injection into custom WebViewPage using Autofac -

asp.net mvc 3 - Property injection into custom WebViewPage using Autofac - i'm creating internal application framework other dev teams in our organisation utilize build mvc applications from. part of that, i'm creating menu construction views, read configuration , modified based on current user's permissions. create menu part of framework, i've created custom webviewpage implementation custom html helper class needs take dependency on applicationdatareader build menu. i've read various posts explain mvc needs webviewpage have paramterless constructor, need utilize property injection. i've configured autofac mvc3 integration, including registering viewregistrationsource . problem is, when dependent property accessed, it's null. here's custom view page , helper phone call i'm trying make: public abstract class oubaseviewpage<tmodel> : webviewpage<tmodel> tmodel : class { public ouhelper<tmodel> ou { get; set; ...

blogengine.net - Images not loading in asp.net blog engine -

blogengine.net - Images not loading in asp.net blog engine - i inherited asp.net website blog within sub folder. moved functioning site new server , none of images load more. images beingness loaded dynamically image.axd. i virtually nil asp.net. php guy. did lot of google searching url mapping , looked in webconfig file til bluish in face. any pointers for? running on iis7 thanks in web.config need configure image handler. should this: <httphandlers> <add verb="*" path="image.axd" type="imagehandler" validate="false"/> </httphandlers> this illustration image handler code file named imagehandler.cs in app_code folder. the image handler can configured in iis console window. maybe can find old settings on old server? asp.net blogengine.net

jquery - flot side by side stack bar -

jquery - flot side by side stack bar - is possible have side side bar chart mixed stacked bar using flot? similar jqplot question here: jqplot side side stacked bar chart tried using both 1 side side runs , if disable side side, stacked bar works perfectly. image similar : http://peltiertech.com/utility/pix/clusterstackchart.png sample code wrote is: http://jsfiddle.net/wagbt/ (comment out order: x property , you'll see them switch) $(document).ready(function () { drawchart(); }); function generateseries(added) { var info = []; var start = 100 + added; var end = 500 + added; (i = 1; <= 20; i++) { var d = math.floor(math.random() * (end - start + 1) + start); data.push([i, d]); start++; end++; } homecoming data; } function drawchart() { var dataa = generateseries(100); var datab = generateseries(100); var datac = generateseries(100); var ds = new array(); var info = ...

MAGENTO - Remove Item name and price from category grid view -

MAGENTO - Remove Item name and price from category grid view - having problem figuring 1 out. webpage here: http://www.the-shirt.co.uk/magento (sorry loading times. have not got round optimizing yet) the category product view shows item picture, cost , boarder far big! what trying todo have picture. dont want display price, name or boarder. how do this? thanks jon, i gave reply issue on here http://www.magentocommerce.com/boards/viewthread/307687/ i hope helps! magento view grid

c# - "This stream does not support seek operations" -

c# - "This stream does not support seek operations" - i stream form web service: stream resultstream = webserviceentities.getattachment(attachmentid); i need convert stream byte array but attempt # 1 byte[] resultbytes = null; using (stream stream = resultstream) { using (memorystream ms = new memorystream()) { int count = 0; { byte[] buf = new byte[1024]; count = stream.read(buf, 0, 1024); ms.write(buf, 0, count); } while (stream.canread && count > 0); resultbytes = ms.toarray(); } } attempt # 2: var memorystream = new memorystream(); resultstream.copyto(memorystream); byte[] resultbytes = memorystream.toarray(); in both cases (byte[] resultbytes) returns empty byte array, know causing happen? there wrong stream web service returns? c# asp.net arrays stream byte

c++ - listview combobox -

c++ - listview combobox - i have added combobox custom listview , trying set combobox's text current listview subitem. case cbn_selchange: { char txt[200]; combobox_gettext(hcombo, txt, 256); int = sendmessage(hlistview, lvm_gethotitem,0, 0); listview_setitemtext(hlistview, i, 2, txt); } what doing wrong? the listview "hot" item item cursor hovered on , when hot tracking , hot selection enabled. sdk docs lvm_gethotitem poor job explaining hot item is. clistctrl::gethotitem docs give bit more detail. at time create selection combo box, cursor not hovered on item in list box no text set. you want selected item instead: int = listview_getnextitem(hlistview, -1, lvni_selected); this post has bit more information. c++ winapi listview combobox

php - changing user password in mysql, check old password matches and make new password compulsory? -

php - changing user password in mysql, check old password matches and make new password compulsory? - this question has reply here: change password in mysql table? 3 answers can please help, have alter password script allows user alter password. at moment lets user alter password despite set in old password box. can please show me how can check old password matches stored in 'ptb_users.password' ? also lets user set password nothing, there way can create enw password , confirm password fields compulsory? thanks. <?php require_once("session.php"); require_once("functions.php"); require('_config/connection.php'); ?> <?php session_start(); include '_config/connection.php'; $password = md5($_post['password']); $newpassword = md5($_post['newpassword']); $result = mysql_query("sele...

android - How to format the time which is shown on notification? -

android - How to format the time which is shown on notification? - i have problem modifying alarm application's notification, want alter time shown notification using these code : ....... calendar cal = calendar.getinstance(); cal.add(calendar.minute, addminute); notification.when = cal.gettimeinmillis(); notificationmanager.notify(notif_id, notification); but problem notification time not in right format show mm/dd/yy, instead of hh:mm , possible alter format? cant find apropriate method alter them. i did search cant find way that. suggestion how format time in notification? thanks i have solved it. couldn't figure out how delete or format time on standard notification, can create custom notification using notificationbuilder, , passed formatted string time custom notification instead of time. android notifications

php - Create url links from a bunch of strings -

php - Create url links from a bunch of strings - i have bunch of strings concatenated 1 contain text , links. want find urls in string , want set href each 1 (create link). using regular look pattern finding urls (links) in string. check illustration below: example : <?php // text want filter urls $text = "the text want filter goes here. http://google.com/abc/pqr 2the text want filter goes here. http://google.in/abc/pqr 3the text want filter goes here. http://google.org/abc/pqr 4the text want filter goes here. http://www.google.de/abc/pqr"; // regular look filter $reg_exurl = "/(http|https|ftp|ftps)\:\/\/[a-za-z0-9\-\.]+\.[a-za-z]{2,3}(\/\s*)?/"; // check if there url in text if (preg_match($reg_exurl, $text, $url)) { // create urls hyper links echo preg_replace($reg_exurl, "<a href='.$url[0].'>" . $url[0] . "</a> ", $text); } else { ...

ubuntu - Permissions and groups for Node.js -

ubuntu - Permissions and groups for Node.js - i'm looking best way set node.js apps within ubuntu. have set /var/node/ store various node apps /var/www/ would. what trying achieve, seem failing: nodeadmins (group) has read , write access /var/node/. nodeuser (user) has read access /var/node/. nodeuser beingness user business relationship node apps run under. this way, ftp users can alter of files within /var/node/ whilst node apps when they're run nodeuser have access files. my questions: 1) right / safe way? 2) how can allow more 1 grouping have different permissions on folder? have used chown set nodeuser owner of group. don't believe right way. node.js ubuntu permissions directory groups

c++ - to system() or fork()/exec()? -

c++ - to system() or fork()/exec()? - there appear 2 mutual ways of running external executable c in unix, system() call and pid = fork() switch(pid) //switch statement based on homecoming value of pid, //one branch of include , exec() command is there reason prefer fork/exec on scheme in case functionally equivalent (parent process waits kid finish, no complex info returned child)?. system executes command-interpreter, i.e. shell, (a) slower direct fork/exec, (b) may behave differently on different systems , (c) potential security hazard if pass string untrusted source. also, system waits kid process exit, while might want run concurrently parent process. more in general, low-level fork/exec gives additional control: before or in between 2 operations, might want chdir , open pipes, close file descriptors, set shared memory, etc. (by different systems, don't mean windows vs. unix (as windows doesn't have fork): i'm talking reddish hat l...

What is the best way to compare two lists in Javascript as you would do in Python? -

What is the best way to compare two lists in Javascript as you would do in Python? - i'm quite new javascript familiar python. in python output: in [1]: [1,9,[5,4,2]] > [1,9,[14,5,4]] out[1]: false in javascript: > [1,9,[5,4,2]] > [1,9,[14,5,4]] true it seems arrays converted string before comparison. now wanted write function myself , walk through array compare each element. came coffeescript code: compare_list = (a, b)-> if typeof == "object" , typeof b != "object" homecoming 1 else if typeof != "object" , typeof b == "object" homecoming -1 else if typeof != "object" , typeof b != "object" if > b homecoming 1 else if < b homecoming -1 else homecoming 0 else if typeof == "object" , typeof b == "object" in [0...a.length] if > (b.length-1) ...

vb.net - what if ms-acces asks for uid and password unnecessary? -

vb.net - what if ms-acces asks for uid and password unnecessary? - i using ms access database , dont have uid , password. if while running crystal study asks uid , password. , every entry, says "logon failed".is there internal setting this? if don't have login , password, dummy credentials may plenty bypass error. @ link examples: how open secured access database in ado through ole db vb.net ms-access crystal-reports

How can I build JavaScript instruction dynamically from parameters? -

How can I build JavaScript instruction dynamically from parameters? - i want build javascript instruction dynamically the original instruction : var chou = eval('(' + returnresult + ')').attribute; i want pass attribute variable possible? i have tried : var chou = eval('(' + returnresult + ')').eval(baseentity); but doesn't work. i'll optimistic , assume returnresult json. then can var chou = json.parse(returnresult)[baseentity]; if it's not json trust source plenty utilize eval, do var chou = eval('(' + returnresult + ')')[baseentity]; javascript

php - Registering a model as an event listener -

php - Registering a model as an event listener - i'd know if thought register model class cakeeventlistener within model's php file. for example, if created model called document implements listener, , @ bottom of document.php there register listener. class document extends appmodel implements cakeeventlistener { ..... } cakeeventmanager::instance()->attach(classregistery::init('document')); my question nexted calls classregistery::init('document') , if above cause 2 instances of document created. for example, let's have next in controller. class documentscontroller extends appcontroller { public function index() { $model = classregistery::init('document'); ..... how many times document instantiated? the first phone call classregistery::init('document') controller loads document.php file. wouldn't there sec phone call classregistery::init('document') bottom of d...

jquery - Hide Div on Scroll Show Div On Hover -

jquery - Hide Div on Scroll Show Div On Hover - im not expert on jquery, im trying create lower menu hide when scroll (.smenu-lower) , show/toggle menu when hover on #sticky-menu $(window).scroll(function (event) { var y = $(this).scrolltop(); if (y > 0) { $('.smenu-lower').slideup('fast'); } else{ $('.smenu-lower').slidedown('fast'); } $(function() { $('#sticky-menu').hover(function() { $('.smenu-lower').show(); }, function() { $('.smenu-lower').hide(); }); }); posted here http://jsfiddle.net/yhrbw/ jquery html menu hide show

Powershell @{} Pipeline Error -

Powershell @{} Pipeline Error - i have 2 custom powershell functions meant used like: get-users | select loginname | get-userjobstatus -startdate 2013-02-19 -enddate 2013-02-21 when ran, receive error web service: @{loginname=username} not found which makes sense, because username that's passed web service function should username , not @{loginname=username}. how format correctly? function global:get-backupjobstatus { [cmdletbinding()] param( [parameter( mandatory=$true, helpmessage='specific business relationship name.', parametersetname='loginname', valuefrompipeline=$true )] [system.string[]]$loginname = $null, [parameter( mandatory=$false, helpmessage='start date report.' )] [system.datetime]$startdate, [parameter( mandatory=$false, helpmessage='ending date report.' )] [system.datetime]$enddate ...

c# - Update Command Executenonquery - Syntax Error -

c# - Update Command Executenonquery - Syntax Error - i tried update info in c# got "incorrect syntax near ')'." in line "da.updatecommand.executenonquery();". i browsed code lot of time, , can't see error anymore. in sentiment should ok, isn't. @ below code? using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.data.sqlclient; namespace klinika { public partial class frmodwla : form { dataset ds = new dataset(); sqlconnection cs = new sqlconnection("data source=.\\sqlexpress; initial catalog=klinika; integrated security=true"); sqldataadapter da = new sqldataadapter(); bindingsource bs = new bindingsource(); public frmodwla() { initializecomponent(); } private void btnwyswietl_click(object send...

python - Conditional Logic on Pandas DataFrame -

python - Conditional Logic on Pandas DataFrame - how apply conditional logic pandas dataframe. see dataframe shown below, info desired_output 0 1 false 1 2 false 2 3 true 3 4 true my original info show in 'data' column , desired_output shown next it. if number in 'data' below 2.5, desired_output false. i apply loop , re-construct dataframe... 'un-pythonic' just compare column value: in [9]: df = pandas.dataframe([1,2,3,4], columns=["data"]) in [10]: df out[10]: info 0 1 1 2 2 3 3 4 in [11]: df["desired"] = df["data"] > 2.5 in [11]: df out[12]: info desired 0 1 false 1 2 false 2 3 true 3 4 true python pandas

ruby - ActiveRecord - getting query results for row N to row N+10 -

ruby - ActiveRecord - getting query results for row N to row N+10 - i know has been asked before (in fact, i'm pretty sure of it). suppose have model article, , want find articles fit condition, ordered date. article.find(:conditions => [some condition], :order => "date asc") if want 10th 20th rows query, how do activerecord? i using postgres, if makes difference. the rails 3 notation be: article.where(...conditions...).order('date asc').limit(10).offset(10) what want pagination tool paginator or similar. provide interface show page n instead of having limit , offset calculations yourself. ruby activerecord

axapta - How to get the number of values in an array in .Net? -

axapta - How to get the number of values in an array in .Net? - ax allows arrays defined, while fetching info through .net business connector, shows single field. e.g: dimension set by: axrec.setfield("dimension[1]","a"); axrec.setfield("dimension[2]","b"); axrec.setfield("dimension[3]","c"); // , on... how know how many fields "dimension" have? ax supports compile time function dimof homecoming count, not available .net! to rescue comes dictfield class: x++ code: dictfield df = new dictfield(tablenum(custtable), fieldnum(custtable, accountnum)); if (df) { print strfmt("the arraysize %1.", df.arraysize()); } you can create x++ utility function, phone call that: static int arraysize(str tablename, str fieldname) { dictfield df = new dictfield(tablename2id(tablename), fieldname2id(tablename2id(tablename), fieldname))); homecoming df ? df.arraysize()...

requirejs - view events are set twice when I instantiate view second time -

requirejs - view events are set twice when I instantiate view second time - this project architecture issue - first backbone project , did wrong. in project in route callbacks have: myroute: function() { this.currentview = new mycustomview(); }, mysecondroute: function() { this.currentview = new mysecondview() }, //... so in route callbacks instantiate view. view has initialze method calls render method. works except view events (declared in events: {} ) 'binded' every time same view instantiated. when visit same route twice events view corresponding route fired twice... probably shouldn instantiate new view on every route phone call - how can ? mean standards? maybe should unload current view somehow - there method this? i think have add together method unbind events @ time close view like this close : function () { //your code clean before closing view this.remove(); this.unbind(); } so next time view called events added durin...

python - Matplotlib: Plotting the same graph in two different figures without writting the "plot(x,y)" line twice -

python - Matplotlib: Plotting the same graph in two different figures without writting the "plot(x,y)" line twice - i have simple code plots same thing in 2 different figures (fig1 , fig2). however, have write line ax?.plot(x, y) twice, 1 time ax1 , 1 time ax2. how can have 1 plot look (having multiple redondant ones source of troubles more complex code). ax1,ax2.plot(x, y) ... ? import numpy np import matplotlib.pyplot plt #prepares info x = np.arange(5) y = np.exp(x) #plot fig1 fig1 = plt.figure() ax1 = fig1.add_subplot(111) #plot fig2 fig2 = plt.figure() ax2 = fig2.add_subplot(111) #adds same fig2 plot on fig1 ax1.plot(x, y) ax2.plot(x, y) plt.show() you can either add together each axes list, this: import numpy np import matplotlib.pyplot plt axes_lst = [] #prepares info x = np.arange(5) y = np.exp(x) #plot fig1 fig1 = plt.figure() ax1 = fig1.add_subplot(111) axes_lst.append(ax1) #plot fig2 fig2 = plt.figure() ax2 = fig2.add_subplot...

Lua, c++ and disappearing metatables -

Lua, c++ and disappearing metatables - background i work watusimoto on game bitfighter. utilize variation of luawrapper connect our c++ objects lua objects in game. utilize variation of lua called lua-vec speed vector operations. we have been working solve bug time has eluded us. random crashes occur suggest corrupt metatables. see here watusimoto's post on issue. i'm not sure because of corrupt metatable , have seen odd behavior wish inquire here. the problem manifestation as example, create object , add together level this: t = textitem.new() t:settext("hello") levelgen:additem(t) however, game (not always) crash. error: attempt phone call missing or unknown method 'additem' (a nil value) using suggestion given in reply watusimoto's post mentioned above, have changed lastly line following: local ok, res = pcall(function() levelgen:additem(t) end) if not ok local s = "invalid levelgen value: "..tostr...

C - seg fault - cant find error -

C - seg fault - cant find error - i writing programme (in c) implement self referential linked list. have written bit of code , got compile i'm getting segmentation fault , have no thought why. below code: #include <stdio.h> #include <stdlib.h> #define true 1 #define false 0 struct node { int value ; struct node *next; }; void insert(int x, struct node **pl); void printlist(struct node *l); typedef int boolean; int main(int argc, char *argv[]) { int i; struct node *l; for(i = 3 ; < 20; i+= 2) insert(i,(&l)); printlist(l); homecoming 0; } void insert(int x, struct node **pl) { if((*pl) == null) { (*pl) = malloc(sizeof(struct node)); (*pl)->value = x; (*pl)->next = null; } else { insert(x, &((*pl)->next)); } } void printlist(struct node *l) { printf("%d\n", (l)->value); if(((l)->next) != null) { printlist((l)->next...

jquery - Figuring out total height of a div -

jquery - Figuring out total height of a div - i want create simple vertical slider on website. simple code $('.down').click(function(){ $('#container_slider_youtube').animate({ margintop: '-=410px'}, 1000); }); $('.up').click(function(){ $('#container_slider_youtube').animate({ margintop: '+=410px'}, 1000); }); i can slide container in , downwards works fine. problem i'm having can maintain pressing or downwards button totally messes position of div. what's way prepare problem? might improve not rely on relative values, , instead, compute new, static values assign .animate() . also, applications such this, find it's way more simpler utilize css position , top instead of relying on margin . (older) browsers seem have hate negative margins fire fire of one thousand hells. // illustration var container = $('#container_slider_youtube'), parent = container.parent(), step =...

windows - Set font and font size in R Console programmatically? -

windows - Set font and font size in R Console programmatically? - is possible set console font , font size, "edit->gui preferences", programmatically? how function like? on windows. on windows (at least), $r_home/etc/rconsole config file sets many optional parameters console , pager. here's section hand-edit alter default font , font size: ## font. # please utilize fixed width font. # if font=fixedfont scheme fixed font used; in case # points , style ignored. if font begins "tt ", # true type fonts searched for. font = tt courier new points = 10 style = normal # style can normal, bold, italic to alter values command line of active r session, utilize loadrconsole() function. reads in text file containing directives of form shown above, overwrite values read rconsole when r launched. here's example: temp <- tempfile() cat("points = 13\n", file = temp) cat("style = italic\n", file = temp, append = true) lo...

python - How do I calculate min and max from a user input in python3 -

python - How do I calculate min and max from a user input in python3 - def main(): print("*** high school diving ***") num_judges=int(input("how many judges there? ")) in range (num_judges): scores=int(input("ender score: " )) x=min(scores) y=max(scores) print("min: ", x) print("max: ", y) main() you need utilize list, , append each entered score it: scores = [] in range (num_judges): scores.append(int(input("enter score: " ))) max() , min() pick highest , lowest value respectively list. what did, instead, replacing scores new value each time looped; seek , find min() of 1 integer, doesn't work: >>> min(1) traceback (most recent phone call last): file "<stdin>", line 1, in <module> typeerror: 'int' object not iterable by using list, min() function can loop on (iterate) , find minimum value: >...

database - Use Enums instead of foreign keys -

database - Use Enums instead of foreign keys - after using hibernate enum mapping 1 time again today wondering whether thought stretch little bit more. explain thought came from: of course of study aim normalized info model our applications results in fact, alot of tables contain category, state or similar data. these tables have few columns (often pk , 1 or 2 content columns) , rows. also, content of tables changes rarely, never. if we'd utilize enum , map table ordinal or integer (both hibernate, i'd orm can that), wouldn't improve in both performance (less joins) , handling (enums in java can used elegantly)? to clarify things bit: table persons id: number name: varchar relationship_status_id: number table relationship_status id: number status: varchar content persons: 1 | john doe | 1 2 | mary poppins | 2 content relationship_status 1 | single 2 | married now i'd dump status table, have 2 status in enum , map column ordinal. senseful thing d...

c# - How to pass values through a WCF Service in a ASP.NET Website -

c# - How to pass values through a WCF Service in a ASP.NET Website - i working on outlook addin our website. want pass selected date, time , subject outlook calender our website loads in webcontrol within outlook. webservice wcf. i can transfer calender values wcf this: [operationcontract] string getbookingurl(string guid, bookingrequest request,string token,string exiturl); bookingrequest class pass calender values: [servicecontract] public class bookingrequest { public long bookingid { get; set; } public datetime startutc { get; set; } public datetime endutc { get; set; } public string subject { get; set; } public int numparticipants { get; set; } } now next step on asp.net website: protected sub page_load(byval sender object, byval e system.eventargs) handles me.load if (bookingrequest!=null) fromdatetextfield.text = bookingrequest.startutc todatetextfileld.text = bookingrequest.endutc subjecttextfield.text = bookingrequest.subject end if...

tomcat - understanding apache solr scoring for non math background -

tomcat - understanding apache solr scoring for non math background - i learning apache solr scoring methods here. here said should go this page understand scoring formula. not maths background hard me understand high level math. is there alternative understand basic scoring formula in easy manner? lucene uses number of features score documents, scoring relies on similarity between document , query. explained thought of calculating similarity between documents before in more or less simple words, allow me explain here briefly. if have dictionary of words, may organize them long-long list. mathematicians used utilize term "vector" sequences, including lists of words, let's phone call vector of words: [abbat, about, bananas, ...] we can express each document in our collection vector, each element stands number of occurrences of corresponding word in document. example, if document has 1 occurrence of word "bananas", 2 occurrences of "...

Google Drvie Sdk How to move C folder from A folder to B folder? -

Google Drvie Sdk How to move C folder from A folder to B folder? - i want move specific folder folder b folder. , don't want re-create , delete. can information? you can edit parents collection of file remove folder , add together folder b: https://developers.google.com/drive/v2/reference/parents google-drive-sdk

Yii Bootstrap Form AJAX Validation and Highlighting -

Yii Bootstrap Form AJAX Validation and Highlighting - i share snippets validating yii bootstrap ajax form , highlight error , valid fields. form should have disabled validations. i share snippets validating yii bootstrap ajax form , highlight error , valid fields. form should have disabled validations. form: $form = $this -> beginwidget('bootstrap.widgets.tbactiveform', array( 'id' => 'user-time-form', 'type' => 'horizontal', )); submit button: $this -> widget('bootstrap.widgets.tbbutton', array( 'buttontype' => 'ajaxsubmit', 'icon' => 'ok', 'url' => yii::app() -> createurl('hr/usertime/create'), 'label' => 'submit', 'ajaxoptions' => array('success' => 'function(data){ var obj = $.parsejson(data); ...

stopping execution of Python program on exception in ipython -

stopping execution of Python program on exception in ipython - i have long running python programme raises exception @ point. there way run ipython session , stop on exception examine live data? you may want ipython -i yourscript.py , execute script in interpreter environment. won't allow inspect local environment exception happened, illustration local variables within function – you'll able inspect globals. want instead: in [1]: %run test.py <exception occurs> in [2]: %debug test.py if you're not familiar using pdb, check out some docs first. edit thomas k python ipython

backbone.js - Backbone.io, Backbone, and require.js -

backbone.js - Backbone.io, Backbone, and require.js - how can load backbone.io, backbone, , socket.io require.js's shim config? it seems else loading fine, when effort run backbone.io.connect() "backbone not defined". backbone.io served same way socket.io /socket.io directory socket.io server creates. requirejs.config({ baseurl: 'javascripts/lib', paths: { jquery: 'jquery.min', bootstrap: 'bootstrap.min' }, shim : { 'underscore': { exports: '_' }, 'backbone': { deps: ["underscore", "jquery"], exports: 'backbone' }, 'bootstrap': { deps: ["jquery"] } } }) requirejs(['jquery', 'underscore', 'backbone', 'bootstrap', '../socket.io/socket.io.js', '../socket.io/backbone.io.js' ], function($, ...

Populating the Values stored in one file and using them in other file -

Populating the Values stored in one file and using them in other file - i have 2 variables in mutual 20 batch files, want store these 2 variables 1 file , populate them batch files whichever uses these 2 variables. can 1 please assist me code this. requirement : variables stored in 1 file: dbname:prod region:abc now these 2 variables needs picked here , populated other batch files used. consider changing format: store lines in form of variable assignment commands, i.e. batch file: set dbname=prod set region=abc that way able call batch file other batch file needs variables. assuming above saved myvars.bat , go this: ... phone call myvars.bat :: proceed using variables ... batch-file

serialization - using jquery serialize/window.onbeforeunload to check for a dirty form and stop user from leaving is not working in browsers besides IE -

serialization - using jquery serialize/window.onbeforeunload to check for a dirty form and stop user from leaving is not working in browsers besides IE - i'm using next code warn users if leaving form without saving. works in ie in firefox, chrome , safari gives me warning every time regardless of whether or not form changed. works in ie , simple, hope can working all, or @ to the lowest degree more browsers. (needtoconfirm used stop warning on buttons such "save" button) <script type="text/javascript"> var form_clean; var needtoconfirm = true; // serialize clean form $(function() { form_clean = $("form").serialize(); }); // compare clean , dirty form before leaving window.onbeforeunload = function (e) { var form_dirty = $("form").serialize(); if (needtoconfirm) { if(form_clean != form_dirty) { homecoming 'you have unsaved work.'; } else { window.onbeforeun...

android - Cyclic View Pager with dynamic data -

android - Cyclic View Pager with dynamic data - i facing issue viewpager create cyclic. have list of info dynamic , everytime swipe made view has updated dynamic data. example, have 5 objects in list a,b,c,d,e able swipe through -> b -> c -> d -> e , 1 time again e -> d -> c -> b -> a. should create cyclic in after e, should goto on swiping right , after should goto e on swiping left. please can 1 tell me how this. lot. here code snippet have tried far. public class flingactivity extends baseactivity implements onclicklistener{ private viewpager pager; private int position; private int total; private arraylist<databean> beanlist; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); if (this.getintent().hasextra("position")) { position = (int) this.getintent().getextras().getint("position"); } if(getintent().hasex...

Z3: set starting values -

Z3: set starting values - can inquire z3 search starting values satisfy constraints ? say, if have 2 realexprs x , y , , have x==y constraint. can inquire z3 search x=-9999, y=-9997 such z3 might homecoming me model x=-9998 , y=-9998 , "sat" ? as far understand question, kind of looking solution maximisation/minimisation problem, namely, of next function f(x, y) = |x + 9999| + |y + 9997| together constraint x = y . stated in answers this question, z3 doesn't back upwards directly. however, stated, can seek solve such problems querying z3 within python loop adds found solutions new constraints of next query. z3

HTML rendering in java swing -

HTML rendering in java swing - i'm using jeditorpane display html right now, supports html4 , css1 , has problem utf-8 encoding. there improve render html? don't want import webkit project because of size. can recommend me something? nice if won't need import lib. swingbox swing component displaying html documents. based on cssbox library pure java - don't need link webkit or other native libraties. demo included in package. question has been asked several times here, see illustration this quiestion more references. java html swing html-rendering

How to Know ClickOnce's Registry Uninstall Key before installing it -

How to Know ClickOnce's Registry Uninstall Key before installing it - i want check if clickonce app installed or not ... the easiest way check: hkey_current_user\software\microsoft\windows\currentversion\uninstall*uninstallid* but have no clue retrieve (via ".manifest" etc.) uninstallid clickonce app repository. any ideas? you can programmatically read through keys in hkcu\software\microsoft\windows\currentversion\uninstall , check displayname on each key. match product name of clickonce application. if find match, it's installed. if can have multiple versions of same application installed, can check displayversion, and/or search uninstall string matching public key token. registry clickonce

css - jQuery select, regarding ie6 -

css - jQuery select, regarding ie6 - given next html: <ul class="accordion"> <li class="accountstatus"> <a href="#"> <ul class="sub-menu"></ul> </li> <li class="personal"> <a href="#"> <ul class="sub-menu"></ul> </li> </ul> i know next jquery select works fine 2 elements (a , sub-menu): $('.accordion > li > a') $('.accordion li > .sub-menu'); but not work in ie6. please give me alternative select exact elements need selected. thanks, one way nodes using methods know have in ie6, convert jquery objects before continuing, e.g. (& fiddle) var all_uls = document.getelementsbytagname('ul'), = all_uls.length, interesting_uls = [], interesting_as = []; while (i--) { if (all_uls[i].classname === 'accordion') { // ul.accordion ...

verilog - Illegal reference Error -

verilog - Illegal reference Error - i writing ripple counter using d-flip flops. next code giving me illegal reference error within initial block q2,q3,q4 variables. why that? module rcounter; reg d,d2,d3,d4,clk; wire q,q2,q3,q4; dflipflop a(d,q,clk); dflipflop a1(d2,q2,q); dflipflop a2(d3,q3,q2); dflipflop a3(d4,q4,q3); initial begin clk =1; d=0;d2=0;d3=0;d4=0;q2=0;q3=0;q4=0; #2 d=1;d2=~q2; d3=~q3; d4=~q4; #2 d=0;d2=~q2; d3=~q3; d4=~q4; #2 d=1;d2=~q2; d3=~q3; d4=~q4; #2 d=0;d2=~q2; d3=~q3; d4=~q4; #2 d=1;d2=~q2; d3=~q3; d4=~q4; #2 d=0;d2=~q2; d3=~q3; d4=~q4; #2 d=1;d2=~q2; d3=~q3; d4=~q4; end begin #2 assign clk = ~ clk; end endmodule d flipflop module: module dflipflop(d,q,clk); input d,clk; output q; assign q = clk?( (d==1)? 1:0) : q; endmodule how can solve problem? regards as vlad lazarenko has pointed out can not assign values wires within initial or always@ blocks. the prepare alter type wire reg . or declare (except tris...

java - Android (simple animation creation) -

java - Android (simple animation creation) - i trying create card-based game using java , eclipse android app, designed cards (front , sides), can't seem figure out if should card animation using 3rd party application or there way animate them using eclipse? if doing simple animations, pretty easy using standard android. create png each graphic in animation, reference in same way reference other drawable (with add-on tell scheme start animation). bottom line, utilize built in animation classes, simple use, , much improve integrating (and depending on) 3rd party library. here illustration how this: http://www.javacodegeeks.com/2011/01/android-animations-quick-guide.html java android eclipse

javascript - jqgrid hiddengrid doubles data and vertical scroll overlaps data -

javascript - jqgrid hiddengrid doubles data and vertical scroll overlaps data - i'm using jqgrid 4.4.4, , seem have come across problem. problem 1: fixed use case i want jqgrid hidden on "start-up" without doubling data. solution by removing scroll:true, info did not double were. problem 2: fixed when info exceeds height of jqgrid, scroll bar appears. scrollbar overlaps info shown on picture. i have tried both autowidth:true, scrolloffset, defining pixel width ++, nil seems work. i'm working on huge project, , love working jqgrid. see necessity create these problems obsolete. code: var grid = $("#table").jqgrid( { datatype: "local", height: "auto", width: 1000, scroll: true, colnames:['','1992','1997','2002','2007', ...

actionscript - Is it possible to test RTMFP on LAN or maybe through a VPN? -

actionscript - Is it possible to test RTMFP on LAN or maybe through a VPN? - we building flash rtmfp application , our isp blocks udp communication. the method test application every developer go home, , perform test, together. until now, okay, because implemended text-messaging, there not much thing test there... now, when want test video , sound transfer, (mainly quality), not option. is possible, perform tests on lan, or maybe not on lan, through vpn service (my preference)? isp blocking still impact vpn option? thank every reply in advance. you can of course of study test rtmfp connections in local network. set rtmfp server (like cumulus) , connect it. actionscript udp vpn lan rtmfp

debian - Choose default python -

debian - Choose default python - i've installed python2.7 in distro debian squeeze. i'm little confused way scheme search python executable. example, when type ls -l | grep python i have lrwxrwxrwx 1 root root 23 feb 5 17:14 pdb2.5 -> ../lib/python2.5/pdb.py lrwxrwxrwx 1 root root 23 nov 23 18:29 pdb2.6 -> ../lib/python2.6/pdb.py lrwxrwxrwx 1 root root 9 nov 23 18:29 python -> python2.6 -rwxr-xr-x 1 root root 1390792 nov 28 2010 python2.5 -rwxr-xr-x 1 root root 2617520 dec 27 2010 python2.6 -rwxr-xr-x 1 root root 1452 dec 27 2010 python2.6-config lrwxrwxrwx 1 root root 16 nov 23 18:49 python-config -> python2.6-config lrwxrwxrwx 1 root root 29 nov 23 18:29 pyversions -> ../share/python/pyversions.py the symlink shows python pointed python2.6, when type python python 2.7 default python executable python 2.7.3 (default, feb 6 2013, 12:12:35) [gcc 4.4.5] on linux2 ty...

file upload - Yii form builder -

file upload - Yii form builder - i've been working on yii-based application. , i've faced weird thing... what i'm trying add together input(type=file) form. form created via form builder( cform class). input not going appear. my code. controller/action: $model=mymodel::model()->findbypk(700); $model->scenario='my-scenario'; $form=new cform('path.to.forms.my-form', $model); $this->render('view', array('form'=>$form)); view: echo $form form config: return array( 'attributes' => array( 'enctype' => 'multipart/form-data', ), 'elements' => array( 'name' => array( 'type' => 'text', ), 'image' => array( 'type' => 'file', ), ), 'buttons' => array( 'save' => array( 'type' => ...

java - Ant Build Failed in Eclipse -

java - Ant Build Failed in Eclipse - i building jar file of project using ant after searching in google found how do referred this ink. below build.xml file <?xml version="1.0" ?> <project name="exceldata" default="compress"> <target name="init"> <mkdir dir="build/classes" /> <mkdir dir="dist" /> </target> <target name="compile" depends="init"> <javac srcdir="src" destdir="build/classes" /> </target> <target name="compress" depends="compile"> <jar destfile="dist/exceldata.jar" basedir="build/classes" /> </target> <target name="execute" depends="compile"> <java classname="com.spt.excel.data.exceldata" classpath="build/classes" /> </t...

Why # can not use in java identifier? -

Why # can not use in java identifier? - please allow me explain # can not utilize in java identifier. example. int e#; and also, allow me know # used in java , use? because it's not valid symbol in language. can't do: int hello+*/\variable; see 3.8. identifiers in java specification: an identifier unlimited-length sequence of java letters , java digits, first of must java letter. http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8 java identifier

php - How to redirect based on url paramater -

php - How to redirect based on url paramater - i have form on website users can specify if they'd monthly or annual subscription (it's radio option). form gets sumbitted crm system, redirects user www.site.com/is_to_pp.php?payment=monthly&address1=blah (and other url variables). depending on whether ?payment=monthly or ?payment=annual want redirect them different paypal subscription page. want pass other variables paypal prepopulate address fields. i.e. user fills out 1 form on our site, specifying how they'd pay, added our crm system, , redirected appropriate paypal page. does have thought of how construction is_to_pp.php file handle this? any help/guidance appreciated thanks charlie do mean this: <?php if ($_get["payment"] == "monthly") { header( 'location: http://www.pageyouwant.com' ); header("location: paypalpage.com?payment=".$_get['payment']."&address=".$_get[...

php - class in function name resulting in a 500 error? -

php - class in function name resulting in a 500 error? - i've lost mind trying understand why local server (apache on ubuntu) started give 500 message. it turned out problem caused function called classview() . renamed classtemplateview() still 500. i've tried stupidview() (i getting tired) , worked again. i've searched while haven't found saying class within function name "prohibited", it? no, it's fine: "class" on own reserved word, not when it's part of word. a quick test script: <?php function classview() { echo 'test'; } classview(); echoes 'test' expected. php apache naming-conventions

c# - soap with securityheader calling java webservice -

c# - soap with securityheader calling java webservice - i'm trying send soap request java webservice signature check retuning false can help me, please, i've been looking week , still not found solution.. this security-tag example <wsse:security xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:usernametoken wsu:id="refid> <wsse:username>username</wsse:username> <wsse:password type="wsse:passworddigest">password</wsse:password> <wsse:nonce encodingtype="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#base64binary">noncedata</wsse:nonce> <wsu:created>2013-02-11t12:53:27z</wsu:created> </wsse:us...