Posts

Showing posts from July, 2013

installer - How to show pop message before majorupgrade -

how show pop message user wants upgrade new installer or not before major upgrade. i tried majorupgrade element, able downgrade custom actions not major upgrade. if using majorupgrade element wix_upgrade_detected property defined when upgrade performed. can define new dialog or pop-up in ui based on property. you'd need modify publish element want put ui so: <publish event='showmajorupgradedialog'>wix_upgrade_detected</publish>

regex - 301 redirect to the rewrited url -

the cms working has these rewrite rules: for tags: rewriterule ^tags/([^/]+)/$ tag.php?t=$1&page=1 rewriterule ^tags/([^/]+)/page-([0-9]+)(/)?$ tag.php?t=$1&page=$2 for category pages: rewriterule ^browse-(.*)-videos.html$ category.php?cat=$1 rewriterule ^browse-(.*)-videos-([0-9]+)-(.*).html$ category.php?cat=$1&page=$2&sortby=$3 but not redirect seo friendly url estructure creating duplicate content issues, how can make 301 redirects rewrited url if accessed other? thanks in advance you need create 4 new rules , place them above existing. #redirect old url new seo rewritecond %{the_request} ^get\ /+tag\.php\?t=([^&\s]+)&page=1 rewriterule ^ /tags/%1/? [r=301,l] #redirect old url new seo rewritecond %{the_request} ^get\ /+tag\.php\?t=([^&\s]+)&page=([^&\s]+) rewriterule ^ /tags/%1/page-%2/? [r=301,l] #redirect old url new seo rewritecond %{the_request} ^get\ /+category\.php\?cat=([^&\s]+)&page=([^&\s]+)&sor

ios - Try catch whole block in Swift 2 -

