Posts

Showing posts from February, 2015

objective c - NSAlert on top of action sheet shows "Do not show this message again" -

i have action sheet on top of application main window, , prompt nsalert . the nsalert contains suppression checkbox , layout ("do not show message again") did not add manually, , i'd remove nsalert . how can so? from docs: [nsalert setshowssuppressionbutton:]

c# - In Razor, how do I print a loop with delimiter? -

i have following code: @foreach (useraccount ua in company.users) { @ua.username, } which print: user1, user2, user3, how rid of last ","? using string.join : @(string.join(company.users.select(u => u.username), ", "))

How to run get the text selected on a webview and clip it in android? -

hi working on project clip data web , add cloud , ihave have gone thorugh https://github.com/bossturbo/webviewmarker/blob/master/samples/demos/.project example , pretty needs done in terms of text selection. example explains how on local html file. need implement same on website(facebook google, ever ) user visit , able clip data on clipboard. long story short, need modify code(library) 2 things. provide text selection on webview websites. this project highlights text after user releases button. need make perform user drags cursor. any appreciated , project rests on this. client need told estimates , stuck 3 days

php - set variable to the current time and date symfony2 -

i want set variable $time current time , date following format: hh:mm:ss on day/month/year. could me in symfony? have tried built-in date function? $time = date('h:i:s \o\n d/m/y'); this should work until 2038 :) both o , n need escaped, have special meaning within format string.

java - ThreadPoolExecutor clean up when a thread dies -

i have threadpoolexecutor runs few core , max number of threads. task run creates hornetq (standalone) connections each thread , keeps them alive while thread running. however, cannot close them when thread keepalivetime expires , thread dies. there way clean resources right before thread dies? one way out of using pooling solution hornetq connections. any suggestions highly appreciated. if using jdk 1.7, embed stuff on closable interface, , closed out of scope. working on implementing on jms 2, meanwhile embed own class delegating stuff. have keep stuff referenced somewhere in thread go out of scope when thread gone. (thread local maybe?) you need use try (statement=statement.open()) {} , auto closeable called

mysql - .Net User Login Program -

i'm wondering if there exists pre-build application handle user logins , permission structure .net application. this manage clients logging in , data can see. essentially buy framework instead of building 1 ourselves. does exists, if either have examples or suggestions on for? thanks, i develop own custom membership provider , use asp.net membership service. if goal create framework applications, effort suitable. there nice article showing implementation of custom provider, using new mvc technologies. http://www.codeproject.com/articles/165159/custom-membership-providers there programmers exchange topic talking abour: https://softwareengineering.stackexchange.com/questions/104268/what-are-the-disadvantages-of-using-writting-a-net-custom-membership-provider let me know issues have.

c# - No backend database, only dynamically created table bound to GridView -

i need solution this: no backend database, no xml, no excel, when user gives information display in griddata. creating dynamically in .aspx.cs table , column ... eg:-- name |-text box-| button gridview when user visited page ..like above name textbox , submit button . when user enters name in textbox , clicks on submit want add name grid, here want not presented data... previous enter data display in gridview. eg2:- sairam submit--->click pamidi submit-->click i want display how many values user enter many want display in gridview ,like this sairam pamidi some.... more... values.. up-to when user perform close of browser . info.aspx : <form id="form1" runat="server"> <div> <asp:label id="label1" runat="server" text="enter name"></asp:label> <asp:textbox id="textbox1" runat="server"></asp:textbox> <asp:button id="bt

Can I configure "allow posting by mail" through google setting API? -

how configure "allow posting mail" through google setting api? the configuration found is: "whocanpostmessage": "all_in_domain_can_post", thanks sorry, there not setting in groups settings api allows toggle whether or not posts can come group via email. closest setting apps:allowwebposting allows toggle posting via group's web ui.

Mockito for Objects in Scala -

