Posts

Showing posts from August, 2015

Action filters to supply common data to Views in ASP.NET MVC 4 -

i'm trying common properties views derive viewmodelbase . except ran sort of catch-22... the common properties of viewmodelbase are: user , environment (there more, question these 2 suffice). right now, have global filter assigns these 2 properties - viewmodelbase.user property assigned basecontroller.user , assigned authorization filter. it works in cases, this: authorization filter times based on business logic decides redirect user "not yet approved" page. done so: var notapprovedview = new viewresult(); notapprovedview.viewname = "notyetapproved"; filtercontext.result = notapprovedview; except, in case, viewmodel not yet have common property supposed assigned global filter, results in run-time exception. what's proper (i.e. best practice, not hack) way deal situation need common properties assigned , of common properties may change depending on authorization? thanks. i think may have missed forest trees on one... sorry. i

c# - Two views for one controller -

i have view page lists users gallery image want create view page lists users name. want use 1 controller both of them , created listview page , in orginial view page shows users image - have link view listview page. tried clicking on link page not showing up. here have: image view page <h2>users</h2> <div> <a href="~/views/users/listview">click here list view</a> </div> <section id="images"> <section id="users" data-bind="foreach: users"> <div id="nameimage"> <figure id="content"> <img width="158" height="158" alt="gravatar" data-bind="attr:{src: gravatarurl}"/> <figcaption> ... </figcaption> </figure> <p data-bind="text:name"></p> </div>

css - IE8 and IE9 ignores padding of submit button -

somehow ie8 , ie9 ignoring padding settings submit button. weird thing ie8 , ie9 apply padding regular button <a class="btn" href="#">foo<a> but not for <input type="submit"> how possible? i've read adding overflow:visible doesn't work. this css i'm using: display: inline-block; color: #fff; text-decoration: none; background: #74ad38; padding: 10px 20px; -webkit-box-shadow: 0px 6px 0px rgba(99, 148, 48, 1); -moz-box-shadow: 0px 6px 0px rgba(99, 148, 48, 1); box-shadow: 0px 6px 0px rgba(99, 148, 48, 1); border-radius: 5px; border: none; transition: background 0.25s; -moz-transition: background 0.25s; -webkit-transition: background 0.25s; -ms-transition: background 0.25s; -o-transition: background 0.25s; any appreciated.

PHP code submitting to MySQL isn't working -

i have been tying figure out wrong long time, cannot figure out. have been trying connect local mysql database. when run this, no error thrown. also, know database , table exist, , know username , password correct. <?php // connects database $con = mysqli_connect("localhost", "**my_username**", "**my_password**", "gamesite_data") or die(mysql_error()); $username = $_post["username"]; $password = $_post["password"]; $first_name = $_post["first_name"]; $last_name = $_post["last_name"]; $age = $_post["age"]; mysqli_query($con, "insert information (`username`, `password`, `first_name`, `last_name`, `age`) values ($username, $password, $firstname, $last_name, $age);" ); ?> <?php mysqli_close($con) ?> if values of username, password, first_name, last_name strings, have surround them single quotes here: mysqli_query($con, "insert information (`username`, `

css3 - select box creating unknown spacing with custom fonts -

i'm using custom font-face loading fine within ie8. however, select boxes produces random (unecessary spacing) @ top of selected child element. i've been doing research portion of day, however, i'm unable find cause , fix why ie producing excess spacing causing option clipped. any ideas? please view in internet explorer 8: https://give.massgeneral.org/bootstrap/sslpage.aspx?pid=2045

php - FB batch request : get Profil Images of managed Pages -

hi there tried profile-images of pages managed. tried this: // loop: $request[] = array( 'method' => 'post', 'relative_url' => '/'.$account->id.'/?fields=picture.type(large)&access_token='.$account->access_token.'' ); and then: $batchresponse = $this->facebook->api('?batch='.json_encode($request),'post',array('access_token' => $this->facebook->getaccesstoken())); without success :/ i tried set access_token of page in body tag: $request[] = array( 'method' => 'post', 'relative_url' => '/'.$account->id.'/?fields=picture.type(large)' 'body' => '&access_token='.$account->access_token.'' ; your php script should have login . if login successful, sdk manage access_token you. then issue 1 request: $

c - Optimal array push -

i wanna create function taking 2 parameters: int element, , input array. want function place element parameter @ first place in array, enlarge array single index, , place input array after pushed element. to illustrate this, let's input array {1, 2, 3}, , element passed parameter 5. output should {5, 1, 2, 3}. how can optimally? i came out function: void push(int el, int **arr) { int *arr_temp = *arr; *arr = null; *arr = (int*) malloc(sizeof(int)*(n - 1)); (*arr)[0] = el; for(int = 0; < (int)n - 1; i++) { (*arr)[i + 1] = arr_temp[i]; } } it works, well, it's not fastest function wrote, , slows down whole program. there better way this? my guess doing (*arr)[1] = arr_temp , didn't work, , i'm not sure if there's possibility in c this. instead of using raw array, it'd better wrap array in struct : typedef struct { size_t elementsallocated; size_t elementsused; int* buffer; } vector;