i know how make try-catch single function. problem want try-catch whole block of code - simple if goes wrong ignore whole block. let me show simple example. simple parser facebook graph api /me/taggable_friends: let params:[nsobject : anyobject] = ["fields": "first_name, last_name, id, picture"] let request = fbsdkgraphrequest(graphpath: "/me/taggable_friends", parameters: params, httpmethod: "get") request.startwithcompletionhandler { (connection, result, error) -> void in if let error = error { print(error) } else{ let resultdictionary:nsdictionary! = result as! [string: anyobject] let array = resultdictionary["data"] as! nsarray object in array { let firstname = object["first_name"] as! string let lastname = object["last_name"] as! string let

encrypting string in javascript without external library -

basically, i'd have javascript function checks whether you've entered specific string -- don't want string visible in source code. in mind, go this: function checkpass(input) { if (encrypt(input) === 'ojqqyaqud4aplzvag3fvcii8os9qbr23tlzwwjbw') { alert('success'); } else { alert('fail'); } } function encrypt(input) { //pass through encryption algorithm } how might accomplish –– ideally, without external libraries? because javascript can seen in source, there not can do. minify - in order make harder read , obfuscation another thing use http://javascript2img.com/ make hard read.

Android Widget Upgrade app.. remove the widget -

steps: download app 3.0 market. add widget of app. sign of app 4.0. install latest 4.0 app on device. it remove widget on devices. user have explicitly add widget again. want udpate existing widget. any idea ?? which devices talking about? must not change widgetproviders class name , broadcastreceiver , package name (obviously) allow updates of widgets. never heard updating package makes loose widget if pay attention things above.

Is there a shorthand for this multidimensional array declaration in C -

so have code: #include <stdio.h> #include <stdlib.h> #include <string.h> char field1[45]; char field2[444]; char *fields[] = { field1, field2 }; int main (int argc, char *argv[]) { sprintf(fields[0], "hello\n"); printf(fields[0]); } i have no need accessing fields using field1 , field2. there shorthand way this? tried following doesn't work. char *fields[] = { char[45], char[444] }; basically guess want array contains character strings of varying length without having use malloc. you write: char *fields[] = { (char[45]) { 0 }, (char[444]) { 0 } }; i'd suggest against using design though makes difficult perform check won't overrunning buffer.

swift - Slow responsiveness of sprite.xScale -

in spritekit game, wish resize sprite (named "manta" below) based on user vertical drag. drag should make sprite bigger while drag down should shrink it. i have implemented uipangesturerecognizer , in rec.state == .changed , have below code: let deltay = startpoint.y - currentpoint.y newscale = mantacurrentscale + ((deltay / dragheight ) * mantascalediff ) if (newscale <= mantamaxscale) && (newscale >= mantaminscale) { manta.xscale = newscale manta.yscale = newscale mantacurrentscale = newscale } it works not reliable, responsiveness of resizing sluggish , not useable in live game. are there sprikekit tricks not aware of, give priority process or there better alternatives uipangesturerecognizer create such control in spritekit? i wouldn't use gesture recognizers because easier if know touch point. here example in sudo code might find works. of these functions can overridden inside of skscene, , position can found. var

c# - Epicor10-Image.Save method -

i trying build customized window in epicor 10. have added picturebox , try open picture(bmp) file , button save somewhere else. problem in customization tools dialog epicor 10, write code when compile keep getting error: error: cs1061 - line 258 (953) - 'object' not contain definition 'save' , no extension method 'save' accepting first argument of type 'object' found (are missing using directive or assembly reference?) ** compile failed. ** now, when have copied code, , re-created windows form app visual studio 2012, works fine, no errors on compilation @ all. the code quite simple: private void epibuttonc6_click(object sender, system.eventargs args) { var fd = new savefiledialog(); fd.filter = "bmp(*.bmp)|*.bmp;| jpg(*jpg)|*.jpg;| png(*png)|*.png"; fd.addextension = true; if (fd.showdialog() == system.windows.forms.dialogresult.ok) { switch (path.getextension(fd.filename).toupper())

Drupal Node Render: load full page (scripts, head...everything) -

i have module putting , using code programatically load node , markup: <?php $node = node_load($nid); $node_view = node_view($node, 'full'); $rendered_node = drupal_render($node_view); echo $rendered_node; ?> however...whilst gives me themed output of node (the markup node content itself, not page , html template information loaded instance of node) not give me information want. full output of entire themed page includes html tags, head tag , content. ultimately, standard variables structure present each node load in way, happy settle final markup (at least guaranteed post processing modules etc). of course loading node programatically might not current node being processed page using module, mind unable information require. is possible? obliged help! i go way: $my_page_callback_result = menu_execute_active_handler("node/$nid", false); have @ array, contains lots of variables, ones need. additionaly, can following rendered html p

r - dividing all values in one column by values in a separate data frame (colnames match) -

i need divide every value in given column of first data frame value in corresponding column name of second data frame. example, need divide every value in 0 column of demand_copy 25.5, every value in 1 column 13.0, etc. , output same structure first data frame how 1 in r? > head(demand_copy) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 25 9 14 3 10 10 28 175 406 230 155 151 202 167 179 185 275 298 280 185 110 84 93 51 2 36 17 9 3 2 7 32 88 110 131 89 125 149 165 161 147 178 309 339 201 115 78 67 39 3 10 3 5 10 0 11 15 58 129 110 49 62 62 100 70 73 72 86 116 61 49 37 26 22 4 24 15 10 5 3 4 39 53 108 98 80 118 116 110 135 158 157 196 176 132 118 94 91 102 5 40 45 15 9 16 37 75 205 497 527 362 287 316 353 359 309 365 653 598 468 328 242 168 102 6 0 0 1 2 0 0 11 56 26 12 21 6 27 15 18 5 14 19 25 6 4 0 1 0 > medians medians 0 25.5 1 13.0 2

javascript - How can I set maximumSelectionLength while closeOnSelect is false in Select2? -

i have following code: $("#select2").select2({ closeonselect: false, maximumselectionlength: 5, ... // have ajax implemented here }); when have closeonselect false , have maximumselectionlength set, i'm able select more 5 items without problem. when click away dropdown while having more 5 items selected , try add another, message "you can select 5 items". is there workarounds have these 2 properties work without clashing? i'm using select2 4.0.1. update: i took pratikwebdev's advise , added following code: $("#select2").select2({ closeonselect: false, maximumselectionlength: 5, ... // have ajax implemented here }).on("change", function(e) { if(e.target.length == 5) { $("#select2").select2({closeonselect: true, maximumselectionlength: 5,

Formatting SQL Data having inserted it into HTML (Webpage) using PHP -

hello stackoverflow community, can provided once again wonderful interllectuals! problem - i've created db connection, i've queried db, , i've turned results associative array. displaying sql data using php trouble i'm having. i've managed display in basic way, aim information display 'news column' down side of page, , therefore need data inserted divs me able manipulate. attempt far - 1 can see below, presentation of attempt display data cringeworthy. in way did manage distinguish types of headings each piece of data. echo "<h2>" . $row["title"]. "</h2><h3>date: " . $row["datetime"]. "</h3><h4>passage: " . $row["passage"]. "</h4><br>"; html current webpage: http://i.imgur.com/9u1twkd.png (what 'news column' looks like) http://i.imgur.com/1tga0sx.png (my html code want data inputted into) - aim able complete form ( htt

Swagger-ui - Not able to figure out how some features are functioning for Petstore -

i have downloaded , browsed swagger-ui dist/index.html file , has loaded sample petstore apis. however, not able figure out how features functioning , hence not able bring own definition. the sample petstore shows "valid {...}" button @ bottom right hand side. don't see when navigate own api definitions. how enable it? when petstore api specifications being rendered swagger-ui http://petstore.swagger.io/v2/swagger.json i not able figure out how plugging in section below swagger petstore description. contact developer mailto link email address , subject line find out more swagger http://swagger.io doesn't show either in petstore json definition or 1 using. where sample picking from? when use swagger editor, interprets specification in different way - showcasing terms of use , license information appropriately. swagger-ui not support properties? need enable in swagger-ui make them appear? you need using latest version of swagger, swagger

ios - How to custom rectangle progress bar? -

Image
i want custom rectangle progress bar uikit attracted image. there source code that? cocos2d has same 1 ccprogresstimer can't find uikit source code. create shapedlayer cashapelayer *layer = [cashapelayer layer]; [layer setstrokecolor:[uicolor greencolor].cgcolor]; [layer setlinewidth:10.0f]; [layer setfillcolor:[uicolor clearcolor].cgcolor]; create rect radious want animate uibezierpath *path = [uibezierpath bezierpathwithroundedrect:cgrectmake(10, 10, 300, 200) cornerradius:10.0f]; layer.path = path.cgpath; cabasicanimation *animation = [cabasicanimation animationwithkeypath:@"strokeend"]; animation.fromvalue = [nsnumber numberwithfloat:0.0f]; animation.tovalue = [nsnumber numberwithfloat:1.0f]; define animation duration animation.duration = 4.0f; [layer addanimation:animation forkey:@"mystroke"]; add animation layer on want display [self.view.layer addsublayer:layer];

Ruby Hash#select method returns incomplete hashes -

i'm trying solve project euler question #21 in ruby. let d(n) defined sum of proper divisors of n (numbers less n divide evenly n). if d(a) = b , d(b) = a, ≠ b, , b amicable pair , each of , b called amicable numbers. example, proper divisors of 220 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 , 110; therefore d(220) = 284. proper divisors of 284 1, 2, 4, 71 , 142; d(284) = 220. evaluate sum of amicable numbers under 10000. i used brute-force method find solution finds sum of divisors of each number in [2,10000) range , pushes them hash object. require 'prime' #method reference http://stackoverflow.com/questions/3398159/all-factors-of-a-given-number def factors_of(number) primes, powers = number.prime_division.transpose exponents = powers.map{|i| (0..i).to_a} divisors = exponents.shift.product(*exponents).map |powers| primes.zip(powers).map{|prime, power| prime ** power}.inject(:*) end #modified line divisors.sort![0..divisors.size-2] end ht=hash.

qt - Copy to clipboard in C++? -

this question has answer here: how copy/paste clipboard in c++? 4 answers i want copy string clipboard in c++ application. how can that? possible copy formatting well? thank you you said use qt in 1 of comments. qt has class qclipboard , want (bonus: cross-platform). you can put want, data managed via mime types. means can use own data formatting in clipboard, 'custom' mime type. note formatting done html text ( text/html ), whereas plain text in text/plain (for plain text qt provides function text() ).

Python convert timedeltas into hours in string format -

i have timedelta object 3457 hours timedelta(hours=3457) i want represent in "hh:mm" format, "3457:00" i do: from datetime import datetime hours = timedelta(hours=3457) hours_string = time.strftime("%h:%m", time.gmtime(hours.seconds)) print hours_string "01:00" how can "3457:00"? please note 3457:00 nonsensical format. "hour-colon-minutes" format used in dates , times, , hour can't reasonably higher 23. more reasonable format is: 3457h 0m. you can this: from datetime import timedelta delta = timedelta(hours=3457) minutes, seconds = divmod(delta.seconds, 60) hours, minutes = divmod(minutes, 60) hours += delta.days * 24 print '%sh %sm' % (hours, minutes) of course, easier way this: from datetime import timedelta delta = timedelta(hours=3457) print delta but give "144 days, 1:00:00", sane format, not want.

c# - IPagedList localization -

i'm using third party component ( ipagedlist ) implement pagination. works fine, need localize message example showing items 11 through 11 of 11. this message text generated using pagedlistrenderoptions.minimalwithitemcounttext use following code set custom localized format: var options = new pagedlistrenderoptions(); options.pagecountandcurrentlocationformat = "page {0} of {1}."; //your custom string goes gere options.itemsliceandtotalformat = "showing items {0} through {1} of {2}.";

c# - Unable to change array size in Inspector variable in Unity? -

Image
from have read how vector "size" set public color[] teamacolors = new color[4]; but when code run looks it doesn't seem matter number put [4], size stays 6. not sure 6 number coming have not set number. i have tried public color[] teamacolors; and let array auto populate length, doesn't change 6 either. it's simply public color[] teamacolors; but "6" value "won't go away"? but you've stumbled on "reset" gotchya in unity! just try different variable name ... public color[] teste; see? there is, working fine. can set size dynamically, long never put size in code . here secret: unity "holds on to" serialized values in complicated way. if set size in code once, unity "remembers" if subsequently change code. there way reset "inner" value .. famous tiny reset button . it attached tiny cog symbol. the critical rule remember this: never, ever,

c++ - Char pointer equivalent in c# -

i converting c++ code c#, , char in c++ takes 8 bits while in c# takes 16 bits. don't know char*, so what equivalent of char * in c# , use byte[] or [marshalas(unmanagedtype.lpstr)] stringbuilder , tell me whether equivalent of char c++ c# byte or string ? for input parameter string or byte[] , depending on meaning of parameter. if represents sequence of characters use string . if parameter buffer arbitrary data it's byte[] . however in c/c++ char * can output parameter, such in sprintf function. in case stringbuilder or byte[] equivalent types, depending again on meaning of parameter. with regards char datatype in c#, please keep in mind char in c# means character, whereras meaning c/c++ closer of byte in c#.

c# - Razor Safe Navigation Operator? -

is there way navigate object graph in razor view in null-safe manner (without having @if guard-blocks? for example, have following in index.cshtml : @foreach (store.models.product product in @model) { <tr> <td>@product.id</td> <td>@product.productname</td> <td>@string.format("{0:c}", @product.price)</td> <td>@product.quantity</td> @if (@product.category != null) { <td>@product.category.categoryname</td> } else { <td></td> } </tr> } not of products have categories. when not, product.category null. what safely able navigate object graph , not have worry nullreferenceexception blowing view. in groovy/grails, used using safe navigation operator , like: <td>@product?.category?.categoryname</td> of course, did not work in razor. is there sort o

java - Add appenders to WAS 6.1 logger -

i have old project made on httpservlets , located on ibm 6.1. project works slf4k-api , slf4j-jdk binding (i think jdk-binding binds was-specific jul implementation). need add appenders there logs (systemout.log, trace.log etc.) , logs specific every module of project. got know logging dont connected logging.properties in was's jre, dont have idea or how configure properties logger. i tried search ibm online propose change log level through console every project or create properties file something (actually dont understand guide about). next looked ibm guides, found guide how use jul , there not single word how configure it. ( funny moment in article author wrote article configuration later, , after 3 years author wont make lol ). how configure logger? p.s. please dont propose change api (jcl, log4j etc.). ty edit 1: tried change jdk-binding log4j-binding, , works! dont produce it's standart logs(trace,systemout etc.) you asked how configure logger. 1

php - Temporary storage on a server -

i'm looking efficient , secure way store small amount of user data line of text, indefinite period of time. scenario: 1 client 'a' sends data client 'b' , asynchronously via server 's'. simplicity, consider data single line of text. now, data delivered client 'b' server 's' , only when b asks it . until time server 's' has store data. for simple demo, implemented crudely follows: client 'a' post request xmlhttprequest, sending text 's' follows xhr.open("post",url+"?senttext=text"); //url points php file on s xhr.send(); the php code saves received text file follows: <?php $selected = $_get["senttext"]; $writefile = "text.txt"; $fh = fopen($writefile,'w'); fwrite($fh,$selected); fclose($fh); ?> later, after amount of time, b asks text in file,using bufferedinputstream follows: url fileurl = new url("url/

sql - query for first and last day of month -

Image
if have name of month, how can have first , last day of month in sql? i have query returns month names: declare @startdate datetime, @enddate datetime; select @startdate = '20110501' ,@enddate = '20110801'; select datename(month, dateadd(month, x.number, @startdate)) monthname master.dbo.spt_values x x.type = 'p' , x.number <= datediff(month, @startdate, @enddate) result: now, how can first , last day of months? changing query. try :- declare @startdate datetime, @enddate datetime; select @startdate = '20110501' ,@enddate = '20110801'; select datename(month, dateadd(month, x.number, @startdate)) monthname, convert(varchar(25), dateadd(dd,-(day(dateadd(month, x.number, @startdate))-1),dateadd(month, x.number, @startdate)),101) firstday, convert(varchar(25),dateadd(dd,-(day(dateadd(mm,1,dateadd(month, x.number, @startdate)))),dateadd

ruby on rails - action controller strong params with value that can be either scalar OR array? -

i have endpoint receives data in such way: {:stuff => [ { :name => 'item_1', :value => [ { :arcade_game => "dragon's lair", :manufacturer => "cinematronics", } ] }, { :name => 'item_2', :value => 'something else' } ] } because there values scalar, , arrays, becomes problematic because: params.permit(:stuff => [:name, :value]).require(:stuff) will give me: => [{"name"=>"item_1"}, {"name"=>"item_2", "value"=>"something else"}] and params.permit(:stuff => [:name, :value => [:manufacturer, :arcade_game]]).require(:stuff) will give me: => [{"name"=>"item_1", "value"=>[{"manufacturer"=>"cinematronics", "arcade_game"=>"dragon's lair"}]}, {"name"=>"item_2", "value"=>nil}] ... so way can figure out

How does the assignment operator (=) in Perl work internally? -

suppose num array, @num = (1 .. 10); to find length use following expression, $num = @num; then used same $num in assignment below. @slicenum = $num[1 .. 6]; i aware slicing array use @num instead of $num . ran without throwing errors. when print value of @slicenum , gave me 2 result. @slicenum = $num[1 .. 6, 10 .. 20]; for above assignment, got 1 result. although value of $num remains 10, please explain happening in above 2 assignments. you have discovered bit of perl magic @ work. range operator (aka the flip-flop operator amon points out) .. in scalar context seems want compare range $. , when used integers: $ perl -lwe '@a = 1..10; @foo = $a[1..6]; print @foo' use of uninitialized value $. in range (or flip) @ -e line 1. argument "" isn't numeric in array element @ -e line 1. 1 $ perl -lwe '$x=<>; @a = 1..10; @foo = $a[1..6]; print @foo' somefile.txt name "main::x" used once: possible typo @ -e

Binary Keyboard Layout -

i've informed myself bit keyboard layouts , tried things dvorak or neo, today asked myself question wether there sort of 'binary' keyboard layout. it should use 8 keys key in binary representation of 1 character (one byte). example: asdf , jkl; used input. if want write 'a' (65 decimal, 10000001 binary) had press a , ; or wanted write 'f' (146 decimal, 10010010 binary) had press a , f , l . i wondered if there or show me c/c++ library capable of altering keaboard layout , supporting combinations these.

python 3.x - ValueError: attempted relative import beyond top-level package -

i playing the python's import system in order understand better how works, , encountered problem. have following structure pkg/ __init__.py c.py d.py subpkg/ __init__.py a.py b.py inside a.py have following code: from . import b .. import d and inside c.py have following: import subpkg.a now receive following error: valueerror: attempted relative import beyond top-level package but why ? how can solve it? running c.py idle, , pkg should considered package, since has __init__.py file. the first import works fine, it's following doesn't work: from .. import d because attempting import parent package, apparently cannot, weird reason. python 3 changed import system every time want module around 1 working, need relative imports (unless mess python_path or sys.path ). the correct usage here should be from .subpkg import when working idle, have totally different environment. therefore, add

node.js - are there any free proxy services to use in nodejs? -

because of internet restrictions in iran music streaming services unreachable. i'm going build open source desktop application electron extract music sources soundcloud, last.fm, etc.. , because open source project, i'm not going configure proxy server. so wondering there free proxy services can use package (or api) in nodejs ? yes, know can use tor. as independent program called terminal . , don't want because electron big enough ... i suggest making program support proxy configuration, whether http proxy or socks proxy. at least simplest thing do. can leave users find proxy servers, whether "free" ones, tor, or otherwise. you can instruct users how run program through tunnels proxychains, polipo or other programs handle transparently proxying program's network communication. these require minimal development , still accomplish you're looking do. hope helps.

mysql - How to fetch Distinct Title from the GROUP_CONCAT as Left Join without repeating other tables' data? -

i've got table of values this: table: prop_feat type feat appliances gas range appliances fridge interior hardwood flooring i'm trying display type once features below: appliances gas range, fridge interior hardwood flooring these values empty need left join table. i've searched everywhere! how should writing mysql display results this? have far isn't quite doing it. (i know.. not left join.. ) select * (select group_concat( distinct concat ('', type, '', prop_feat.feat, '') order type asc separator ' ' ) prop_feat prop_feat.id_prop = '$page' ) feat properties id_pg = '$page' any appreciated! edit this whole query.. i've got whole bunch of joins. making type/feature issue difficult. select *, group_concat(concat('<tr><td>', style, '</td><td>', beds, '</td><td>', ba, '</td><td>', sq_ft, '&

xml - Simple Xpath query in scala -

i'm trying run xpath query scala , doesn't seem work. xml looks ( simplified): <application> <process type="output" size ="23"> <channel offset="0"/> .... <channel offset="4"/> </process> <process type="input" size ="16"> <channel offset="20"/> .... <channel offset="24"/> </process> </application> i want retrieve process input attribute , use xpath query: //process[@type='input'] this should work, verified xpathtester now, scala code looks like: import scala.xml._ val x = xml.loadfile("file.xml") val process = (x \\ "process[@type='input']") // return empty nodeseq() !!! the process ends empty, does't capture want. worked around this: val process = (x \\ "process" filter( _ \"@type" contains text("input"))

javascript - How to "glue" elements against the top of the screen -

Image
this question has answer here: my inline-block elements not lining properly 5 answers i have problem don't quite understand because it's counter know. so, (i thought that) knew elements placed top-left, , try cover space inline rightwards, downwards. but problem somehow html-divs glued bottom, behaving if positioning start @ bottom, moving rightwards. can explain me how so, , css properties change it? image shows 3 columns of rectangles + 1 logo, each column represents larger div (with css inline-block property make them appear left-to-right): i can give css + html, although it's going search through (i'm more trying give me general answer, don't have through code): button { width: 205px; height: 30px; font-size: 14px; font-weight: 500; } .bestillingstekst { font-weight: 500; } .question { fon

css - Combination of header - main_wrapper makes page scrollabe for header-height -

i'm making webpage fixed footer. if there lot of content, there must scroll bar. if there 1 line of input in content-part, there no need scroll. way page made now, gives me scroll bar time! scrolls far header disappears screen. --> header 150px high , can scroll 150px. don't want this. wrong html or css? this html: <body> <div id="header"> <h1>the <span>ultimate</span><br />dvd collection</h1> </div> <div id="main_wrapper"> <div id="main"> <div id="choose">#abcdefghijklmnopqrstuvwxyz</div> <div id="content">main content comes here.</div> </div> </div> <div id="footer"> <p>my name <span>admin log-in</span> </p> </div> here's css: html, body { height: 100%; margin: 0 auto; } body { font-family: helvetica, arial, sans-serif;

How do I execute maven plugin for parent module only? -

so created small maven plugin, connect database server , create tables need project. thing is, project consists of multiple modules , want plugin defined in parent one. yet needs executed once, not separately each module. thought adding "<inherited>false</inherited>" plugin configuration enough, apparently it's not. here's pom of parent project: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>rpg</groupid> <artifactid>rpg-build</artifactid> <version>0.0.1-snapshot</version> <packaging>pom</packaging> <name>rpg-build</name> <modules> <module>../rpg-web</module> <module>../rpg-service

javascript - Buffering and using large amounts of data in a web browser -

i building web app take json formatted data containing positional information on things, , play video. the data can considerably large (from 25mb 400mb). if building app using else i'd stream replay disk, far know i'm prevented doing (in cross-platform way) in browser. currently i'm parsing data (it downloads in chunks) json objects , storing in array, causing issues huge memory usage , can crash browser in cases. i'm looking way 'buffer' data on client , use needed, requirements being works on both latest stable firefox version , latest stable chrome version, both desktop. is there way?

android - Java help needed for a code like Autocorrect -

i writing program opposite of auto correct. logic user enters sentence, when button pressed, grammatical opposite of sentence entered user should displayed. able code. used matcher logic.but not able desired output. linking code question. can me please? imagebutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { string input = edittext.gettext().tostring(); string store = input; string store1 [] = store.split(" "); string correct[] = {"is","shall","this","can","will"}; string wrong [] = {"was","should","that","could","would"}; string output = ""; (int i=0;i<store1.length;i++) { for(int j=0;j<correct.length;j++){ if(store1[i].matches(correct

javascript - Semantic UI Popup not working inside angularjs directive -

just got problem, using semantic-ui show popup, not work if write code inside template reside in ng-view directive, work if write outside ng-view directive, wrong code? this works <body> <div class="ui container"> <div ng-view></div> <div class="ui teal button" data-title="using click events" data-content="clicked popups close if click away, not if click inside popup">click me</div> </div> <script> $('.ui.teal.button').popup({ on: 'click' }); </script> </body> this not work <!-- index.html --> <body> <div class="ui container"> <div ng-view></div> </div> </body> <!--sample.html --> <div class="ui teal button" data-title="using click events" data-content="clicked popups close if click away

How to define new primitive data type and its behavior in Scala -

is there way create new data type define number of bits , arithmetic rules in scala? have program uses 32 bit floats trying study how affect results. i want rewrite program addition , multiplication on fixed point (d.f) numbers , return fixed point numbers of same precision (d.f , not d1+d2.f1+f2). furthermore, want have saturation when there overflow, result sticks maxed value rather wrapping around. want truncate bits if there underflow. from understand, 8 bit number short, , decimal numbers floats , doubles. can somehow define data type in scala, or way regular float arithmetic , round nearest number can represented desired type? thanks you limited types jvm provides , supports unless go , hack jvm, or compile scala native code custom compiler settings. more reasonable approach achieve store numbers fractions. there libraries spire let that. spire can chose double or rational speed/precision trade off.

javascript - Angular Controller not saving Object data -

Image
code working fine till decided move login , registration form onto own partial, after login, redirect partials/dashboard.html user object data not accessible anymore. have console.logged in script.js check, object consoled cant access on dashboard.html index.html <!doctype html> <html ng-app='fullmean_app'> <!-- name & load ng app --> <head> <title>discussion board</title> <!-- require angular --> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"/></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-route.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/ngstorage/0.3.10/ngstorage.min.js"></script> <script src="/js/user_script.js"></script> <script src="/js/topic_script.js"></script> </head> <body