Posts

Showing posts from January, 2010

html - JQuery showing and hiding p elements one after the other -

i trying loop through multiple p elements using jquery show , hide them can't work. i've tried loop. current shows , hides p elements , show , hide them 1 after other. here's code: html <p hidden="" class="tweet-1">"lorem ipsum"</p> <p hidden="" class="tweet-2">"lorem ipsum"</p> <p hidden="" class="tweet-3">"lorem ipsum"</p> etc jquery var i=0 $("p").each(function() { $(".tweet-" + i).show().hide(); i+=1 }); this works me: $("[class^=tweet-]").each(function(index){ $(this).delay(500*index).fadein(); }); but need change "hidden" attribute in paragraph css display none. <p class="tweet-1" style="display:none">"lorem ipsum 1"</p> <p class="tweet-2" style="display:none">"lorem ipsum 2"

ios - How to add Error handling to a working tableviewcontroller with Json (Swift 2) -

im starting programming apps in xcode 7 / swift 2.0 im pretty far developing ideas, can't seem error handling work. viewcontroller concerns presenting dates , when our band plays. in viewcontroller call json data our online server , parse tableview. works. want following things happen too. if there no connection whatsoever (wifi/4g/3g) perform segue (no connection) if server or php script unreachable, perform segue (server error ) if there no data available (as in empty array) give message "there no dates set." the json php script: ( { date = "some date"; description = "some description"; location = "some location"; others = "some details"; showtime = "some time"; }, { date = "some date"; description = "some description"; location = "some location"; others = "some details";

javascript - How do I have an event filter a page? -

i'm working on twitter clone in js + jquery pre-course development program, if obvious fix - let me know! have problem i'm unable solve: "click on username, page returns user's last tweets". the thing come is, event handler on <a> tag filter page. i'm vastly inexperienced , unclear in how proceed. any ideas? note- removed code brevity. $(document).ready(function() { var $body = $('body'); $body.html(); var stream = function() { var index = streams.home.length - 1; while (index >= 0) { var tweet = streams.home[index]; var $tweet = $('<div class="tweetbody"></div>'); $tweet.text(': ' + tweet.message); $tweet.appendto($body); index -= 1; var link = $('<a>', { text: tweet.user, href: '#', }).prop('outerhtml'); $tweet.html('@' + link + ': ' + tweet.message)

dictionary - Passing swift dictionaries with different value types to same function -

i have 2 dictionaries: let dict1 = [string : mytype1] let dict2 = [string : mytype2] to clarify: mytype1 , mytype2 structs , each dict can have 1 valuetype. and i'd able pass them same function: func dosomethingwithdict(dict : [string : anyobject]) { // dict } but gives me error: cannot convert value of type '[string : mytype1]' expected argument type '[string : anyobject]' is there way fix this, possible? if want sure dictionary declared [string:mytype1] or [string:mytype2] passed function, think best solution declaring protocol protocol myprotocol {} and making mytype1 , mytype2 conform it struct mytype1: myprotocol { } struct mytype2: myprotocol { } now can declare function generic type t must conform myprotocol . declare dict parameter [string:t] . func dosomethingwithdict<t t: myprotocol>(dict: [string: t]) { guard let value = dict["key"] else { return } switch value { case let type1

c - Launch failed. Binary not found. MinGW -

so initally tried cygwin run numerous warnings upon errors. decided clean , reinstall time mingw. no warnings! however, still getting binary error. i'm going walk guys through did in hopes maybe can find out why still getting error. file => new c project named hellow => select configurations (debug , release both checked) gross gcc command => browse (c:\mingw\bin) => finish new => class => named hellow (no namespace) => finish code (entire thing gives syntax error main() final } bracket) , build /* hello world program */ #include<stdio.h> main() { printf("hello world"); } still have syntax error, window => preference => environment (set variable path c:/program files/java/jre1.8.0_45/bin/server;c:/program files/java/jre1.8.0_45/bin;c:/program files/java/jre1.8.0_45/lib/amd64;c:\program files (x86)\google\chrome\application;c:\programdata\oracle\java\javapath;c:\windows\system32;c:\windows;c:\windows\system32\wbem;

loops - Looping and ignoring flag - Python -

