Posts

Showing posts from September, 2014

Grails controller scaffold default view not displaying the data in the controller -

i have created several controllers in grails project , put data each controller in bootstrap, data not appear in table each controller scaffold provides default view. have checked inside dbconsole data there, is. have refreshed dependencies make version of scaffolding plugin not corrupted. using grails 2.3.5 , scaffolding 2.0.1.are there suggestions of wrong? class departmentcontroller { static scaffold=department def index() { } } looking @ other examples of using scaffolding realize should have taken out index portion of code, though empty.

html - 100% height of window with inner div scrolling -

i've been banging head against wall hard past couple of hours figure out way achieve layout i'd webapp. , head hurts. basically need have full window layout (full width, full height, no scrolling - ever). 100% of width , height should covered using 2 different horizontal boxes (you can see them rows). the height of first box/row can variable (see header page) the 1 below should occupy what's left of space, without ever going further 100% of window, hence without ever showing scrollbar. now what's bit more tricky within second box/row, want content displayed inner vertical scrolling. imagine second box/row contains list of items, in case of few items, bottom part of box/row should stop right after content. in case of many items, box/row should expand right until hits 100% of window height (which 100% of windows - height occupied first box/row). rest of content should visible through scrolling within second box/row. am making sense? regarding code, i'

javascript - Regex for both newline and backslash for Replace function -

i using replace function escape characters (both newline , backslash) string. here code: var str = strelement.replace(/\\/\n/g, ""); i trying use regex, can add more special characters if needed. valid regex or can tell me doing wrong here? you're ending regex unescaped forward slash. want use set match individual characters. additionally might want add "\r" (carriage return) in "\n" (new line). this should work: var str = strelement.replace(/[\\\n\r]/g, "");

spring - urlrewriting tuckey using Tuckey -