i'm using scala 2.10, specs2 , mockito. want mock scala.io.source.fromurl(). issue seems fromurl() function in io.source's object . val m = mock[io.source] m.fromurl returns io.source.fromstring("some random string.") it's pretty straightforward mock in unit test. why isn't working? thanks! instead of mocking it, try spying follows: val m = spy(io.source) or mock follows: val m = mock[io.source.type] but how using source in class testing? if had example class so: class myclass{ def foo = { io.source.dosomething //i know dosomething not on source, call not important } } then in order take advantage of mocking/spying, you'd have structure class so: class myclass{ val source = io.source def foo = { source.dosomething } } and test have this: val mocksource = mock[io.source.type] val totest = new myclass{ override val source = mocksource } in java world, static methods bane of mocking. in scala wor

asp.net - jQuery calls to page method vs web service vs Web API -

i'm working on asp.net web forms application , see lot of areas page posts after dropdownlist selection made, during small amount of data retrieved server populate control (like textbox). it's not nice user experience have page posting every time make selection, if there 5+ dropdowns on page. eliminate these postbacks i'm thinking of implementing jquery ajax calls (which have experience with). which recommended: page methods or .asmx web services? aren't .asmx web services considered 'older' technology? and further, have been reading on web api. alternative page method or web service? web api overkill eliminate bunch of simple postbacks? the first question i'd ask is... "what's overkill here?". webapi, basically, latest implementation of data retrieval proxy microsoft supports multiple formats (xml/odata/json etc). it's simple setup, future-proof , can use stand-alone service in own separate project if feel need to; alo

combinatorics - Generate all possible array combinations in C - Optimal Graph Colouring -

i need generate arrays possible combinations, question i've found here: combinatorics: generate "states" - array combinations i'm doing simple work of optimal graph coloring , so, i'm trying generate possible color combinations (the array represents color each node). code working but, doing unnecessary work. in situation, [1, 1, 2] same thing of [2, 2, 1], don't need test if valid graph again . i can't think of anything, first know if there's simple code doing want to. for now, code this: void generatearray(int array[], int array_size, int idx){ int i; if(idx == array_size){ putchar('\n'); for(i = 0; < array_size; i++) printf("%i ", array[i]); } else for(i = 0; <= 3; i++){ array[idx] = i; generatearray(array, array_size, idx+1); } } and print: [0, 0, 0] [0, 0, 1] [0, 0, 2] [0, 0, 3] [0, 1, 0] [0, 1, 1] ... [3, 3, 0] [3,

java - How to generate a distribution of k shots on n enemies -

i developing space combat game in java part of ongoing effort learn language. in battle, have k ships firing guns @ fleet of n of nefarious enemies. depending on how many of enemies hit how many of shots, (each ship fires 1 shot hits 1 enemy), damaged , destroyed. want figure out how many enemies hit once, how many hit twice , on, @ end have table looks this, 100 shots fired: number of hits | number of occurences | total shots ---------------------------------------------------- 1 | 30 | 30 2 | 12 | 24 3 | 4 | 12 4 | 7 | 28 5 | 1 | 5 obviously, can brute force small numbers of shots , enemies randomly placing each shot on enemy , counting how many times each got shot @ end. method, however, impractical if i've got 3 million intrepid heroes firing on swarm of ten million enemies. ideally, i

c# - Algorithm: Checking for conditions in 3D array -

this 1 hard explain! sorry that, here goes... have 3d array of data [x][y][z], , check 10 different combination conditions , keep data when it's match... example: x y z //mydata[1..1000000][1..10][1..10].foo // foo int x[i].y[ii].z[iii].foo; // x container, y= 1 10 levels. , z= objects //i want apply "filter" z objects... lets want find combinations sum of "foo" smaller , larger 2 numbers, , keep z objects for next iteration want find lets "foo" prime number, still keeping z objects and on more conditions, resulting in smaller , smaller list. doesn't matter in wich order performed. sort of know how it, end in nasty loops... ideas? maybe adding list faster deleting original list? in advance! when want chain logic this, think want use linq. unfortunately, can cumbersome use linq on multidimensional arrays. helper methods, though, can convert data array more usable. first, let's build wrappe

Need assistance with recursion in JS -

i'm having great deal of trouble wrapping head around recursion. simple recursion can 1 not easy me. goal here speed search algorithm. i'm guessing recursion help. takes 15 seconds on simple 43 node tree children is. below unrolled recursion fomr of code works. var nodelist = new array(); var removelist = new array(); var count = 0; var foundinthisnodetree; var find = function ( condition ) { } while ( this.treeidmap.igtree( "nodebypath", count ).data() ) { var foundinthisnodetree = false; var n; n = this.treeidmap.igtree( "nodefromelement", this.treeidmap.igtree( "nodebypath", count ) ) if ( n.data.item.indexof( filter ) > -1 ) { foundinthisnodetree = true; } else {//look deeper var = 0; while ( this.treeidmap.igtree( "nodebypath", count + "_" + ).d

android - SQLite: no such table: while compiling -

i've got long running task run onresume on activity. task involves querying database decrypting data, manually sorting updating sort order in database using transaction. this works fine when run activities main ui thread, when execute same task within asynctask these errors: i/sqlitedatabasecpp(5166): sqlite returned: error code = 1, msg = no such table: household, db=/mnt/sdcard/mydatabase.db no such table: while compiling: no such table: household: , while compiling: select distinct street household street not null , length(ltrim(rtrim(street)))>0 i know database exists , sql statement fine because runs fine outside asynctask. there access database within asynctask causes problems? i'm getting errors on "select distinct" raw query below. private boolean update_street_sort_order() { boolean returnvalue = false; dbutilities objdbutil = null; cursor ccases = null; final string sort_attribute = "street_sort_order"; fina

javascript - Setting a variable using the value of multiple selects, each time any of the selects is changed -

i have list of items i'm trying "filter" set of 4 selects matching value of select options classes have applied list items. right now, have working each time choose new option of 4 selects, entire list reset, , items class matches value of option selected visible. have work each time new option selected of 4 selects, filter values of 4 selects, not 1 changed. here's have right - appreciated! $(".sort-options select").change(function() { var topics = $(this).val(); $(".list-schools li").hide().filter("." + topics).show(); }); $(".sort-options select").change(function() { var topics = ''; $(".sort-options select").each(function() { if ($(this).val()) { // create combined class .opt1.opt2.opt3 topics += "."+$(this).val(); } }); $(".list-schools li").each(function() { $(this).toggle($(this).i

vba - VB script to export to pdf in Command Button (ActiveX) in Word 2010 -

ok, have word 2010 macro enabled template handy dandy forms people can fill out. have created button says "convert pdf" because people dont know how natively. entered vb editor of particular commandbutton want have functionality. here's whats in button: private sub commandbutton1_click() sub convert_pdf() dim desktoploc string dim filename string dim mypath string desktoploc = createobject("wscript.shell").specialfolders("desktop") filename = thisdocument.name mypath = desktoploc & "\" & filename activedocument.exportasfixedformat outputfilename:= _ mypath, _ exportformat:=wdexportformatpdf, openafterexport:=true, optimizefor:= _ wdexportoptimizeforprint, range:=wdexportalldocument, from:=1, to:=1, _ item:=wdexportdocumentcontent, includedocprops:=true, keepirm:=true, _ createbookmarks:=wdexportcreatenobookmarks, docstructuretags:=true, _ bitmapmissingfonts:=t

java - How to Change Global Variable in Android -

i want make mapping application , have problem changing global variable in code. how change global latlng in global variable in if else in method bundle.. please give me solution..thank you.. public class arahkan extends fragmentactivity { private static final int direction = menu.first + 1; private static final int exit = menu.first + 2; googlemap map; string tampil2 = getintent().getextras().getstring("key"); public latlng jakarta = new latlng(-6.175467640504223,106.82718157768248); // how change this.. ?? class data { public data(float lng, float lat, string title, string snippet, string icon) { super(); this.lat = (float)lat; this.lng = (float)lng; this.title = title; this.snippet = snippet; this.icon = icon; } float lat; float lng; string title; string snippet; string icon; } @override protected v

Targetting IE8 in CSS (less)? -

here's css: .lt-ie8{ body{ display:none!important; } } here html: <!--[if lt ie 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if ie 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if ie 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt ie 8]><!--> <html class="no-js"> <!--<![endif]--> <head> the css doesn't appear target ie7 correctly, know i'm going wrong? that worked me. <html> <head> <title></title> <style type="text/css"> .test{ background: green; height: 100px; width: 100px; } </style> <!--[if lt ie 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if ie 7]> <html class=&quo

selenium webdriver - How to switch to dynamically named iframe with Behat/Mink -

writing test iframe generated when button clicked. iframe name , id similar generated dynamically. have used "switchtoiframe" before. <div class="bbbb-frame-container" style="height: 400px; width: 665px; margin-top: -200px; margin-left: -332.5px;"> <div class="user-support-frame-close-container" style="display: block;"> <div class="user-support-frame-close">close</div> </div> <iframe id="poplock_default9636_priv" frameborder="0" name="poplock_default9636_priv" src="blah.blaag.com"> <!doctype html> ..................... the poplock_defaultnnnn_priv dynamically generated iframe switch to.. first, find iframe 1 of find methods . if it's iframe on page (or first one) use find() method . if it's not, you'll have use findall() , rely on order (since there's no distinct attribute search for). once find iframe, can u

Programmatically defining Javascript properties in the object constructor -

i have javascript constructor object containing of fields, , functions read/write them: function myobj(){ var _settingsstore { setting1: 1, //default value setting2: 2, //default value } //gets/sets _settingsstore.settingname, other stuff function _genericset(settingname, settingvalue){} function _genericget(settingname){} i'd programmatically create properties around each of fields: (var _setting in _settingsstore){ var _str = _setting.tostring(); object.defineproperties(this, { _str: { get: function() {return _genericget(_str)}, set: function(value) {return _genericset(_str, value)} } }) } my intent _str purely variable, , myobj.setting1 , myobj.setting2 should defined. instead, loop attempts define myobj._str twice: uncaught typeerror: cannot redefine property: _str what's going on? , there way desired behavior? edit : clarif

javascript - How do I set a dropdown option by value using jquery? -

i have fiddle has slight demo code: http://jsfiddle.net/mwoods98/mhrjj/ i have request being sent via ajax , it's returning values via json. that, i'm taking returned , filling in form. i'm filling in form other values can't quite figure out how set dropdown value returned. $('#postitle').find('option:eq(posvar)').val().prop('selected', true); i have tired , doesn't work. posvar variable i'm setting number returned ajax. update: both of answers, have discovered something. i'm using code make drop downs better need drop down can have multimple lines of html. http://www.marghoobsuleman.com/jquery-image-dropdown when remove js, form fills in. i'm open using library gives me ability use multiple rows in select dropdown , pass html it. thanks answers. all need is: var posvar = 9; $('#postitle').val(posvar); jsfiddle example

Flash CS 5.5 Actionscript 3 - Buttons appearing on all frames -

i have program lets user go various functions, work. when use music player function made play , stop buttons remain on screen when click return menu of options. here code: play_button.addeventlistener(mouseevent.click,clickhandler); stop_button.addeventlistener(mouseevent.click,clickhandler); function clickhandler(event:mouseevent): void{ swapchildren(play_button, stop_button) } the music file embedded in buttons. the following error appears every time: typeerror: error #1009: cannot access property or method of null object reference. @ smarthouse_scene1_fla::maintimeline/frame10() @ flash.display::movieclip/gotoandstop() @ smarthouse_scene1_fla::maintimeline/fl_clicktogotoandstopatframe_27() it should noted error occurs when music has been played. can go page , leave without problem if dont touch play or stop button. if appreciate it. if reading correct sounds inside button on timeline, using buttons or movieclips, make sure frame 27 exist on movie

xpages - Notes 9, rewriting URLs -

how rewrite url in notes 9 xpages. let's have: www.example.com/myapp.nsf/page-name how rid of .nsf part: www.example.com/page-name i don't want lots of manual re-direct because pages dynamically formed wordpress. i've read this: http://www.ibm.com/developerworks/lotus/library/ls-web_site_rules/ it not address issue. if use substitution rules following, can rid of db.nsf part , call xpages directly example.com/xpage1.xsp: rule (substitution): /db.nsf/* -> /db.nsf/* rule (substitution): /* -> /db.nsf/* however, have "manually" generate urls without db.nsf part in e.g. menus because xpages runtime include db.nsf part in urls if use instance openpage simple action.

ajax - How would d3.js difference chart example work with json data? -

Image
i have been struggling example: http://bl.ocks.org/mbostock/3894205 ...to work json can use in portlet live data. can see data elements if alert component isn't rendering. y axis , label show up. the part may wrong is: d3.json("data.json", function(error, data) { if(error) return console.warn(error); data.data.foreach(function(d) { d.date = parsedate(d.date); d["san francisco"]= +d["san francisco"]; d["new york"] = +d["new york"]; count++; if (count>360) { alert(d.date + " " + d["san francisco"] + " " + d["new york"]); } }); taken html file <!doctype html> <meta charset="utf-8"> <style> body { font: 10px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispedges; } .x.axis path {

python - live updating with matplotlib -

so have phone accelerometry data , make video of motion of phone looked like. used matplotlib create 3d graph of data: from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot plt import pandas pd import pickle def pickleload(picklefile): pkl_file = open(picklefile, 'rb') data = pickle.load(pkl_file) pkl_file.close() return data data = pickleload('/users/ryansaxe/desktop/kaggle_parkinsons/accelerometry/lily_dataframe') data = data.reset_index(drop=true) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') xs = data['x.mean'] ys = data['y.mean'] zs = data['z.mean'] ax.scatter(xs, ys, zs) ax.set_xlabel('x label') ax.set_ylabel('y label') ax.set_zlabel('z label') plt.show() now time important , factor see 1 point @ time because time factor , lets me watch progression of accelerometry data! what can make live updating graph? only thing can think of have loop goes through row

android - Action bar Action Item location -

Image
i'm creating app useful user have options in actionbar. this current situation: as can see, item1 , item2 on right i'd have these on left side. possible? if not possible, how simulate want? imageview buttons functioning actionbar ? i had similar issue wanted on left, in middle, , overflow on right. created custom layout 3 imagebuttons 3 elements. used <include> tag include layout in activities xml files. i created baseactivity other activities extend , put menu functionality in there onmenuitemclicklistener() override them in activities if needed different functionality activity aside did in baseactivity . used popupmenu here (requires api >= 11).

Identify Invalid Azure Container Names -

how can 1 programmatically determine if container name invalid per rules? valid naming container in azure blob storage. 3 63 characters starts letter or number letters, numbers, , dash (-) every dash (-) must preceded , followed letter or number all letters in container name must lowercase. valid naming container in azure blob storage. 3 63 characters starts letter or number letters, numbers, , dash (-) every dash (-) must preceded , followed letter or number all letters in container name must lowercase. in webapi used following: if (container.length < 3 || container.length > 63 || !regex.ismatch(container, @"^[a-z0-9]+(-[a-z0-9]+)*$")) throw new httpresponseexception(request.createresponse( httpstatuscode.badrequest, "invalid request!"));

javax.swing.Timer vs java.util.Timer -

i heard javax.swing classes should used if iam building swing gui . use javax.swing.timer without gui in order create timer loop. mean without gui shall use java.util.timer ? is big error use javax.swing.timer without gui ? can cause performance error or slowdown? what approaches creating loop run passively or without halting main thread? thanks in advance! yes not recommended since dependency need. you should try have few possible dependencies. if java.util.timer satisfies needs should choose one.

mysql - How can I adjust a JOIN clause so that rows that have columns with NULL values are returned in the result? -

how can adjust join clause rows null value countlocid or countnatid columns returned in result? in other words, if there no match in local_ads table, still want user's result nat_ads table returned -- , vice-versa. select u.franchise, countlocid, totalprice, countnatid, totalnmoney, ( totalprice + totalnmoney )totalrev users u left join local_rev lr on u.user_id = lr.user_id left join ( select lrr_id, count( lad_id ) countlocid, sum( price ) totalprice local_ads group lrr_id )la on lr.lrr_id = la.lrr_id left join nat_rev nr on u.user_id = nr.user_id inner join ( select nrr_id, count( nad_id ) countnatid, sum( tmoney ) totalnmoney nat_ads month = 'april' group nrr_id )na on nr.nrr_id = na.nrr_id lr.month = 'april' , franchise != 'corporate' order franchise thanks in advance help! try following in clause while making left join. take rows right table matched condition eg. left join local_rev lr on (u.user_id = lr.user_id) or (u.user_

xml validation - Validating XML documents and working with numbers -

suppose have xml document lists of sales made items. amongst list of price values, there "total" elements sum of set of items. xml document generated somewhere, , validate xml verify the form correct the content correct. example, total of set of child elements equal sum of of values associated each child. the xml documents used standard medium between multiple programs, important data accurate. there checks done xml exporter, wondering whether possible validate xml @ end ensure correct? , if correct valid? xsd useful validating xml in proper format , may "1. form correct". example, xsd used validate hasn't entered item sku price needed. however, xsd not tool validating business logic in "2. content correct". that, need custom validate logic using programming language of choice, perhaps of xpath extract elements. -larry

netbeans - passing values into another java project via runtime.exec() -

here code invoke java project java project package pkgtry; import java.io.*; public class try { private static void runprocess(string command) throws exception { process pro = runtime.getruntime().exec(command); pro.waitfor(); inputstream inputstream = pro.getinputstream(); int b = -1; while ( (b = inputstream.read()) != -1 ) { system.out.write(b); } } public static void main(string[] args) { int x=10; try { runprocess("javac -d . c:\\users\\owner\\documents\\netbeansprojects\\input\\src\\input\\input.java"); runprocess("java input.input"); } catch (exception e) { e.printstacktrace(); } } } this code working perfectly. want pass variable 'x' try.java input.java i know changes made in try.java send parameter , in input.java receive parameter. in advance you need append command , in input.java in main method have valu

android - How to check internet access? -

so, question how check if receiving data or not. scenario connected wifi network such starbucks wifi (which user should first connect network , accept agreement before receiving data.) code not serving purpose. connectivitymanager cm = (connectivitymanager) _mcontext.getsystemservice(context.connectivity_service); networkinfo netinfo = cm.getactivenetworkinfo(); if (netinfo != null && netinfo.isconnected()) { return true; } return false; it returns true when connected network have not accepted agreement yet. thanks, there's no way know that, because isn't handled @ os level- handled @ router. os knows whether has completed handshake router , received ip. whether router going throw him login screen beyond scope of os.

model view controller - client-MVC vs server-MVC -

i looking input other users on benefits of server-side mvc. power of many javascript libraries. purpose server-side mvc server anymore? you can use client-side mvc templating , rest api make more resposive application less overhead of reloading whole page minor changes. server mvc benefits: mature. widely adopted. most of code inside server should more secure. but tendency client/server computing instead of fat clients written in c or language have nice platform: browser. i have simple policy when use server side mvc , client side mvc: casual users few interactions: server + ajax. lob application (accounting, erp, crm, etc.): client. btw use java server faces #1 , extjs backed jax-rs services #2. regards.

git and maven and releases and merges -

the maven release plugin proceeds follows: change version in pom files. commit make tag change version in pom files again. commit (and checks out tag , builds release). so, merge branch on happens pull new, perhaps undesired, version #. now, of course, cherry-pick exists, manually identifying commit list upstream changes except change versions pretty annoying. has got alternative? (other release branch no 1 treating 'upstream'?) unfortunately, not possible when using git because tag pointer specific commit. if want have correct version number in tagged poms, have modify , commit them first. there option called suppresscommitbeforetag in maven-release-plugin avoids commits of modified poms. however, work in scms subversion. if enable option in git environment, tagged poms contain snapshot version tried make release. so making release separate branch option if don't want have intermediate pom modifications on master branch.

url rewriting - typo3 realurl show only one segment in url -

Image
i working on realurl's in typo3 , spend hours on working out why typo3 showing 1 segment in url. site structure looks this: and url got subpage 'munchen-maistrasse' is: http://www.bernd-gruber.at/munchen-maistrasse/ i want be: http://www.bernd-gruber.at/referenzen/munchen-maistrasse/ this server .htaccess file: <filesmatch "\.(js|css)$"> <ifmodule mod_expires.c> expiresactive on expiresdefault "access plus 7 days" </ifmodule> fileetag mtime size </filesmatch> <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [l] rewriterule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [l] rewriterule ^typo3$ typo3/index_re.php [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_filename} !-l rewriterule .* index.php [l] </ifmodule> addtype video/x-m4v .m4v

JavaScript event callback function scope issue with this? -

i having bit of trouble understanding concept. have loop in assign events , handlers elements. problem within callback, accessing member function. set scope correct this (referring object) e.target , not getting correct element. guess want correct element. below code. for(var in type) { element.addeventlistener(type[i].tolowercase(), (function (_self, handler) { //handle reference in event callback //using closure return callback correct context return function (event) { //console.log(arguments); //console.log(this); _self[handler].apply(_self, arguments); } }(this, type[i])), capture); } now within handler function: dragstart: function (e) { console.log(e); var = e.target, sectionname = that.id, interactiontarget = that.childnodes[0].alt; e.datatransfer.effectallowed = 'move'; e.datatransfer.setdata('text/html', that.innerhtml); this.

service - New Transaction not allowed error in a web method that uses database transactions -

i writing wcf service method update 2 tables (header , details). need sure operation atomic, started transaction surrounding inserts. however since web service method, other users call same function transaction being used. one information, using custom orm kind of framework stores connection in session re-use. when second web method call comes in, getting following exception: system.data.sqlclient.sqlexception (0x80131904): new transaction not allowed because there other threads running in session. i understand because transaction started first call not completed yet. i want understand best practices using database transaction in web service , if can remedy situation without have create new connection every time. well, sounds other method call trying use same connection first one, while not released properly. you have connection pool , take connections from wcf request , return pool (by calling close() or dispose() or similar - depends on orm) after

Android sending and listening for sms being sent -

as of right here have. client know if sms sent, , upon send button being clicked return app. how listen see if sms sent? in activities onactivityresult()? how tell sms client exit upon sending? need make own screen sending sms, , send sms directly without launching sms app? public static void launchsmsintent(string to, string body, context context) { intent smsintent = new intent(intent.action_view); smsintent.settype("vnd.android-dir/mms-sms"); if(to != null) smsintent.putextra("address", to); if(body != null) smsintent.putextra("sms_body", body); ((activity)context).startactivityforresult(smsintent, constants.sms_intent); } if need listen sms being sent, you'll need via android.telephony.smsmanager apis. there's no way guarantee whatever random sms app user uses return flag tell whether sent or not.

ios - Formating a single textfield so that it display is different to all the others -

how set currency in text field display localized currency, leading 0. if types in 16.25 pence formated 0.1625£ respectively. using delegation , formating text fields numbers can passed in, field should localized. - (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string { // first, create text end in input field if you'll return yes: nsstring *resultstring = [textfield.text stringbyreplacingcharactersinrange:range withstring:string]; // now, validate text , return no if don't it'll contain. // accomplish trying convert number , see if worked. nsnumberformatter *numberformatter = [[nsnumberformatter alloc] init]; [numberformatter setnumberstyle:nsnumberformatterdecimalstyle]; nsnumber* resultingnumber = [numberformatter numberfromstring:resultstring]; //[numberformatter release]; return resultingnumber != nil; i not want change, formats fields. want textfi

jquery - Retrieve only modified rows in DataTables -

i render page 2 columns 1 has input fields , other 1 checkboxes. lets modify entry in 1 of input fields , uncheck checkbox in row. right when click save button , call below code receive onscreen rows without it's properties modified new values (ie. i'm getting original values , states when table loaded). save: function() { var self = this; var data = json.stringify(this.datatable.rowdata()); var url = this.urls.savescreen; var ajaxoptions = { url: url, data: data, contenttype: "application/json", type: "post"}; } is there different call available "this.datatable.rowdata()" use receive: a.) modified rows b.) rows included changes input fields made user after table loaded. you can use hidden fields that.. add hidden field element changed in table.. $('table > *').change(function(){ $(this).parent().append('<input type="hidden">changed</input>'); }); now while che

c# - WebApi binding a single parameter from body (form-urlencoded) -

i understand why in case when there 1 parameter in post body, content type url-formencoded syntax different in case of multiple parameters. let's assume we've got these 2 methods matching route templates: public string postsinglestring([frombody]string value) { return value; } public class values { public string value1 {get; set;} public string value2 {get; set;} } public string postmultiplestrings(values values) { return string.format("{0}-{1}", values.value1, values.value2); } in first case request be: post [controller]/ body: =myvalue in second 1 though: post [controller]/ body: value1=one&value2=two if in first case syntax second example used ( value=myvalue ) param won't bind (unless string wrapped in complex type). can explain why case?

jsf - java.lang.IllegalArgumentException: Object: se.nackademin.BeachBoysSweden.entities.Book@79da4980 is not a known entity type -

im working on school assignment keep getting java.lang.illegalargumentexception when trying save entity mysql database. project uses jpa, ejb, jsf, glassfish , connection pool.keep in minde im new java web development. entity: import javax.inject.named; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.id; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.table; @named @conversationscoped @entity @table(name = "books") public class book implements serializable{ private static final long serialversionuid = 1l; @id @column(name = "book_id") @generatedvalue(strategy = generationtype.auto) private long bookid; @column(name = "title") private string title; @column(name = "author") private string author; @column(name = "price") private int p