i working on learning python , decided write small battle engine use few of different items have learned make bit more complicated. problem having set selection user makes should cause 1 of either 2 parts load, instead skips loop instead of performing selection. here have far: import time import random import sys player_health = 100 enemy_health = random.randint(50, 110) def monster_damage(): mon_dmg = random.randint(5,25) enemy_health - mon_dmg print ('you hit beast ' + str(mon_dmg) + ' damage! brings health ' + str(enemy_health)) player_dmg() def player_dmg(): pla_dmg = random.randint(5,15) player_health - pla_dmg print ('the beast strikes out ' + str(pla_dmg) + ' damage you. leaves ' + str(player_health)) def run_away(): run_chance = random.randint(1,10) if run_chance > 5: print ('you escape beast!') time.sleep(10) sys.exit else: print ('you try run , fai

php - mysqli_query() returns "Table doesn't exist" for known table - Permissions issue? -

here's code: $dsn = "dbinstancename.c5twsfnt9pph.us-east-1.rds.amazonaws.com"; $port = "3306"; $db = "mysql"; $username = "username"; $password = "password"; $sourcetable = "test"; //initialize connection $link = mysqli_connect($dsn, $username, $password, $db, $port); if ($link->connect_error){ echo "connection failed"; } if(mysqli_connect_error()){ echo 'mysql error: ' . mysqli_connect_error(); } if(mysqli_select_db($link, $db)){ echo 'connected successfully'; } //set initial source id import $sourceid = "1"; // first source url , name $query = "select * $sourcetable id = $sourceid;"; //echo $query; $result = mysqli_query($link, $query); if($result === false) { echo "query failed"; echo mysqli_error($link); }else{ while ($row = mysqli_fetch_assoc($result)) { echo $row['nam

java - App Crashing while passing data from activity to fragment -

i trying pass data "training2.java" class "training1.java class", , app crashing when this. "training2" activity, , "training1" fragment, believe issue stemming from. getting error "android.content.activitynotfoundexception: unable find explicit activity class {com.hardingsoftware.hrcfitness/com.hardingsoftware.hrcfitness.training1}; have declared activity in androidmanifest.xml?", so i'm issue. idea how pass off data training 1, while maintaining settings using intent? training 1: package com.hardingsoftware.hrcfitness; /** * created john on 2/7/16. */ import android.support.v4.app.fragment; import android.content.intent; import android.content.sharedpreferences; import android.os.bundle; import android.support.annotation.nonnull; import android.support.v7.app.appcompatactivity; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.adapterview; import andro

linux - how to run/execute a file in the command line without the ./ -

let's file 'foo.sh' has permissions , want run file in current directory: #> ./foo.sh what/where change in order execute file (any file permissions) typing name: #>foo.sh the idea way (in current directory). in case ./file.sh valid way execute file, file.sh work too. not intended run file.sh globally. if want execute file specific local user create ~/bin directory put file inside of , append path $path env. ':' separator check following link. http://www.cyberciti.biz/faq/unix-linux-adding-path/ but if want access globally. place file in /usr/bin or /usr/local/bin , check these paths registered in $path then. add permissions. open new terminal try call file.

bash - Access denied for user when using LOAD DATA LOCAL INFILE : Ubuntu to RDS- MYSQL -

when executing load data local infile statement following problems. running statement on ubuntu server using bash. other queries database work fine. load data infile statement fails every time. i have tried following suggested in other forums. hasn't worked. grant privileges on `%`.* username@'%' identified 'secure' grant option; this statement executed in bash: $(mysql -h "$host" --user="$user" --password="$pw" --local-infile=1 -d"$dbname" --skip-column-names -e "load data local infile '/html/results/f9_result.jtl' table `result.jtl` fields terminated ',' lines terminated ' ' ignore 1 lines;") error message access denied user 'username'@'%' (using password: yes) it looks you're granting all privileges databases 1 character in name .... %.* that. try grant file on *.* to whomever. also notice you're changing user's password oxymoroni

intercept JSON in C# to return a list of nullable boolean -

i getting error when try return list of nullable boolean json interceptor. interceptor attribute is: [jsonconverter(typeof(nullableboollistdeserializer))] public list<bool?> exemptbenefits { get; set; } the readjson method on interceptor is: list<bool?> result = new list<bool?>(); (reader newtonsoft.json.linq.jtokenreader).currenttoken.tolist().foreach(item => { string value = (string)item.toobject(typeof(string)); switch (value.tolower()) { case "true": case "yes": case "1": result.add(true); break; case "false": case "no": case "0": default: result.add(false); break; } }); return result; the json being submitted is: { &

android - Where to hold last sync time -

i have android application updated every 30 seconds retrieve latest messages server. use time-stamp holds seconds beginning of 2016 inside server database both user last sync , messages detect messages need delivered. i afraid approach more safe hold sync time prevent losing data reasons disconnection or kind of error within sync process: current approach (hold last sync time on server)? hold last sync time in client database (is subject hack?)? defining custom process make sure data delivered (like online payments confirmation)? generally speaking approaches servers , apis stateless. by storing sync dates on server prevent user reinstalling or resetting app. since fetch latest data. might wanted approach (e.g. snapchat keep no history (at least on client)) if want list past data willl complicate things. if chose store on client can more confident in user getting data needs. prevent attacks on servers should use other mechanisms. if user clears data, fetch

javascript - Get value from url(..) if it does not contain Data URI — regex -

my question url(..) in css. i have string url('blah-blah.jpg') . i've tried uri value , i've got correctly (in javascript) using regex: /url\(\s*['"]?(.*?)['"]?\s*\)/g; but if url contains data uri don't want it. how should modify regex it? think should add negative lookahead section, can't correctly. examples of mismatching: url(data:image/gif;base64,r...) url("data:image/png;base64,ga..") examples of matching: url(http://stackoverflow.com/favicon.ico) url("http://wikipedia.org/jimmy.png") note: want regex solution. know in js can use other tools problem, need regex. thanks! this should trick: url\(\s*['"]?(?!['"]?data:)(.*?)['"]?\s*\)

php - How to echo text based on highest number in set of variables? -

i interested in echoing specific text based on variable in set of variables, has greatest numeric value. example, if $var1 = 6 , $var2 = 10 , $var3 = 8 , $var4 = 4 i'd echo set of text based on variable has highest numerical number. looking @ website php array reference , saw code: <?php $age = array("peter"=>"35", "ben"=>"37", "joe"=>"43"); arsort($age); foreach($age $x => $x_value) { echo "key=" . $x . ", value=" . $x_value; echo "<br>"; } ?> i wondering if there way switch code around sort variables value. note: variables change throughout due user interaction. $age = array("peter"=>"35", "ben"=>"37", "joe"=>"43"); arsort($age); reset($age); // not needed here, in general idea $oldest = key($age); if ($oldest == "peter") { echo "pete's boss";

JQuery: multiple switch statements cancelling eachother out -

having trouble more 1 switch statement @ time: $(document).ready(function(){ $('#menu').children('span').click(function(){ whichsub = $(this).attr('id'); switch (whichsub) { case 'menu1': $('#submenu').load('menus/submenu1.html'); break; case 'menu2': $('#submenu').load('menus/submenu2.html'); break; }; if ( $('#submenu').css('left') !== '150px' ) {$('#submenu').animate({left: '150px'}, 300);} }); $('#submenu').children('span').click(function(){ var whichcon = $(this).attr('id'); switch (whichcon) { case 'submenu1': $('#demopanel').load('content/profile.html'); break; case 'submenu2': $('#demopanel').load('cont

linux - Where is the source code of /usr/bin/[‽ -

this question might asked, poor googlability, i've failed find similar question in stack overflow. i'm using ubuntu, not stuck it, answers other distributions welcome. coreutils package, src/lbracket.c , src/test.c .

typescript - Compiling TS fails because it can't delete js files which are in source control -

this follow this question . i have added generated files vs project, , publishes successfully. however, when build project, 38 errors telling me vs "unable delete *.js because access path denied." in other words, source control has put read-only lock on of files , not able unlock them automatically. i don't see way around other manually checking out every compiled javascript file compiler can it's work. just try going route , checking if files read only. have change when latest version code in vs2013. can uncheck "read only" option whole containing folder. btw, don't delete files source control, exclude them.

php - render emoji on desktop browser correctly -

Image
https://jsfiddle.net/lxevu6rz/ when data client mobile app posted , , render within desktop browser a tag overlap emoji if previous rabbit icon, why? , how solve it? tried add css a inline or inline-block still not work and question there emoji (next girl icon) not showing correctly, how solve it? correct 1 <h1>text! 🙆🏻⛷⛷👯🐰🐰🐰 <a href="/" target="_blank">#tag</a> <a href="/" target="_blank">#tag</a> <a href="/" target="_blank">@user</a></h1> this requires up-to-date unicode support on browsers of visitors. 🙆🏻 2 characters, man ok gesture 🙆, , skin color modifier 🏻. many systems don't support skin colors yet , show second character colored square or missing glyph. and skier: ⛷, may problem of missing glyphs on systems. this depends on operating system , installed fonts. on windows 10 emoji show expected. on android (even latest 6.

mysql - Combine data from 2 "strange" tables -

having following schema (er of database) trying create query will show title( movies . title ) along each movie's genre( movie_genres . movie_genre ) each movie that.. that have been seen in (a) specific time period (lets 2-3 days ex. can take days tickets . ticket_date ) (b) male customers( customer . customer_sec ) , (c) got rated more 4 (rated_customerration) customers. i can close following query: select `movie_title`, `movie_genres`.`movie_genre` `movies` inner join `movie_genres` on `mg_movie` = `movie_id` inner join `rated` on `rated_movie_id` = `movie_id` `rated_customerratio` > 4 , union (select `customer_sex`, `rated_customerratio` `customer` /* inner join `cinema`.`rated` on `rated`.`rated_customer_tabid` = `customer`.`customer_tabid` */ inner join

python - combining distance between pixels during while loop -

i'm working on uni assignment in python, need measure distance between pixels given points, can fine if use 2 points if use more 2 code measures each pair how combine distance , display @ end of loop? def maplevel2(): # city x , y values cityxvalue = [45,95,182,207,256,312,328,350,374,400] cityyvalue = [310,147,84,201,337,375,434,348,335,265] # display map map = makepicture("d:/dropbox/dropbox/uni files/assesment do/introduction programming/assignment 3/images/map.png") # city details show(map) numcity = requestinteger ("enter number of cities wish visit:") = 0 # request city details while < numcity: cityone = requestinteger ("enter city visit") citytwo = requestinteger ("enter city visit next") x1 = cityone y1 = cityone x2 = citytwo y2 = citytwo addline(map, cityxvalue[x1], cityyvalue[y1], cityxvalue[x2], cityyvalue[y2]) = + 1 kms = getdistancebetween(cityxvalue[x1],cit

php - required_without_all validator repeats error message over and over -

i'm building roster system side project , on 1 of pages can change regular hours works. on page have checkbox each day of week, can go through , select appropriate days person works. they need work @ least 1 day , @ least 1 of checkboxes needs checked when submitted. to test using required_without_all rule of laravel's validator. it works perfectly, if no boxes checked redirect , spit out same error message 7 times (as there 7 checkboxes each day of week). i using custom error messages why error message same, if didn't wouldn't want similar error message being repeated on , over. this validator looks like: $validator = validator::make($request->all(), [ 'mondaycheckbox' => 'required_without_all:tuesdaycheckbox,wednesdaycheckbox,thursdaycheckbox,fridaycheckbox,saturdaycheckbox,sundaycheckbox', 'tuesdaycheckbox' => 'required_without_all:mondaycheckbox,wednesdaycheckbox,thursdaycheckbox,fridayc

java - Not able to install M2eclipse plugin in NEON Eclipse -

i have installed eclipse neon milestone 4, java 8, , apache maven 3.3.3 on windows system. trying install plugin :: m2e - maven integration eclipse 1.6.2 in eclipse. getting error - cannot complete request. see error log details. "m2e - maven integration eclipse (includes incubating components)" ignored because newer version installed. but when in "installation detail" can't see maven plugin there. no maven menu option coming when right clicking project. please proceed. i ran problem too. i'm using same version of eclipse, etc. turns out "fix" kind of subtle. when go install new software under option using " http://download.eclipse.org/technology/m2e/releases ", select maven option. on next screen here's downloading... i had select 2 items highlighting them press next , agree licenses m2eclipse install correctly. first time when didn't work thought, okay great that's need, , nothing happened. helps, real

ios - Swift Long Polling -

i trying connect url , receive updates it, continuously returns new data in method called http long polling. have found example http long polling in swift isn't working. data returned once doesn't continuously return, , works in curl. here code: public class longpollingrequest: nsobject { var globaluserinitiatedqueue: dispatch_queue_t { return dispatch_get_global_queue(int(qos_class_user_initiated.rawvalue), 0) } var globalbackgroundqueue: dispatch_queue_t { return dispatch_get_global_queue(int(qos_class_background.rawvalue), 0) } weak var longpolldelegate: longpollingdelegate? var request: nsmutableurlrequest? init(delegate:longpollingdelegate){ longpolldelegate = delegate } public func poll(username: string!, token: string!, vehicleid: string!){ let loginstring = nsstring(format: "%@:%@", username, token) let logindata: nsdata = loginstring.datausingencoding(nsutf8stringencoding)!

c++ - Calling a static class method using a class type template -

i've seen questions no definite answer if possible other way/if should done differently. have this: template <typename t> static t* selfspawn(uworld* world, aactor* ownerparam) { if(!world) { return nullptr; } factorspawnparameters params = factorspawnparameters(); params.owner = ownerparam; t* thisactor = world->spawnactordeferred<t>(t::staticclass(), ftransform(frotator(0.f, 90.f, -90.f))); aactor* newactor = ugameplaystatics::finishspawningactor(thisactor, ftransform(frotator(0.f, 90.f, -90.f))); return cast<t>(newactor); } t::staticclass() throw error because doesn't know sure if t class type. question is, there anyway template specialization or guarantee t class type work?

delphi - Access Violation - Execution of Address -

i'm been asked investigate access violation has been occurring in our program, have little information work off. here access violation access violation @ address bc004dc2. execution of address bc004dc2 i wondering if provide information type of access violation, 'execution of address' part. since isn't access violation @ address xxxx in module 'yyyy.exe'. read of address zzzz i don't know kind of things should looking for. this means instruction pointer @ address not have page_execute protection. typically because attempting execute data. this sort of error occurs commonly memory corruptions. have corrupted either heap or stack. or using stale pointer memory has been freed, , re-used other code. debug looking @ call stack , working out how reached point of execution. whatever data structure contained address executing invalid. trace see how can valid.

how do i include subtraction, multiply and divide in my code in FASM? -

format mz entry code:start segment ddata num1 db ? num2 db ? result db ? msg1 db 10,13,"enter first number add : $" msg2 db 10,13,"enter second number add : $" msg3 db 10,13,"result of addition : $" segment code start: mov ax, ddata mov ds,ax lea dx, [msg1] mov ah,9 int 21h mov ah,1 int 21h sub al,30h mov [num1], al lea dx, [msg2] mov ah,9 int 21h mov ah,1 int 21h sub al,30h mov [num2] ,al add al, [num1] mov [result], al mov ah,0 aaa add ah,30h add al,30h mov bx,ax lea dx, [msg3] mov ah,9 int 21h mov ah,2 mov dl,bh int 21h mov ah,2 mov dl,bl int 21h mov ah,4ch int 21h https://www.pdf-archive.com/2016/11/25/fasm/ subtraction: sub al,1 sub subtracts source operand destination operand , replaces destination operand result. if borrow required, cf set. rules operands same add instruction. multiply: mul bx mul performs unsigned m

Show particular record in first row in SQL Server -

i have query this: select shipviacode tbl_vw_epicor_shipvia_master and getting output: air chrt comp co20 co40 cspu fedx nfrt ser trck i want first row 'trck', how can re-write query? select shipviacode tbl_vw_epicor_shipvia_master order shipviacode desc; cheers :)

c# - error: installing Microsoft AspNet Identity Owin in vb 2010 -

Image
i cant install microsoft aspnet identity owin in vb 2010 using nuget this because microsoft asp.net identity owin targets .net framework 4.5 , using 4.0. you can must upgrade projects .net 4.5 use package.

vb.net - No default driver specified -

i trying connect oracle 9i database using below vb code: strconnection = "driver={microsoft odbc oracle};server=servername;uid=userid;pwd=password" connect = new adodb.connection connect.open(strconnection) the last line throws me below error: [microsoft][odbc driver manager] data source name not found , no default driver specified the vb code working fine , able connect dev database in dev server. same script not working in uat server. tns entries fine. both servers of windows server 2008 - 32 bit. when checked drivers tab in odbc data source administrator, dev server has below entry: microsoft odbc oracle - 6.00.6001.18000 - microsoft corporation - msorcl32.dll - date whereas uat server has below entry: microsoft odbc oracle - the driver microsoft odbc oracle listed in drivers tab of uat server not have version & dll file details. driver not installed properly? if yes, how re install it? please resolve issue. thank res

java - Why is multithreading slowing down -

i'm trying save byte array of rgb values png image follows: byte[] imgarray = ...; int canvassize = 512; colormodel c = new componentcolormodel(colorspace.getinstance(colorspace.cs_gray), null, false, false, transparency.opaque, databuffer.type_byte); image image = toolkit.getdefaulttoolkit().createimage( new memoryimagesource(canvassize, canvassize, c, imgarray, 0, canvassize)); bufferedimage bimage = new bufferedimage(canvassize, canvassize, bufferedimage.type_byte_gray); // draw image on buffered image graphics2d bgr = bimage.creategraphics(); bgr.drawimage(image, 0, 0, null); //this takes time bgr.dispose(); imageio.write(bimage, "png", new file(uniquefilename)); i'm using fixedthreadpool save multiple images simultaneously. more threads use (up number of free cores have on computer), longer saving process takes. running on 6 threads takes twice long running on 1 thread. why taking longer multiple threads? memory swaps? can avoid probl

Kendo UI Grid ASP.NET MVC Wrapper ParameterMap -

is there way define parametermap option kendo ui grid via server side asp.net mvc wrappers? i need change local time utc time before sending filter command server, , appears way it. sort of... you can specify string parametermap setting, , string can either javascript function directly, or name of javascript function found on page. .parametermap("myparammapfunction"); or .parametermap("function(data){ /* stuff data */}");

jsf - EJB in Liferay Tomcat bundle -

i know if can develop jsf-portlet own ejb's , custom jpql or hibernate in liferay tomcat bundle. know possible bypass service builder , use custom jpql or use ejb in mvc porltets. possible jsf portlets iin liferay tomcat bundle(6.2 ce)? the link stiemannkj1 posted covers subject in detail. it possible use custom hibernate , spring in jsf liferay portlet, however, may cause serious problems if try manipulate same entities portlet. same goes ejb, , need tomcatee this. if want this, have ensure entities - ejb's managed 1 portlet, or use rest/soap services retrieval of those(which adds complexity in system). can avoid using liferay's service builder. i going try though, @ least hibernate/services , going share result soon.

How to rename a user in MongoDB? -

there user in database, user should renamed. how rename user? mongodb user management reference has method db.updateuser don't see how set new name user. how update username? ty db.updateuser( "<username>", { customdata : { <any information> }, roles : [ { role: "<role>", db: "<database>" } | "<role>", ... ], pwd: "<cleartext password>" }, writeconcern: { <write concern> } ) did try update user? db.system.users.update({"user":"oldname"}, {$set:{"user":"newname"}}) this command requires root access admin database.

Move files from Listview to new directory in vb.net -

i'm trying write code in users can add files listview. these files must moved user specified location. can't work filepath of files added listview. here's code moving file: spath = my.settings.defaultpath & combobox1.text & "\" & combobox2.text & "\" if txtonderwerp.text = "" if combobox3.text = "make choice..." msgbox("select subject!", msgboxstyle.information) else try each item listviewitem in listview1.items my.computer.filesystem.copyfile(item, spath & combobox3.text & "\" & item.text, fileio.uioption.alldialogs) msgbox("copy succesfull.", msgboxstyle.information) listview1.items.clear() me.close() next catch ex exception messagebox.sh

java - Share library among multiple application deployed in Mule esb -

i have multiple application deployed in mule esb. these application have same set of jars trying create shared library . if place jars in %mule_home%/lib/user works fine, trying put these jars custom folders.for example %mule_home%/lib/user/hibernate not able deploy applications. ok let's if using maven didn't had issue, packaged deploy without issues. anyway if still way want go it's normal not pick on subfloder, not on path. one way have create unique jar containing jars , put in lib/users. there probally way, if didn't tested , not encourage. go play mule wrapper.conf , add folders classpath, can see around line 118 of file : but again recommend use maven painless (more or less) dependency management.

wix3.9 - Editing packaged file in WiX -

wix newbie here. i'm curious if approach possible using wix. problem statement... i packaging sql files want execute against parameters user enter @ run time. think connection string information. 1 of parameters user can enter directory want db installed. current solution (doesn't work)..... to i'm packaging these files using heat. when sucks in files 1 of sql files has tokens in them custom action looks find replace in file. problem thatwhile indeed doing find replace it's doing them against source files heat sucked in , not files exist in .msi file. question 1... within wix workflow there way via custom action can processing on files stored within .cab or .msi file? if possible can show me example of this? question 2 . . . if question 1 isn't possible other idea had break find replace sql piece , file install piece separate msi file. first step explode files need install directory via 1 msi. next msi execute sql piece @ point files ex

python file ouput filname.write(" "" ") is not writing to file "" -

my python script not writing "" code filname.write(" "" ") . what going wrong here? you need do: filename.write(""" "" """) or filename.write(' "" ')

c# - generalizing 'using' in a functional way -

i've been going through c# code , trying convert majority of more functional. how convert using expression more functional-style pattern? using (var stream = file.openwrite(path.combine(settingsfolder, settingsfilename))) using (var writer = new someclass(stream)) { writer.write(settings); } i'm trying use functional pattern (replacing using disposable): public static class disposable { public static tresult using<tdisposable, tresult>( func<tdisposable> factory, func<tdisposable, tresult> map) tdisposable : idisposable { using (var disposable = factory()) { return map(disposable); } } } will pattern not work since class file static , sealed? well, work. not sure why want this, file being static doesn't prevent in way this. func expects factory delegate, not class can instantiated. this code should work you: disposable.using (

java - How to get ServletContext object in the data layer? -

my application runs 2 separate parts, web module runs in tomcat container , data layer runs separate java program in different service , interact using database. i want access servletcontext in data layer, how can this? when use servletcontext in data layer gives me exception noclassdeffounderror . so took @kayaman's advice. , tried limit use of objects in respective layers i.e. using context in presentation layer , hibernate session in data access layer. i passed call controller dao , store needed objects in global map in dao later called further processiong. , returned signals presentation layer.

python 2.7 - using variable for urllib url causing unknown url type: '%22http' error -

i trying pass url urllib with: # file url on each line file_object = open('file.txt', 'r').xreadlines() line in file_object: print line # check if getting correct value var = urllib.urlopen(line).read() i getting error: ioerror: [errno url error] unknown url type: '%22http' i think %22 means escaped quotation mark. so url in file formatted as: "http://www.test.com" and print statement printing out: "http://www.test.com" and creation of " 's surrounding url generated "\"" + url + "\"" intention urllib being given url in format thought required. seems escape code somehow being kept , urllib not treating value "http://www.test.com" . if putting urls in file quotation marks included, normal not work, quotation marks required literal strings in source code. including quotation marks in file if write in source code "\"http://www.test.com/\"

parsing strings in string.ini using PHP -

i have strings.ini file defining strings like tz1 = "utc+4:30 asia/kabul" tz2 = "utc+5:45 asia/katmandu" tz3 = "utc-4:30 america/caracas" i have substring value 5:45 . based on want lhs part tz2 . how using php? let's say, have settings.ini file. can use parse_ini_file() function this: settings.ini [base] tz1 = "utc+4:30 asia/kabul" tz2 = "utc+5:45 asia/katmandu" tz3 = "utc-4:30 america/caracas" php file // parse without sections $ini_array = parse_ini_file("settings.ini"); print_r($ini_array); this output: array ( [tz1] => "utc+4:30 asia/kabul" [tz2] => "utc+5:45 asia/katmandu" [tz3] => "utc-4:30 america/caracas" ) now can value of tz2 , value as: $ini = explode(" ", $ini_array["tz2"]); $ini = str_replace("utc", "", $ini); so, $ini value be: +5:45 . you can loop through

jsf - Update tag generate multiple dialog instances in appendTo="@(body)" dialogs -

i've following error running on pf 5.1: when update div contains <p:dialog appendto="@(body)" .... ></p:dialog> it generates duplicated dialog in dom example main.xhtml <h:body> <ui:composition template="/templates/layout.xhtml"> <ui:define name="content"> <h:form id="formgrowl"> <p:growl id="growl" showdetail="true" showsummary="false" autoupdate="true" /> </h:form> <h:panelgroup id="mainpanel" style="background: #ffffff;" layout="block"> <p:scrollpanel mode="native"> <h:panelgroup layout="block" style="padding: 1em;"> <p:commandbutton value="go page dialog" action="#{mycontroller.gotopagewithdialog}&q

java - x.y Activity is not a concrete class error message in manifest -

Image
i got ... "is not concrete class" error in manifest file. the app works though. can build , test without problem error bugs eyes. please if can. when i ctrl + click on activity name on manifest opens .java src file. (the activity called "mapinputactivty" - typo know, not problem.) that message telling mapinputactivty class abstract , , instantiation fail should system try launch it. base classes app's components don't need appear in manifest. concrete subclasses necessary, system has appropriate information on components' capabilities , functionalities. example, though of activities must descendents of activity class, wouldn't list activity class in manifest.

server - How to get operator rights in ircd-hybrid? -

i have installed ircd-hybrid on ubuntu server 14.04.2, running , can connect. when try /oper, not operator rights, saying "only few of mere mortals may try enter twilight zone". did configured wrong? or impossible /oper on internet , allowed on local network? my configuration in ircd.conf file standard besides changed entries: auth { user = "*@*"; class = "users"; password = "secret"; # flags = need_ident; }; #operator { name = "op"; user = "*@*"; password = "hello"; encrypted = no; class = "opers"; } i connect normal user password "secret" server , try rights with /oper op hello any suggestions wrong? the operator tag commented out. replace "#operator {" "operator {" , try again after rehashing ircd sighup.

how to create marketo sandbox account for developement purpose for writing and testing API -

i new in marketo. i have write api integrate marketo in web application says requires token id make api call in marketo , token provided if login in marketo problem new marketo , don't have marketo login credential. is there way create test account in marketo can create 1 , write api , test there. any appreciated. thanks in advance you need apply partner account gives sandbox account here: partner webpage there appear minimum requirements eligible however. work have partner account , internal deployment our marketing team, , have found sandbox partner account severely limited compared real deployment.

ios - How to prevent button resize when zoom super view? -

Image
i adding multiple gestures in 1 view, view have 1 close button @ corner of view, working fine when zoom view close button zoom view, want zoom view not close button, please suggest me how ? see below image reference. code pinch zoom -(void)addstickerswithview:(uiview*)view image:(uiimage*)image{ cgpoint center = self.imgphoto.center; uiimageview *imgview = [[uiimageview alloc] initwithimage:image]; uirotationgesturerecognizer *rotationgesture = [[uirotationgesturerecognizer alloc] initwithtarget:self action:@selector(rotatepiece:)]; [imgview setcontentmode:uiviewcontentmodescaletofill]; uiview *viewzoom = [[uiview alloc] initwithframe:cgrectmake(center.x-45,center.y-45, 90, 90)]; // [viewzoom setbackgroundcolor:[uicolor redcolor]]; imgview.frame = cgrectmake(5, 5, cgrectgetwidth(viewzoom.frame)-10, cgrectgetheight(viewzoom.frame)-10); [viewzoom addsubview:imgview]; [viewzoom addgesturerecognizer:rotationgesture]; uipinchgesturerec

How can I remove punctuation from a string in Python? -

i trying remove punctuation string whenever run program nothing happens... code: #open file (a christmas carol) inputfile = open('h:\documents\computing\gcse computing\revision\practice prog/christmascarol.txt') caroltext = inputfile.read() #convert lowercase line in caroltext: caroltextlower = caroltext.lower() #remove punctuation (put space instead of hyphened word or apostrophe) import string exclude = set(string.punctuation) nopunctu = caroltextlower.join(ch ch in caroltextlower if ch not in exclude) print(nopunctu) when run program, nothing appears here's repaired version of code. import string #open file (a christmas carol) inputfile = open(r'h:\documents\computing\gcse computing\revision\practice prog/christmascarol.txt') caroltext = inputfile.read() inputfile.close() #convert lowercase caroltextlower = caroltext.lower() #remove punctuation exclude = set(string.punctuation) nopunctu = ''.join(ch ch in caroltextlower i

php - How to use javascript:void(0) in a form action in Laravel? [Laravel 5.1] -

as know javascript:void(0) used set action undefined in simple html. need use same thing in laravel blade stated below: {!! form::open(array('url' => '#', 'class' => 'form-search', 'id'=>'search_form')) !!} how set form action javascript:void(0) in above code. please me sort out issue. thanks. {!! form::open(array('url' => '#', 'class' => 'form-search','id'=>'search_form')) !!} <!-- content --> <input type="submit" value="submit" onclick="function()" > </div> {!! form::close() !!} and in function() javascript:void(0)

php - Apache solr : Search across multivalued fields -

i have multivalued field "name" , need perform search across field i need results name = 'john doe' or name='peter joe'. how should write filter query above result. i used filter query like fq=name:(john doe or peter joe) but somehow not working.

/etc/hosts on a Vagrant multi machine setup -

i'm working on getting cluster bidding , must know each other. i'm missing way of putting ip/name pairs in /etc/hosts how do during provisioning phase? i can machine a's ip address when provisioning machine a, ip address given machine b? after 'vagrant up' can run script on host finds each machines ip address , updates /etc/hosts files little awkward. there more elegant solution? if ip addresses of machines fixed write provisioning script adds correct entries /etc/hosts . if addresses not known until boot has determined each of vms , fed provisioning script. finally, the provisioning script run vms.

android paypal payment gateway integration issue -

android implemented pay-pal payment gateway integration in app have one problem unable view pay-with card button shows me pay-with pay-pal button pay pal account. imported paypalandroidsdk-2.13.1.aars file dependencies { compile project(':paypalandroidsdk-2.13.1') } and added dependency in gradle file can 1 resolve these issue. defaultconfig { multidexenabled true } dependencies { compile('com.paypal.sdk:paypal-android-sdk:2.13.1') } please change dependency , default configuration