my project (we have spring 3) needs rewrite urls form localhost:8888/testing/test.htm?param1=val1&paramn=valn to localhost:8888/nottestinganymore/test.htm?param1=val1&paramn=valn my current rule looks like: <from>^/testing/(.*/)?([a-z0-9]*.htm.*)$</from> <to type="passthrough">/nottestinganymore/$2</to> but query parameters being doubled, getting param1=val1,val1 , paramn=valn,valn...please help! stuff huge pain. to edit/add, have use-query-string=true on project , doubt can change that. the regular expression needs tweaking. tuckey uses java regular expression engine unless specified otherwise. hence best way deal write small test case confirm if regular expression correct. e.g. tweaked example of regular expression test case below. @test public void testregularexpression() { string regexp = "/testing/(.*)([a-z0-9]*.htm.*)$"; string url = "localhost:8888/testing/test.htm?param1=val1&par

separate values of a textbox and place it on an array in javascript -

i have textbox in user going input value want take , following. want able separate each word , add end of them. if put 123. want separate , make 1.jpg, 2,jpg 3.jpg after separated want put in array compare array , go there. here got far <input type="text" id="textfromuser" /> <script type = "text/javascript"> function validate(){ var lists = []; var validation = document.getelementbyid("textfromuser").value; lists.push(validation); for(var i=0; i<lists.length; i++) alert(lists[i]).split('.'); this part of code show value in textbox split , placed in array not working.. ideas? i think confusing arrays , strings, value obtain input string , you're afterwards adding lists array , iterating on array. may looking for html <input type="text" id="textfromuser" /> javascript function validate(){ // empty array var ar = []; // obtain string input "text" field,

android - Adding an imagebutton to a gridView -

i have gridview , want have imagebutton in gridview user can press create new view in gridview. i'd prefer not make gridview items have same onclick method (because adding drag-and-drop functionality use long click , because when this, if make gridview "clickable=true", still makes gridview items non-clickable) i'm wondering how can this. here xml gridview: <gridview android:id="@+id/gridview1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margintop="30dip" android:numcolumns="auto_fit" android:columnwidth="60dp" android:horizontalspacing="10dp" android:verticalspacing="10dp" android:gravity="center" android:stretchmode="columnwidth" android:clickable="true" > </gridview> and here custom adapter: package com.example.awesomefilebuilderwidget; imports public class gridviewadapter extends bas

php - Mini Amazon website builder needs help deciding what program and code to use -

i'm going create app function small version of amazon. have dreamweaver , adobe flash pro, products sufficient creating this? when open dreamweaver, gives me options html, coldfusion, php, css, javascript, ect. these , should use? if i'm using wrong program, there you'd recommend? my project: program idea enable user upload pics of property sale , allow people see them on website , purchase accordingly. going on small scale friends , local network. how should go setting up? need server storage or can rent server space? if so, provider this? also, got book called "a tour of c++", read me project? thanks in advance - comments beneficial, more get, more i'll learn , i'm excited feedback! thanks what need hire has sufficient expertise write need. it's clear way worded question out of depth this, , have not insubstantial amount of learning before undertaking project this. i mean no offence of above, think it's best "real wor

matlab - Name each variable differently in a loop -

i have created .dat file of file names. want read matlab each file in list , give data different name. currently, each iteration overwrites last one. i found lot of people give answer: for i=1:10 a{i} = 1:i; end however, isn't working problem. here's doing flist = fopen('fnames.dat'); % open list of file names nt = 0; % counter go 1 each file loaded while ~feof(flist) % while end of file has not been reached = 1:6 % number of filenames in .dat file % each file fname = fgetl(flist); % reads next line of list, name of next data file disp(fname); % stores name string in fname nt = nt+1; % time index % save data data{i} = read_mixed_csv(fname, '\t'); % reads in csv file% open file data{i} = data(2:end,:); % replace header row end end the code runs no errors, 1 data variable saved. my fnames.dat contains this: ia_2007_mda8_o3.csv in_2007_mda8_o3.csv mi_2007_mda8_o3.csv mn_2007_mda8_o3.csv oh_2007_mda8_o3.cs

Pass variable from applescript to executable bash file -

is possible pass variable applescript executable bash file? if so, how write executable bash file accept parameters? i'm going passing in dynamic filename appended file path in executable file. applescript... global set "test123.pdf" shell script "/users/matt/firstscript " & bash file... #!/bin/bash b64test=$( base64 /users/matt/documents/$1) echo $b64test | pbcopy echo $b64test > users/matt/base64 your applescript need like: global set "test123.pdf" shell script "/users/matt/firstscript " & then in script can refer parameters $1 , $2 , etc, or $@ of them. #!/bin/bash b64_test=$( base64 /users/matt/documents/$1) echo $b64_test | pbcopy echo $b64_test > /users/matt/base64 note not idea name bash variable test , name of shell builtin command. kinds of confusion can ensue. alternatively, should able without shell script: set quoted form of "/users/matt/documents/test123.pdf" she

Using xattr to set the Mac OSX quarantine property -

there lot of information on stackoverflow , elsewhere how clear mac quarantine property. in case set it. in order test app signed user hot "untrusted developer" warning after downloading it. my app particularly large (we distribute large file download site, not store) , not convenient have upload , download test this. have had battles code signing past week testing important me. once file has quarantine property see how can alter have values: 0002 = downloaded never opened (this 1 causes warning) 0022 = app aborted user warning dialogue (you hit 'cancel' in dialogue) 0062 = app opened (at least) once (you hit 'open' in dialogue) but don't know how give property in first place. the code isn't hard, need fsref's it, deprecated. said, still works on 10.9. have link coreservices. int main(int argc, const char * argv[]) { @autoreleasepool { if (argc != 2) { printf("quarantine <path>\n"); exit(1);

How to get DOMAIN name from SQL Server? -

i tried using exec sp_who2; gives host, users, etc. it's great need know sql server's domain name can install plugin sql server management studio. plugin dell product analyse server usage - "spotlight studio plugin" , runs service. thanks in t-sql, use query domain name of sql server: select default_domain()[domainname]

java - How to make sure the main thread continues only after child thread has started? -

i trying write program first ssh'es 2 different machines, , executes http requests against them. means in order able execute http requests ssh tunnel should running. what have done have 2 threads, each running ssh command 1 of boxes: thread thread1 = new thread(new runnable(){ public void run(){ try{ process p1 = runtime.getruntime().exec("ssh -a -l12345:localhost:54321 firsthost.com"); p1.waitfor(); }catch (exception e){} } }) ; thread1.start(); thread thread2 = new thread(new runnable(){ public void run(){ try{ process p2 = runtime.getruntime().exec("ssh -a -l12345:localhost:54321 secondhost.com"); p2.waitfor(); }catch (exception e){} } }) ; thread2.start(); now problem after starting threads, not start running, means send requests before connection mad

osx - How do I do something after the next NSView -layout has occurred? -

in response user event, want to: add new nsview window, , then show nspanel positioned below view i have each half of done. can add new subview, , container view's -updateconstraints identifies , adds correct layout constraints, next time layout performed, it's positioned correctly in window. also, have nswindowcontroller subclass puts panel on screen. unfortunately, there's ordering problem. panel's controller looks @ new nsview's frame property deciding put it, during iteration of main event loop, -layout method hasn't been called yet, it's still positioned @ (0,0). (if separate these 2 pieces of functionality, , require 2 separate user events "add view" , "create panel", panel correctly positioned below view.) is there way attach nspanel nsview, if layout constraint? or there way "do (window controller stuff), after next -layout call"? just call -layoutsubtreeifneeded on nsview’s superview ad

javascript - Website acts different on different browsers -

i working on website . has full screen video background , there other javascript coming . website : www.omod.biz/omoddemo the website behaves differently on different browsers. dont know how solve . currect version runss smoothly on chrome , ie . works poorly on firefox .however , not show on opera , safari in windows 8 pc . ihe website again runs smoothly on safari on macbook . i trying learn web development concepts on own , how 1 understand how different browsers react . , want make website run smoothly on browsers . should changes ? any type of appreciated. thank different browsers support different things. browsers support thing other browsers don't. in terms of css, make sure of properties have necessary prefixes. eg: property: value; -webkit-property: value; -moz-property: value; -o-property: value; also, browsers don't support properties. html, browsers support tags.

JSON file extension in android -

a little bit confusion regarding format of json many tutorial sites explaining json in android url extension .json sites explained without .json extension like androidhive example i confused point out json file in project whether make .json or without .json possible? created json file extension of xyz.com/xyz_json.php is doing wrong format? in 99% of library or tools use in android json, extension not important. avijit said, have refer file url (however extension). of time same thing in other linux based systems.

view - Android Sliding Menu: Menu takes entire screen and wont retract -

i having issue sliding menu ever reason takes full screen... have looked around , had people saying need set setbehindoffsetres or setbehindoffset work.. have still doesn't work.. main activity: package com.quapps.theinitiative; import com.jeremyfeinstein.slidingmenu.lib.slidingmenu; import com.jeremyfeinstein.slidingmenu.lib.app.slidingfragmentactivity; import com.quapps.theinitiative.r; import android.os.bundle; import android.app.activity; import android.view.menu; public class mainactivity extends slidingfragmentactivity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); setbehindcontentview(r.layout.menu_frame); slidingmenu menu = new slidingmenu(this); menu.setmode(slidingmenu.left); menu.settouchmodeabove(slidingmenu.touchmode_fullscreen); menu.setshadowwidthres(r.dimen.shadow_width); menu.setshadowdrawab

sql - What database design philosophy is being violated when one table references another table via a non-prime field? -

suppose have 2 tables. 1 of tables contains thousands of customers indexed surrogate key, , customer name field (which non-prime). table tracks purchases references customers name opposed corresponding surrogate key. if i'm trying justify why bad (as is), there nameable design philosophy that's being violated? since redundancy being created, intuitively you'd think tables somehow not normalized, since concerns relationship between 2 different tables it's hard me see how normalization applies. it not normalized in 3rd normal form. 3rd normal form required references done based on candidate key (i.e. unique key). in example, possible have multiple customers same name, means: you cannot enforce 1:1 relationship between 2 tables joins between 2 tables not perform unless index name column. if working on large database present problems end duplicate names (e.g. john smith).

iphone - Locking Orientation in Some Views? iOS 7 -

i have read countless answers , tried sooo many different things still cannot resolve problem. i'll explain in simple manner, first describing story board layout. my storyboard structure follows uitabbarcontroller uinavigationcontroller 1 uiviewcontoller 1 uiviewcontoller 2 uiviewcontoller 3 uinavigationcontroller 2 uiviewcontoller 4 uiviewcontoller 5 the above structure identical have. now, do; lock all uiviewcontrollers (including uitableviewcontrollers) cannot rotate landscape, except uiviewcontroller 3 , uiviewcontroller 5 (look @ structure above see ones are). these 2 view controllers able viewed in both landscape , portrait, if user clicks 'back' on navigation bar whilst in landscape view, view controller automatically rotate portrait. how able this? additional info: assume starting fresh slate , haven't written code try , solve problem. assume have not made class each view controller. thanks. maybe solution offered

c# - SharpZipLib to compress file -

i have made sharpziplib in xamarin android application takes file anywhere in system (user input) , compresses file according method called user(in application). class zipoutputstream has zip method compress file. but code in method doesn't seem sufficient necessary operation. can me suggesting else can done method compress file , place @ particular place in system? application code: string t; protected override void oncreate (bundle bundle) { base.oncreate (bundle); setcontentview (resource.layout.main); edittext text = findviewbyid<edittext>(resource.id.edittext1); t = text.tostring (); text.keypress += (object sender, view.keyeventargs e) => { e.handled = false; button button1 = findviewbyid<button> (resource.id.button1); button1.click += delegate { zipfile(); }; button button2 = findviewbyid<button> (resource.id.button2); button2.click += delegate { unzipfile(); }; }

php - Array with semicolon -

oke simple question $wew=array(111,222,333); print_r($wew); the output this array ( [0] => 111,222,333 ) but want this array ( [0] => 111, [1] => 222, [2] => 333 ) how ? print_r(array(111,222,333)); (your code minus array) print: array ( [0] => 111 [1] => 222 [2] => 333 ) so must have additional array. in order match first example it'd have be: print_r(array("111,222,333"));

grails google plus plugin -

is there example out there google plus oauth2 grails? see plugin on github documentation this 1 seems 2 years old , not find examples of using plugin. willing try this. want know if there other plugins out there up-to-date? i have had success using one: http://grails.org/plugin/spring-security-oauth-google , requires use of spring security oauth plugin: http://grails.org/plugin/spring-security-oauth

html - Viewport vs Percentage -

i using percentage when creating responsive designs , haven't used viewports yet. know when use viewport , when use percentage because looks similar me. fiddle example html <div class="percent">hello world</div> <br/> <div class="viewport">hello world</div> css div.percent{ width:100%; background-color:#09c; color:white; } div.viewport{ width:100vw; background-color:#09c; color:white; } percentages based on parent containers, viewport units consistent viewport. if have percentage on direct child of body they're off, since body has default margin.

javascript - what exactly is the DOM? and what is an object as taken from the DOM? -

i know bit of javascript , have started trying tie html code academy course. in following code: function sayhello(name){ document.getelementbyid("result").innerhtml = 'hello ' + name + '!'; } the "document" in above code dom? that mean getelements property (function) of document, , innerhtml function of getelements function.... right? if seeing correctly, how possible dom objects have javascript properties/functions? is document dom short answer yes, in sense root of it. slightly longer answer the document object model (dom) browser exposes javascript runtime allow javascript code manipulate page (its nodes , associated metadata). document 1 part of dom. how can dom have javascript properties short answer they don't. slightly longer answer the dom not managed in javascript (yet). typically managed separate engine altogether, written in lower-level language c++ or rust (in case of mozilla's servo

javascript - AJAX in Bootstrap dropdown not working -

i trying use ajax dynamically load html pages click of bootstrap dropdown, doesn't seem work. ideas? <ul class="dropdown-menu"> <li><a onclick = "$('#ajax').load('index.html');" href = "#">project 1</a></li> <li><a href="index.html">project 2</a></li> <li><a href="#2">project 3</a></li> <li class="divider"></li> </ul> and later create div ajax load in. <div class = "container"> <div class = "demo-row"> <div class = "col-xs-8" id="ajax"> </div> finally, ajax (on separate file). function loadajax(file) { $(document).ready(function() { //target div id of result //and load content specified url //and specified div element it: var filename = new string(file); var ending = " #ajax > *"

javascript - prepend using orderBy in angularjs -

as can see using push, item inserted last item in list, how can prepend it? http://jsfiddle.net/u3pvm/2875/ $scope.todos.push({text:$scope.todotext, done:false}); i'm confused 2nd argument in here : orderby : **'some_id'** : reverse some_id can var in js right? use unshift() method on array add item @ beginning $scope.todos.unshift({text:$scope.todotext, done:false}); about unshift: unshift() method adds 1 or more elements beginning of array , returns new length of array demo: jsfiddle demo source: unshift

javascript - Accept user input and multiply by 0.00000116414, copy results to clipboard -

this code pops asking users input, , multiplies 0.00000116414. i want change text input field , calc button, perhaps add ability copy clipboard. how might this? <html> <head> <meta name="recommended share difficulty calculator" content="[share dicciculty calculator]" /> <title>recommended share difficulty</title> <script type="text/javascript"> function maththing() { input = prompt("enter max kh/s.", ""); if (input==null || input=="") { return false; } share = 0.00000116414 ; total = input * share; alert(input + " * " + share + " = " + total); } </script> </head> <body> <a href="javascript:maththing()">calculate</a> </body> </html> in order manipulate contents of users clipboard need utilize flash. there great helper library called zeroclipboard . i've set basic demo (that uses javascript) uses jav

date - Converting the number of days in a month in Python? -

new python, , i'm writing program has user enter month (in terms of number, not word - e.g. "3" not "march"), , year (as in "2014"). want program display number of days in month entered , year. if user enters month 3 , year 2005, should display: march 2005 has 31 days. here's code: def enteredmonth(): month = int(input("enter month in terms of number: ")) return month def enteredyear(): year = int(input("enter year: ")) return int(year) def leapyear(year): if year % 4 == 0: return true else: return false def numberofdays(month): if enteredmonth() == 1: month = "january" print ("31") elif enteredmonth() == 2: month = "february" print ("28") elif enteredmonth() == 2 , leapyear() == true: month = "february" print ("29") elif enteredmonth() == 3: mont

gd - PHP Overlay Image, alpha is being lost -

Image
im trying overlay png onto jpeg, far works, reason pngs alpha not being used, can see has black background , should transparent. code: <?php header('content-type: image/jpeg'); $source_image = imagecreatefromjpeg("data/images/20140123/0/sexy-briana-evigan-gets-worked-up-and-wet.jpg"); $source_imagex = imagesx($source_image); $source_imagey = imagesy($source_image); $overlay_max_width = $source_imagex * 40 / 100; //resize overlay fit $overlay = imagecreatefrompng("overlay.png"); $overlay_imagex = imagesx($overlay); $overlay_imagey = imagesy($overlay); $ratio = $overlay_max_width / $overlay_imagex; $newwidth = $overlay_max_width; $newheight = $overlay_imagey * $ratio; //make new size $overlay_image = imagecreatetruecolor($newwidth,$newheight); imagecopyresized($overlay_image, $overlay, 0, 0, 0, 0, $newwidth, $newheight, $overlay_imagex, $overlay_imagey); imagecopymerge($source_image, $overlay_image,$source_imagex-$newwidth,$source_imagey-$newhe

winforms - C# ListView DragDrop Reordering not working -

im trying implement dragdrop of listviewitems re-order list. the list not re-order or move items expected. code private void lstmodules_dragdrop(object sender, drageventargs e) { if (e.data.getdatapresent(typeof(listviewitem))) { lstmodules.alignment = listviewalignment.default; if (lstmodules.selecteditems.count == 0) return; var p = lstmodules.pointtoclient(new system.drawing.point(e.x, e.y)); listviewitem movetonewposition = lstmodules.getitemat(p.x, p.y); if (movetonewposition == null) return; listviewitem droptonewposition = (e.data.getdata(typeof(listview.selectedlistviewitemcollection)) listview.selectedlistviewitemcollection)[0]; listviewitem clonetonew = (listviewitem)droptonewposition.clone(); int index = movetonewposition.index; lstmodules.items.remove(droptonewposition); lstmodules.i

python - Create 'rememeber me' feature in defult django login view -

i want add remember me checkbox login view. using 'django.contrib.auth.views.login' view login. tried putting 'session_cookie_age = 360' , checkbox named "remember_me" after reading related questions. but, didn't help. seems feature isn't there in default login view. or missing something? of course not in default login view. extend default login form. add remember me feature in extended form, , declare log in url this: url(r'^login/$', auth_views.login, {'template_name': 'your/login/template.html', 'form':yourextendedform}, name='auth_login'), also. there many remember me snippets , projects out there. googling , find working example in no time... : https://github.com/jimfmunro/django-remember-me alan

Learnstreet java lesson 3 part 8, reversing a string -

question asks reverse characters "mug" set string "gum" tried suggested "mug".charat(2) + "mug".charat(1) + "mug".charat(0) once input says incorrect your code results integer 329 , result of char plus char integer. to reverse string, may use stringbuilder or stringbuffer 's reverse method: new stringbuilder("mug").reverse().tostring() or new stringbuffer("mug").reverse().tostring()

dictionary - How Python dict stores key, value when collision occurs? -

this question has answer here: how can python dict have multiple keys same hash? 5 answers how python stores dict key, values when collision occurs in hash table? whats hash algorithm used hash value here? for "normal" python, this great writeup praveen gollakota explains well, here important bits: python dictionaries implemented hash tables. hash tables consist of slots, , keys mapped slots via hashing function. hash table implementations must allow hash collisions i.e. if 2 keys have same hash value, implementation of table must have strategy insert , retrieve key , value pairs unambiguously. python dict uses open addressing resolve hash collisions (see dictobject.c :296-297). in open addressing, hash collisions resolved probing (explained below) . the hash table contiguous block of memory (like array, can o(1) lookup index). each slot

java - How to get elements from Linked list using get method -

i developing radio streaming application in android , have url in linked list parsed content .pls file link , needed parse content url need elements linked list using get(position) method.can have suggestions here need help. here code snippet ,i want use url linked list player=mediaplayer.create(this,uri.parse("//url linked list")); i have parsed url .pls file link in linked list , need elements linked list linked list object linkedlist<string> urls; private linkedlist<string> fgetplayableurl( string mpls) { getstreamingurl ogetstreamingurl = new getstreamingurl(mainactivity.this); urls=new linkedlist<string>(); urls = ogetstreamingurl.getstreamingurl(mpls); return urls; } private void initializemediaplayer() throws ioexception { player = new mediaplayer(); //int ; /* (i=0;i<='\0';i++) { }*/ //url=urls.get(2).tostring(); try { player=med

c# - Properties in a particular order -

using reflection have tool gets properties of class: foreach (memberinfo member in typeof(t).getproperties(bindingflags.instance | bindingflags.public)) { writevalue(streamwriter, member.name); } is there way ask "getproperties" return memberinfo's in order defined in class. doubt it, thought i'd ask. class person { public int id { get; set; } public int age { get; set; } } i'd memberinfo's in order then: id, age [ caution: use @ own discresion these microsoft's impl details, may change in future releases] update : mono seems work too i've observed consitent behaviour using ms compilers since v3.5 when stumbled upon this: using system; using system.linq; using system.reflection; namespace consoleapplication1 { class program { static void main(string[] args) { typeof(test).getmembers(bindingflags.public | bindingflags.instance | bindingflags.declaredonly)

jquery - How to print canvas content using javascript -

Image
i using canvas writing purpose using jsp page. able write message on canvas, (canvas message have created..) after when want print canvas message using javascript print code not able print canvas content. below can see print preview that.. i want print canvas message have created on canvas. please me out problem, appreciate.. it can happen canvas cleared when dialogs show - happens typically in chrome browser. without having source code try didn't post i'll make theoretic answer can try out - suggest 2 possible solutions: add event handler resize . when triggered redraw content (which means need store points etc. draw or make off-screen canvas store copy). have experienced event triggers (in chrome) when dialog has cleared canvas - if works print preview not sure - if not try next point: when click print button, extract canvas image , replace (temporary) canvas element image element setting source data-uri canvas. on image's onload handler trigger

sql server 2008 - how to find in which table a particular data exist -

i have 5 tables follows ledproducts,electricalproduts, audioproducts, videoproducts , structure products. columns in each table follows materialname, partno,uom . want find in table particular partno exist. fastest way find? try this.... in query, give column name want in clause. show both column name , table name. select table_name, column_name information_schema.columns column_name = 'partno'

vb.net - How can I identify which dynamically added picturebox is currently selected during mouseenter -

i dynamically created 5 picture box , added events mouseenter , mouseleave, problem when hover cursor on 1 of picture box, other trigger event private sub form_test_load(sender object, e eventargs) handles mybase.load dim imgselect picturebox dim x integer = 1 while not x = 5 imgselect = new picturebox imgselect.name = "image0" & x.tostring imgselect.backcolor = color.black imgselect.size = new size(203, 312) imgselect.borderstyle = borderstyle.fixedsingle imgselect.visible = true imgselect.bringtofront() imgselect.sizemode = pictureboxsizemode.stretchimage flowlayoutpanel1.controls.add(imgselect) x += 1 addhandler imgselect.mouseenter, addressof imgselect_mouseenter addhandler imgselect.mouseleave, addressof imgselect_mouseleave end while end sub in mouse enter event handler, can ui control trigger event sender parameter : private sub

mysql - How to use my horizontal query result to another SQL query -

i need use horizontal query result sql query. how it, please help. suppose have 2 tables: tab1: ________________________________________ |id | arid | seq1 | seq2 | seq3 | seq4 | |___|______|______|______|______|______| |a1 | ar01 | | c | b | d | |a2 | ar02 | c | d | | b | |___|______|______|______|______|______| tab2: _____________________ |arid | seqn | code | |_____|______|______| |ar01 | | 1 | |ar01 | g | 4 | |ar01 | b | 2 | |ar01 | d | 3 | |ar01 | c | 8 | |ar01 | f | 6 | |ar01 | e | 5 | |ar01 | h | 7 | |ar02 | | 1 | |ar02 | h | 8 | |_____|______|______| well need result this: resulttab: _____________________ |arid | seqn | code | |_____|______|______| |ar01 | | 1 | |ar01 | c | 8 | |ar01 | b | 2 | |ar01 | d | 3 | |_____|______|______| it fetch seq1 , seq2 , seq3 , seq4 arid tab1 , return mapped values tab2 arid . please me. thank you... please use

php - Mysql import error in various methods -

Image
i wanted launch remote site localhost development purpose. remote site running under mysql/mangento. i tied various methods import database backup new database @ localhost, shows error via phpmyadmin, mysql said: documentation #1367 - illegal double '1.79769313486232e+308' value found during parsing from command prompt "error 1367 (22007) @ line 10543: illegal double '1.79769313486232e+308' value found during parsing" attaching screenshot reference. your error better described here: [mysql] http://bugs.mysql.com/bug.php?id=44995 and solution replace 1.79769313486232e+308 \'1.79769313486232e+308\'.

csv - How to replace a string with another string in a column in R? -

i have csv file like data.csv id,name,city 23,radu,los angeles 34,tree,chicago rtet,great,miami rtet,francis,paris where record <- read.csv("data.csv",header=true); identity <- record$id i used gsub("rtet","67",identity) but not work. how replace "rtet" in csv file "67" in r? new r.any appreciated. record$id<-gsub("rtet","67",record$id) works me...

c# - How to add controls into a new tab page which is dynamically created? -

Image
i developing windows form application in c# has tab control dynamically created tab pages. want add same layout , controls (comboboxes, textboxes, buttons & datagridview) comboset item 1 newly created tab page ( comboset item 2 in case). how can , how name controls? new tabs generated 1,2,3... n . 'n' number of datagridviews added under new tabs. there way bind these datagridviews , possible so? any appreciated! create new user control->place controls user control->create properties controls. have manage user control. void addtab() { tabpage tbp = new tabpage(); tbp.name=tabcontrol1.tabpages.count.tostring(); myusercontrol cnt = new myusercontrol(); cnt.name="cnt" + tbp.name; cnt.dock=dockstyle.fill; tbp.controls.add(cnt); } if cannot place code user control can create events each control. example productname_selectedvaluechange productname combobox, validating discount value , handle addtab() method.

sql - ASP.NET MVC Multi tenant Application using Single DB Multiple Schema : Calling Store Procedures from the application tries to access dbo tables -

i developing multi tenant application using asp.net mvc, sql server, dapper single db , multiple schema each tenant. tenant assigned db user owns tenant schema. have set of tables in dbo , set shared schema. say have dbo.tenant , anyschema.table1 . application connection string set anyschema user, if call select * table1 returns values anyschema.table1 . if have same query in store procedure, throws error tries access dbo.table1 . i have provided execute access dbo tenant db user single sp being shared tenant @ dbo.sp_name how can execute store procedure logged in tenant db user, accessing table1 of anyschema single sp can used tenants. assume have 2 users in our database tenant1 , tenant2 own schemas (also called tenant1 , tenant2 ). we create contacts table each tenant have tenant1.contacts , tenant2.contacts . within our application execute following sql using dapper. using tenant specific connection string uses tenant's sql server login details.

asp.net - SQL Get Rows With A Similar Column Value -

i have database stores duplicate rows, duplicate not clear cut, e.g. following 2 column values duplicate: g12345 & g1234 --> because similar (a string comparison shows characters match 83.3%). i need writing sql query retrieve values similar string sent part of query, e.g. on 50% of characters matched. can this? have c# method follows not quite sure how accomplish in sql: static double stringcompare(string a, string b) { if (a == b) //same string, no iteration needed. return 100; if ((a.length == 0) || (b.length == 0)) //one empty, second not { return 0; } var maxlen = a.length > b.length ? a.length : b.length; var minlen = a.length < b.length ? a.length : b.length; var samecharatindex = 0; (var = 0; < minlen; i++) //compare char char { if (a[i] == b[i]) { samecharatindex++; } } return samecharatindex / maxlen * 100; } thanks in advance. not sure if trying use sql-server or mysql, create , use foll

asp.net - Using 'UpdatePanel' still takes my page to the top where there is a slideshow -

i have slideshow @ top of page , form @ bottom. image in slideshow changes,it takes me top of page. can't fill form or @ bottom. looks keeps posting page again, have taken necessary actions avoid that. here controls: <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:timer id="timer1" runat="server" interval="3000" ontick="timer1_tick"> </asp:timer> <asp:image id="image1" height="388px" width="936px" runat="server" /> </contenttemplate> </asp:updatepanel> and here code-behind: protected void timer1_tick(object sender, eventargs e) { setimageurl(); } private void setimageurl(

image - Searching for an implementation for AdOtsu Binarization Method -

i studying binarization methods historical documents. found theory of adotsu , didn't find code it. can me. about algorithm.. http://ebookbrowsee.net/gdoc.php?id=450483567&url=4734b25ed24c4168aceeee1e05dfbb99&c=450483567

java - Vaadin caption invisible in IE -

Image
i got problem display caption of components setenabled false - caption example not visible or white: i don't have problem in firefox. example above: created class extends formlayout , put components textfield, checkbox, whole panel setenabled(false/true). how can make caption visible in ie? the solution ie set custom css style .v-disabled { opacity: black !important; efilter: alpha(opacity=80); }

c# - Xsd schema generation - type 'string' is not declared, or is not a simple type -

i creating xml schema using schema object model, on step "set.compile()", above mentioned error. guess related base type name of simpletype elements, help! is there method, can see giong in while set.compile() method compiles code?? xmlschemasimpletype namesimpletype = new xmlschemasimpletype(); xmlschemasimpletyperestriction res = new xmlschemasimpletyperestriction(); res.basetypename = new xmlqualifiedname("string",""); xmlschemaminlengthfacet facet1 = new xmlschemaminlengthfacet(); facet1.value = "3"; xmlschemamaxlengthfacet facet2 = new xmlschemamaxlengthfacet(); facet2.value = "10"; res.facets.add(facet1); res.facets.add(facet2); namesimpletype.content = res; xmlschemasimpletype phonetype = new xmlschemasimpletype(); xmlschemasimpletyperestriction phone_res = new xmlschemasimpletyperestriction(); phone_res.basetypename

javascript - Links within refreshing div not working -

Image
i'm following example below continuously refresh div mysql table. http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery i'm using complete , timeout parameter of ajax refresh div instead of using setinterval , settimeout. the problem i'm having returning data can include links , these not working when clicked. believe problem div refreshing , click ignored. how allow links within refreshing div? works setinveral , settimeout want use long polling allow real time updates. here code. // page url variables function geturlvars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } // set var parent id scroll var tid = geturlvars()["tid"]; var pid = geturlvars()["pid"]; (function poll(){ // latest page $.ajax({ url: "ajax.tickets_details.php?tid=" + t

How to git grep only a set of file extentions -

how perform git grep , limit files checked set of files. able grep contents of .cpp , .h files looking myfunc. eg: git grep "myfunc" -- *.[hc]* however matches, .c files , .cs files. use: git grep "myfunc" -- '*.cpp' '*.h' the quotes necessary git expands wildcards rather shell. if omit them, it'll search files in current directory, rather including subdirectories.

Sort two Laravel objects in the correct order -

i have 2 eloquent objects want "merge" speak. i dont know if merging best approach please come suggestions. $customer = customer::find($customerid); $events = $customer->events()->unfinished()->orderby('created_at', 'asc')->get(); $notes = $customer->notes()->orderby('created_at', 'asc')->get(); events() hasmany = $customer->hasmany('events'); unfinished() scope = $query->where('status', '=', '0'); notes() hasmany = $customer->hasmany('notes'); i want merge $events , $notes can loop through these created_at falling correct order. lets $notes contains 2 posts: note 1 created_at: 2013-01-30 00:00:00 note 2 created_at: 2014-12-31 00:00:00 and $events contains 2 posts: event 1 created_at: 2014-02-01 00:00:00 event 2 created_at: 2014-01-02 00:00:00 i want them falling this: event 1 created_at: 2014-02-01 00:00:00 note 1 crea

actionscript 3 - How permanently access the microphone in IOS id user deny the allowing in AIR application? -

how access microphone in ios id user deny allowing in air application ? i using air 3.8. when run in debug mode on device prompts flash debug requires microphone access. and how mic if user deny access on prompt ? you can't. that's entire point of prompt — give user choice in whether app can access potentially invade privacy or harm system. there no point in prompt if override it. adobe real big on these kinds of security tasks (after macromedia relatively lax) , apple stricter. if user says no, means no. there absolutely no way around it.

php - Using Sqlite in a web application -

i'm developping application allows doctors dinamically generate invoices. fact is, each doctors requires 6 differents database tables, , there 50 doctors connected @ same time , working database (writing , reading) @ same time. what wanted know if construction of application fits. each doctors, create personnal sqlite3 database (all database secure) him can connect to. i'll have 200 sqlite database, there problems ? thought better using big mysql database everyone. is solution viable ? have problems deal ? never did such application many users, thought best solution firstly, answer question: no, not have significant problems if single sqlite database used 1 person (user) @ time. if highly value edge cases, ability move users/databases server, might solution. but not terribly design. usual way have data in same database, , tables having field identifies rows belong users. application code responsible maintaining security (i.e. not let users see data doesn'

audio - python install snack package -

i have problem installing snack. have windows 7 , python 2.7.6. when istall it, output: c:\python27\lib\site-packages>setup.py install running install running build running build_py creating build creating build\lib copying tksnack.py -> build\lib running install_lib running install_egg_info removing c:\python27\lib\site-packages\tksnack-2.2.10-py2.7.egg-info writing c:\python27\lib\site-packages\tksnack-2.2.10-py2.7.egg-info but when run program snack, error: traceback (most recent call last): file "c:\python27\projekty\speech.py", line 1, in <module> snack import * importerror: no module named snack is there solution? thank you you need install newt or snack in windows. not python binding library.

android - Qt5.2.1 get GPS location on Samsung Galaxy S2Plus (I9105P) -

i trying gps coordinates using qt5.2.1 on samsung galaxy s2 plus. tried: calling qgeopositioninfosource::availablesources() returns empty list. i tried qgeopositioninfosource::createdefaultsource() , returns null pointer. i have set permissions in androidmanifest.xml, qtcreator: android.permission.access_coarse_location android.permission.access_fine_location i tried qnmeapositioninfosource class, have call setdevice() method setting qiodevice, don't know can device. there "/dev/bcm_gps" accessing nmea gps coordinates ? note: trying on samsung galaxy s2 plus, cyanogenmode11 (android 4.4.2), baseband i9105pxxumbi, kernel 3.0.101. other gps applications works ok, it's not cyanogen bug. here complete sources. it's minimal project getting gps coordinates , display them in textedit. don't i'm doing wrong. here .pro file: #------------------------------------------------- # # project created qtcreator 2014-02-05t15:48:22 # #---------------