arrays - Merge subarrays of different lengths PHP -

i have dynamically built array looks so: array(2) { [0]=> array(2) { [0]=> array(1) { ["rhid"]=> string(6) "169135" } [1]=> array(1) { ["rhid"]=> string(6) "168917" } } [1]=> array(2) { [0]=> array(1) { ["rhid"]=> string(6) "172168" } [1]=> array(123) { ["rhid"]=> string(6) "171169" } [3]=> array(123) { ["rhid"]=> string(6) "171129" } [3]=> array(1) { [0]=> array(1) { ["rhid"]=> string(6) "172768" } } but instead combine subarrays so: array(1) { [0]=> array(4) { [0]=> array(1) { ["rhid"]=> string(6) "169135" } [1]=> array(1) { ["rhid"]=> string(6) "168917" }

mysql - PHP - Search array for string -

i have page form post checkboxes 1 array in database. values in database looks this: "0,12,0,15,58,0,16". i'm listing these numbers , works fine, don't want 0 values listed on page, how able search through array , not list 0 values ? i'm exploding array , using each loop display values @ moment. the proper thing insert statement database query: select * table value != 0 however, if limited php use below code :) foreach($values $key => $value) { //skip value if 0 if($value == 0) { continue; } //do other values }

html - Inline images and stacking -

i'm not sure what's wrong code holder page. breaking format , i'm sure has inline-block , clearing boxes. could steer me in right direction? i've not made page entirely images before. this line saying it's 127px high when rendered - image 121px. <a class="imageleft" href="#"><img src="images/4.jpg" width="76" height="121"></a> can see i've missed here? site: http://michaelbirchall.com/etc/dvd-page/ thanks in advance. the problem there's inherited font-size . it's affecting bottom row of images too, it's not noticeable since there aren't other images below it. since page images, setting 0 should okay. http://jsfiddle.net/2zvvx/6/ css * { margin: 0; padding: 0; font-size: 0; }

c# - Can I run windows phone 8 on windows 8 RT and vice versa? -

can run rt apps on windows phone, or windows 8 phone apps on windows 8 rt or pro? if need develop app run on rt tablets , on windows 8 phones, should do? edit when microsoft provide unified way develop apps???? am requested develop tons of apps run on of microsoft platforms, not apple fan @ all, microsoft should learn more , more them, spent , spending of time chasing microsoft techniques, very annoying!!! :( no, but can share code through use of portable class libraries or linked files. i wrote 2 articles how achieve this: the first 1 whether choose pcl's or linked files: http://www.kenneth-truyers.net/2013/03/27/portable-class-libraries-or-source-code-sharing/ the second 1 how work around limitations of pcl's: http://www.kenneth-truyers.net/2013/02/24/patterns-for-sharing-code-in-windows-phone-and-windows-8-applications/

Android: Animating changes to GridView content -

i have gridview of layouts can dynamically added or removed grid. in ios, native behavior gridview items other items in grid slide place of removed item, or slide make room when new item added. however on android behavior changes instantly pop in on screen. tried adding custom animations each getview() call using tricks in gridview's adapter, ended causing problems seen here: android gridview loading 0 indexed item in later index's slot when data set changes i tried having individual views control animation instead of getview() method of adapter, end result identical. i tried using gridlayoutanimationcontroller, this: animation animation = animationutils.loadanimation(mactivity, r.anim.grid_item_fadein); gridlayoutanimationcontroller controller = new gridlayoutanimationcontroller(animation, .2f, .2f); mgrid.setlayoutanimation(controller); this works on initial load of gridview content, changes content instantly pop in default. i feel pretty simple feature, ,

html5 - jQuery: Open/request Fullscreen browser on load? -

i have page div #container have go full screen mode (or @ least request go full screen mode) on supported browsers. i downloaded this plugin and although example show using button enter fullscreen, i'd on load. tried: $(window).load(function() { if($.support.fullscreen){ $('#container').fullscreen(); } }); it passes support test (chrome 28) nothing happens. missing? it seem, after further research, fullscreen api can only activated via user interaction security reasons. if knows otherwise, please feel free post.

python - Vectorizing Photos: Finding an Adapted Algorithm -

as little project, i've decided want write small raster vector converter. lots , lots of resources available online, many fewer actual implementations can give me kind of starting point. haven't decided language i'm going in, python seems pretty adapted. the first issue papers directed @ vectorizing either logos or grayscale images, neither of i'm interested in. potrace , algorithm described here , 1 of libraries. same techniques applicable photo bitmaps ? i discouraged findings until stumbled upon vector magic . results astonishing ! however, don't provide information concerning algorithm. method produces similar quality results described here: http://eprints.gla.ac.uk/47879/1/id47879.pdf . strategy remove contours , process them, before drawing them vectors. but there no mention of how this. can extract contours opencv, ? have trouble understanding creation of vector, or happens after contour extraction. so, conclude, here questions: language or libra

php - Join query shows results based only on one match -

so here query select `c`.`location`, `c`.`id`, `c`.`user_id`, `c`.`date`, `c`.`attachment`, `ud`.`first_name`, `ud`.`last_name`, `a`.`file_name`, `a`.`folder_name`, `a`.`server_key`, `a`.`type` `content` `c` inner join `users_details` `ud` on ud.user_id = c.user_id inner join `attachments` `a` on c.id = a.content_id (c.location = 'new york') i'm looking include in results data attachments table, problem not data row table content has attachment, if post has attachments saves in content table in row attachment 1, , 0 if doesn't have attachment. now problem query displays data has attachments, guess problem comes join attachments table. so how can have following output: kinda merge data show posts have uploads , don't , show data attachments table have uploads. kinda this: [0] => array(11) { ["location"] => string(15) "new york" ["id"] => string(2) "25" ["user_id"] => string(1

javascript - jQuery Waypoints Plugin -

how you? im using waypoints plugin sticky elements scroll down page. however have sticky remove @ position of page, lets 30px starting scroll point , when user scrolls page, sticky elements takes , original starting point: javascript: $(function() { // our dom lookups beforehand var nav_container = $(".nav-container"); var nav = $("nav"); nav_container.waypoint({ handler: function(event, direction) { nav.toggleclass('sticky', direction=='down'); if (direction == 'down') nav_container.css({ 'height':nav.outerheight() }); else nav_container.css({ 'height':'auto' }); }, offset: 15 }); }); another example can @ found online here http://webdesigntutsplus.s3.amazonaws.com/tuts/313_waypoints/demo/index.html lets want sticky nav dropped off @ chapter 1 im scrolling down when i'm scrolling gets picked , carry starting point.

Java Dynamic arrays -

i taking programming class java , need dynamic arrays. have looked around , can't find ways on level of simplicity. not far in class , learned basics don't know need know how make dynamic array. here 2 sample programs given: public class dynamicarrayofint { private int[] data; public dynamicarrayofint() { data = new int[1]; } public int get(int position) { if (position >= data.length) return 0; else return data[position]; } public void put(int position, int value) { if (position >= data.length) { int newsize = 2 * data.length; if (position >= newsize) newsize = 2 * position; int[] newdata = new int[newsize]; system.arraycopy(data, 0, newdata, data.length); data = newdata; system.out.println("size of dynamic array increased " + newsize); } data[p

Create a view with column num_rows - MySQL -

i need create view has column named row_num inserted row number, auto increment in normal table. i'm new views please bare me. let's i've normal table: | country | name | age | price | -------------------------------- | | john | 22 | 20 | | france | anne | 10 | 15 | | sweden | alex | 49 | 10 | and on... the view want create is: | country | name | price | row_num | ------------------------------------ | | john | 20 | 1 | | france | anne | 10 | 2 | | sweden | alex | 5 | 3 | and on... i can generate row_num single select: select @i:=@i+1 row_num, testing.country, testing.name, testing.price testing testing,(select @i:=0) derivedtable order name but problem combine query above query creating view. combined query i'm trying: create or replace view vwx (country, name, price, num_row) select mytable.country, mytable.name, mytable.price, @i:=@i+1 row_number testing testing,(sel

asp.net - C# Multiple Inheritance with Interfaces -

public interface ia { void dosomething(); void calculate(); } public interface ib { void dosomethingelse(); void calculate(); } public class : ia { void dosomething() { } void calculate() {} } public class b : ib { void dosomethingelse() { } void calculate() {} } public class c : ia, ib { //how can implement calculate() in class b , dosomething() in class a? } how can avoid duplicate code in class c. reference: how simulate multiple inheritance in c# . don't want write full methods again in class c. help. assuming ia.calculate() not same ib.calculate() , therefore can't make ib inherit ia , can implement both interfaces in c delegating execution on private instances of a , b : public class c : ia, ib { private _a; private b _b; public c() { this._a = new a(); this._b = new b(); } public void dosomething() { this._a.dosomething(); } void ia.calculate() { th

java - ClipDrawable not working when used as layout background for widget -

i'm attempting make simple widget displays battery percentage both textually , graphically in widget. textual part works without problem, i'm having great difficulty getting widget graphically update. graphically, have battery image clip according battery percentage. i'm attempting use clipdrawable this. battery_widget_layout.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widgetlayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:padding="@dimen/widget_padding" android:background="@drawable/battery_clip_layer" > <textview android:id="@+id/batterypercentagewidgettextview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/battery_percentag

iphone - iOS NSMutableArray sticking -

i'm trying populate uitableview array contains files in directory //in header @property (strong, nonatomic) nsmutablearray *files; //in tableview:cellforrow:atindexpath: static nsstring *cellid = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellid]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellid]; cell.textlabel.text = [_files objectatindex:indexpath.row]; } return cell; ( _files set equal [[nsfilemanager defaultmanager] contentsofdirectoryatpath:[self downloadsdir]; prior method being called) works, , shows correct files. problem if add file directory, , use tableview reloaddata , new file added, title duplicate of file. example table view before adding file ++++++++++++++++++++++++++ text.txt ++++++++++++++++++++++++++ testing.txt ++++++++++++++++++++++++++ table view after adding file othertest.txt ++++++++++++++++++++++++++ text.txt +++++++

How to tell C++ to use a different function (with the same name as another function)? -

i have 2 libraries included in program both have same function name, need able use both, need c++ know 1 i'm referring (in places referring 1 or other). reason why i'm doing because making own library , want have names functions, conflicting functions in else's library i've included, , make matters worse, of functions in library use functions in other persons library has same name. my library .h/.cpp file way. also, when calling functions, don't want luggage such mynamespace::myfunc(). want call myfunc(). however, don't mind calling other persons function using namespace (though don't want modify library in case break something). (i'm new c++ btw) heres new (test - far) code : not working w/ errors: error c2668: 'myfunc' : ambiguous call overloaded function main program.cpp #include "otherslib.h" #include "mylib.h" #include <iostream> using namespace mynamespace; int main(){ std

ASP.NET MVC - Model's metadata used from model object type instead of declared model of the View -

Image
i have interface of model declared, class implementing it: public interface imymodel { [range(1, 1000)] [display(name = "modelprop interface")] int myintproperty { get; set; } imysubmodel submodel { get; } } public interface imysubmodel { [range(1,1000)] [display(name = "submodelprop interface")] int myintsubproperty { get; set; } } i have model implementation, different metadata: public class mymodelimplementation:imymodel { [display(name = "modelprop class")] [range(1, 15)] public int myintproperty { get; set; } public imysubmodel submodel { get; set; } public mymodelimplementation() { submodel = new mysubmodelimplementation(); } } public class mysubmodelimplementation: imysubmodel { [display(name = "submodelprop class")] [range(1, 15)] public int myintsubproperty { get; set; } } i have view, use model interf

javascript - How to get non english words in Java? -

i passing இயற்பியல் in subject name javascript java, while using alert in javascript. alert(subject name); இயற்பியல் shown, whereas if value of subject name using string subname=request.getparameter("subject name").tostring; ..it's not returning. don't put spaces in url arguments. if want pass subject name, use "&subjectname="+encodeuricomponent(yoursubjectnamevar) , , make sure unpack in java well, because it'll %e0%ae%87%e0%ae%af%e0%ae%b1%e0%af%8d%e0%ae%aa%e0%ae%bf%e0%ae%af%e0%ae%b2%e0%af%8d

Autocomplete google map api use to find postal code only by addresspicker -

i want search postal code using address,city etc auto complete google api . using code .it providing location , place details need postal ,if there suggestion please provide. <!doctype html> <html> <head> <link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes /base/jquery-ui.css" rel="stylesheet" type="text/css" /> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"> </script> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false"></script> <script src="http://xilinus.com/jquery-addresspicker/src/jquery.ui.addresspicker.js"> </script> <meta charset=utf-8 /> <title>js bi

twitter bootstrap - deeply nested content_tag, concat and rails 3 -

i'm frustrated using rails 3.2 , making helper bootstrap modals. don't understand when need concat versus when don't end tags missing , end hash options between before , ending tags. when use concat on content-tag do-end hell breaks loose. want replicate html: <div id="stupid_modal" class="modal hide fade" tabindex="-1" data-width="760"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fontello-icon-cancel-1"></i></button> <h4>modal header</h4> </div> <div class="modal-body"> <div class="page-header"> <p>test header 1 2 3.</p> </div> <div class="row-fluid"> content here... blah blah </div> <

jquery - Phonegap AJAX call fails -

i'm trying simple phonegap app communicate server. this javascript: <script src="js/jquery.min.js" ></script> <script> $.ajax({ url: 'http://www.drimmit.com/test', datatype: 'jsonp', jsonp: 'jsoncallback', timeout: 5000, success: function(data, status){ //data loaded alert(data); }, error: function(){ //error loading data alert('no data'); } }); </script> i've whitelisted domain in config.xml: <access origin="http://www.drimmit.com" subdomains="true"/> on server, i'm doing simple echo statement. <?php header('content-type: application/json'); echo 'hello server'; ?> in end, popup (ios) saying "no data", meaning failed. you have mentioned reques

mysql - JBOSS connectivity with mulltiple database (sql cluster) -

i want connect jboss multiple databases (with failover recovery , loadbalancing) i.e. connection switches 1 db other in case of failure of first db connection. also each db connection has seperate set of userid , password. i have done 1st part still stuck in second part. how do ? any appreciated. thanks. that's not how should done. should done there 1 frontend instance server (here jboss) connects to, , sends actual connection whichever db instance sees fit. the details on how implement depend on server used. since tagged question mysql, might interested in this tutorial on how set such thing that. if insist on doing way, don't see how example load balancing work. how jboss know server has more load? how know when should activate failover? if have answers questions already, indicated in question, there's nothing preventing creating regular datasources different userids , passwords pointing different databases. think that's inherently wrong w

android - whole viewgroup to bitmap -

is possible full bitmap viewgroup-object? this code takes 'screenshot' off view group that's on screen, want whole view, what's not on screen. public void export(viewgroup view){ view.setdrawingcacheenabled(true); view.setdrawingcachequality(view.drawing_cache_quality_high); bitmap bitmap = view.getdrawingcache(true); } here used scrollview whole view bitmap here u can use instead of scrollview anyother view group linerlayout etc.. bitmap map = loadbitmapfromview(getapplicationcontext(),scrollview); bytearrayoutputstream bytes = new bytearrayoutputstream(); map.compress(bitmap.compressformat.jpeg, 100, bytes); //you can create new file name "test.jpg" in sdcard folder. file f = new file("/sdcard" +"/" + "mainemailpdf.jpg"); f.createnewfile(); //write bytes in file fileoutputstream fo = new fileoutputstream(f);

java - Issue in calling DAO method from Service -

i have dao has method this: class abcservice { private abcdao isntance; public void getstuff() { instance.getqueryresult(); } } now if method called anywhere give nullpointerexception instance calls query method. still code in use in project long time , think twice before calling incorrect. there way code can accessed. standard practice? if have setter isntance , need call before calling getstuff . standard (although needed fields should set inside constructor.

php - Add tab and open in new window/tab -

i´ve searched possibillity add tabs next page , discussion , found below. link post below code $wghooks['skintemplatenavigation'][] = 'replacetabs'; function replacetabs( $skin, &$links) { $links['namespaces']['name_of_tab'] = array( 'class' => false or 'selected', // if tab should highlighted 'text' => 'text_of_tab', // tab says 'href' => 'url_to_point_to', // links 'context' => 'main', ); return true; } it works great windows opened in same window. have added $wgexternallinktarget = '_blank'; seems not working these link (works other external links i´m have on wiki). is there way force tab links open in new window or tab? i using: mediawiki version: 1.19.1 php: 5.3.6 (apache2handler) mysql: 5.5.16 i don't think possible without modifying php code skin you're using (e.g. sk

jquery - Dynatree Lazy Load Not Working -

Image
i'm creating dynatree , loading same data provided in example: http://wwwendt.de/tech/dynatree/doc/sample-lazy.html only lazy node (sub-item 2.3 (lazy)) not show expandable, , onlazyread() never fires. $("#tree").dynatree({ title: "lazy loading sample", autofocus: false, initajax: { url: "sample-data3.json" }, onlazyread: function(node){ console.log("lazy"); } }); the data: http://wwwendt.de/tech/dynatree/doc/sample-data3.json is exact same data example page loads. lazy node looks this: {"title": "sub-item 2.3 (lazy)", "islazy": true } but no expand icon showing: any ideas? the issue had custom icons.gif file missing lazy load icons.

sql server - Looping SQL statement insert -

i want insert each time line date + 1. it's simple sql loop. i'm using ssis, startdate , enddate variables. here code: with view_solidnet_training ( select cast('2013-04-09' datetime) datevalue union select datevalue + 1 view_solidnet_training datevalue + 1 < '2013-04-11' ) insert obj_availability values select 34, datevalue + 1, 'am', 2, 'test' view_solidnet_training; error message: msg 156, level 15, state 1, line 11 incorrect syntax near keyword 'select'. no need values in insert...select statement. replace insert obj_availability values select 34, datevalue + 1, 'am', 2, 'test' view_solidnet_training; with insert obj_availability select 34, datevalue + 1, 'am', 2, 'test' view_solidnet_training;

testing - How do you test an Android application across multiple processes? -

i have whole project tablets resources , have bunch of test cases written in combination of robotium, android , junit apis in project under testing used special attribute 1 of activities android:process=":remote" . @ point activity attribute loaded can use robotium methods can't access elements on current screen. seems should relaunch instrumentation or initialize new instance of solo . tried this, no help, seems can't relaunch in other process test. maybe have experience of testing such kind of applications , know how implement robotium or using directly android.test api? you can use iuautomator, works on api >= 16: http://developer.android.com/tools/testing/testing_ui.html you can use monkey runner: http://developer.android.com/tools/help/monkeyrunner_concepts.html it's based on x,y there no option use robotium, neither instrumentation test multiple processes.

sql server - Visual studio 2012 express. Generate create database sql script like in PHP myAdmin -

i have sql database opened in visual studio 2012 express database explorer , generate create table sql script entire database. in php myadmin there such functions can't find in vs 2012 express. if open table table create table script displayed , can copied 1 one there seem no such function when selecting multiple tables or whole database. does know if it's possible in vs 2012 express? use sql server management studio express.

c++ - Catch a moment when window message is put into queue -

i have 3rdparty application (target), creates window. embed window own application setting parent, changing styles, etc. the problem spy++ shows target receiving wm_destroy 2 times (in case close app). leads crash of target. want understand, why message queue contains 2 wm_destroy associated target window (btw, 1 wm_ncdestroy). to setting breakpoints @ destroywindow, postmessage syscalls, these functions appear not called main target window (first 1 called child windows, second 1 - different messages, except wm_destroy). did in context of both process , target process. so question is, there low-level function puts messages thread message queue? want put breakpoint @ , catch moment when wm_destroy put there. smth postthreadmessageinternal... thanks in advance!

ms dos - list names in folder, do action and go back to folder in batch -

im facing following: i have folder many folders named p_1400 p1_1499 (a hundred folders) i want script access each folder , perform action lets say: >cd folder 1 >echo hello in file.txt >cd .. >cd folder 2 >echo hello in file.txt >cd .. etc.. till theres no nore folders little constriant folder missed lets p_1450 missing , folder named p_1420_1 or p_1420_2 thank help! read help for , help pushd , try this for /d %%a in (p_*) ( pushd %%a echo action in %%a popd %%a )

jquery - Google maps API using UK town or post code -

i'm working on system @ moment work similar yell.com, can enter location (either town or post code) , return other towns in 10 mile radius. i've found plenty of code allow me enter post code, , i'm sure it's easy convert allow town, maybe have 2 text boxes easy enough, or 1 text box checks you've entered , can work out if it's town or postcode, wouldn't hard either, wondering if knows way of doing straight through api chuck whatever have , works out... if not no worries thought :) cheers daz yep can ..sorry guys i've answered own question here :) var address = 'doncaster'; //var address = 'ls2'; geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.geocoderstatus.ok) { alert(results[0].formatted_address); } })

spring - Cache or Session? -

storing user specific data (like loginaccountid etc.) in cache how benificial? as user logins in system if store loginaccountid in cache instade of session benificial or not? what issue ll face if store in cache? actually, session variable on server designed cache user-specific data. storing user-specific data in cache reinventing wheel.

openlayers - Which is the correct SRS to cut a map? -

i have used maptiler cut image, steps: choose "google maps comatible(spherical mercator)". add image. choose "wgs84-latitude , longitude(geodetic)". set min zoom 0,and max zoom 4. then got 5 folders named "0","1","2","3" , "4". i used openlayers.layer.xyz show map,but got upper , lower dislocation. wrong? i use "epsg:900913" srs whenever dealing google maps.

jsf - How to submit form with Java Object -

i have entity use generate object agents: private integer autodialer; private string description; private string email; private string ipaddress; private integer isactive; private boolean isadmin; private boolean isremove; private boolean issenior; private boolean issuper; private timestamp lastlogged; private timestamp lastready; private string password; private string phone; private string placeloc; private string placename; private string regserverlist; private string signature; private integer status; private string uilang; private boolean usectt; private boolean usevcc; private string username; private long vaccountid; private long accountid; i have form must take huge object add skill agent , insert data table: <h:form id="formdlgid"> <div class="dlg-row"> <div></h:outputtext></div> <div> <h:selectone

android - How to show second fragment from first fragment with in a single activity -

Image
i developing simple android app tablets , using android 4.0. application have main screen follow: oncreate() of main activity adding fragment in main.xml using following code: fragmenttransaction ft = getfragmentmanager().begintransaction(); fragment imagefragment = new imagefragment(); ft.replace(r.id.fragment_container, imagefragment); ft.settransition(fragmenttransaction.transit_fragment_fade); ft.addtobackstack(null); ft.commit(); this fragment have image view clickable. want when user click on image view fragment (fragment b) should call , replace image view. fragment b have videoview play video. so second screen should follow: my problem not gettting "how call second fragment first 1 in main screen activity?" i can use different activities not want , want run using fragments. please guide me. this simplest way: 1) inside youractivity create method: public void gotosecondfragment(){} fragmenttransaction ft = getfragmentmanager().beg

iphone - Which method is called when tableview is stopped forcely by Scrolling? -

i having tabelview values , scrolling fastly.i stopped scorlling tapping on tableview , want know indexpath of cell touched.how can this? called scorll view delegates method - (void)scrollviewwillenddragging:(uiscrollview *)scrollview withvelocity:(cgpoint)velocity targetcontentoffset:(inout cgpoint *)targetcontentoffset { // method called using scrollview delegates } but returning top visible row's indexpath , value. please help! get response , save in dictionary. nsdictionary *u = [results objectatindex:indexpath.row]; create button on scroll view , set tag value =indexpath.row on clicking button while scrolling index of cell (button here) clicked.

c# - Math model for determining more relevance set of rules -

i have string input data, it's request. there set of rules applying input string. so, instance, rule can "input parameter1 equals bla-bla-bla" or "input parameter2 contains bla-bla-bla". the rules has "strength". example, "equals" rule has more strength "contains" rule. want develop algotihm or math model evaluate strength of rule sets. really, i'm looking more theoretical answer. links, articles, books appreciated. the reason of concept of strength have rule "parameter1 contains value 'google'" , rule tells "parameter1 equals value 'google'". second selected, because it's more expressive such input data. although i'm not quite sure type of answer you're looking for, here goes: one way of implementing assume order of rules in rules definition implies strength. this mean first rule matches best , strongest match. shortest path complete proof of concept us

multithreading - How to implement a multiquestion poll thread in Java for multiple users? -

i have question regarding java threading. scenario: 2 different people receive multiquestion poll in mobile phones. when questions sent, server stays in wait () status until answer received. then, notify () signal sent poll continue, until questions sent. user 1 answering question 3 while user 2 still answering question 1. my approach far has been implement new chainedpollthread thread. anyway, way, if user 1 answers question 1 both users 1 , 2 receive second question. do need create new chainedpollthread each user? if number of users increments, mean need create, example, 100 threads? which appropiate way implement want achieve? thanks in advance. the way multithreading goes you'll need 1 thread each participant. the way implemented means 1 person answers question, whole state of server-side program advanced question two. having 1 thread (and thus, if will, 1 poll-program) each of participants aleviate problem. to reduce server-load due unn

html - Youtube embed issue with Twitter Bootstrap -

i building small static website on popular bootstrap framework. can't give link unfortunately have build modal box comes down on button click youtube video embedded it. it works fine if close modal box disappears leaves youtube video hovering on else no way rid of it. on ie10. has else tried embeddding videos bootstrap module boxes , have solution this? thanks in advance, jack edit ok, here snippet of code: <a id="mediavideo" class="btn btn-primary btn-large" href="#" data-toggle="modal" data-target="#video">watch interview</a> <!-- modal --> <div id="video" class="modal hide fade" style="color: #2a2a2a; width: 590px;" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal&

javascript - Passing Data to Bootstrap Modal from database using codeigniter via AJAX -

i new codeigniter, , can't seem right. have bootstrap model should display values database. problem requirement fetch values database using ajax, , insert relevant fields[form inside modal]. know how insert data using ajax, have never used retrieve , populate something. please can solve dilemma, i'm having problem hours now... onclick of button, make ajax call controller. $('#button').click( function(){ $.ajax({ type: "post", url: "your url controller function here", }).done(function( html ) { $(".bootstrap_modal").html(html); }); in controller function call model function run query , result set. now $data['result'] = $this->model_name->function_name(); $this->load->view('views/reveals/modal_content', $data);

Html page redirection in Ruby on Rails -

i have 1 html page , in page have 3 buttons. each button should redirect seperate html page. can u please below code , guide me wrong. <td class="span3 offset6 alignment"> <%= submit_tag 'add cart', products_path %> </td> <td class="span3 offset9 alignment"> <%= submit_tag 'check out', orders_path %> </td> <td class="span3 offset12 alignment"> <%= submit_tag 'view cart', viewcart_path %> </td> submit_tag used inside form . is case looks want use <%= link_to 'view cart', viewcart_path %>

asp.net mvc - C# MVC: DropDownListFor bind a enum to a integer model-field -

how can bind enum model-field of type integer? i tried extension methods, didnt job, cause method required model field given enum-type... here source (model , enum): model: public class einheit { public einheit() { id = guid.newguid(); } public guid id { get; set; } public short typeofsomething { get; set; } public long verwendungszweck { get; set; } } enum: public enum einheitsart { type1 = 0, type2 = 1, type3 = 2, type4 = 3, type5 = 4, type6 = 5 } i want have values going 0-6 (to able save integer in model), dropdownlist should show text "type1" "type6"... the problem have converting enum working selectlist. thank you! you can enumerate on enum values , create selectlistitems each of them. should work: var selectlist = new list<selectlistitem>(); foreach(einheitsart art in enum.getvalues(typeof(einheitsart))) { selectlist.add(new selectlistitem() { value = (int)art,

python - change shape of array so it plots colour matplotlib matrix -

this question has answer here: colour binary matrix matplotlib 1 answer hl = [(1,109),(12,212),(21,23)] highlightc = np.zeros([n, n]) c = len(highlightc) colour = [0.21]*c test = len(number_list) -c = [0.21]*test colour.extend(this) colour = np.array(colour) colour = np.array(colour) print len(number_list) print colour x, y in hl: highlightc[x, y] = 1##set binary matrix knows plot h=ax.imshow(highlightc*colour), interpolation='nearest',cmap=plt.cm.spectral_r) fig.canvas.draw() i trying create binary matrix, plots different colours. @ moment have problem arrays not same shape, colour not plotted. error operands not broadcast shapes (160,160) (241) i'm guessing (160*160) size of matrix , 241 size of colour array. have array of coordinates turned binary array highlightc . plots successfully. colour got size of coordinate array, , used populate arra

java - Scanner not working instead of buffered reader -

i'm writing code remove word text file , can't seem scanner work. work bufferedreader i'm not allowed use that. doing wrong here? public static void option2method(string dictionary) throws ioexception { file inputfile = new file(dictionary); file tempfile = new file("tempdict.txt"); string tempword = joptionpane.showinputdialog(null, "enter word remove"); string linetoremove = tempword.tolowercase(); linetoremove = linetoremove.replaceall(",", ""); linetoremove = linetoremove.replaceall("\\.", ""); linetoremove = linetoremove.replaceall("\\?", ""); linetoremove = linetoremove.replaceall(" ", ""); scanner reader = new scanner(new file(inputfile)); filewriter writer = new filewriter(tempfile); string currentline; while((currentline = reader.hasnext()) != null) { string trimmedline = currentline.trim();

in app purchase - Blackberry Webworks: Is the payment service(blackberry.payment.developmentMode) supported on OS 7 and earlier devices -

i creating app using html5 webworks on blackberry 10, want use webworks on os7 , earlier devices well.i want support payment service in-app purchases on app. payment service api of webworks work on os7 , earlier devices too? when use blackberry.payment.developmentmode = true; it found undefined yes, payment api supported on blackberry 7. make sure define feature in config.xml file: <feature id="blackberry.payment" />

how to take adavantage of hbase+hadoop in the factory which is lack of computer -

i'am new hbase&hdaoop, recent want build real-time data display application factory. metadata collected other applications alreay in use. should analysis data count make chart-view customer. but, if factory doesnot have enough computers set hbase+hadoop cluster, , team want start learn , use hbase+hadoop prepared future applications through case. suggestions. for learning use single node vm ( 1 , 2 , 3 ) , production use cloud .

Is there a way to password protect a .pem file so it prompts you to enter a password before adding the extention to Google Chrome? -

i have created basic chrome extension , generated key.pem file. is there anyway password protect key.pem file prompted each time want install extenions on google chrome? i've tried using following; enter password used protect file, when try package extension says "invalid private key" openssl genrsa -des3 -out key.pem 2048 any appreciated. thanks does thread help? http://productforums.google.com/d/msg/chrome/bkoaapx4iva/axz_cy0tj3kj i'm not sure if still works latest chrome, posted october 2012 does. hope helps :) edit: sorry if not hoping :)

php - load div only for mobile devices with javascript -

is possible load div if mobile detected or if resolution lower 641px? have different menus desktop , mobile. mobile menu uses image svg sprite, desktop don't want svg image load save http request. can hide div based on media queries, how can @ least prevent image being loaded, or load intire menu div mobile? best approach this? https://code.google.com/p/php-mobile-detect/wiki/mobile_detect check above link, can use in if else statement show hide div on basis of device type <?php // written adam khoury @ developphp.com - march 26, 2010 // php swapping css style sheets target device layouts // make index page of site .php file instead of .html $stylesheet = "default.css"; $agent = $_server['http_user_agent']; // put browser name local variable if (preg_match("/iphone/", $agent)) { // apple iphone device // set style sheet variable value target iphone style sheet $stylesheet = "iphone.css"; } else if (preg_match("/an