Posts

Showing posts from February, 2011

asp.net mvc 4 - Jquery $.post not working mvc4 -

i'm having trouble posting formdata controller. i'm trying implement wizard in mvc4 application, wizard based on sample project nadeem afana ( http://afana.me/post/create-wizard-in-aspnet-mvc-3.aspx ). have downloaded sample project , it's working great. in project code working fine except 1 thing, 'post' not working (while submit later working). i've isolated variables, , fine me if @ them in debugger in firefox var data = $("form").serialize(); var url = '@url.action("confirm", "product")'; $.post(url, data, function (r) { // inject response in confirmation step $(".wizard-step.confirm").html(r); }); however, action on specified controller isn't begin called (i've put breakpoint on it) [httppost] public actionresult confirm(productmodel model) { // code ... return partialview(model); } i have tried $.post("/product/confirm", $("form").serialize(), functio

SQL Server Collapsing multiple columns into a string from a one to many relationship -

given 1 many item can in many warehouses, doing straight join returns duplicate items. i'd collapse data warehouse table strings there 1 record per item. works, there more efficient approach avoids doing 2 separate subselects/subqueries? select im.itemid, (select warehouseid + ',' stockstatussummary itemkey = im.itemkey xml path ('')) 'warehouseids', (select convert(varchar(20), round(qtyavailable,3)) + ',' stockstatussummary itemkey = im.itemkey xml path ('')) 'warehousequantity' item im with output looking this: itemid warehouseids warehousequantity ------- ------------- ----------------- 1 10,20,30, 5,7,9, 2 20,30,40, 6,8,10, 3 30,40,50, 7,9,11, there not going method has golden lining, without testing. can try different method see if worth while. start scalar udf method see if worth while. make sure order data, results consist

Can't test multiple instances of a angularjs directive in Jasmine running Karma -

i have uber-edge case here. i writing wrapper directive around jquery plugin transforms simple html element formal feedback oriented view. <div my-directive>directivecontent</div> since plugin doesn't know it. directive transforms this: <div my-directve><div class='myplugin' ng-include></div></div> at point fire plugin's init function final render. (it creates title element among other things.) <div my-directve><div class='feedback feedbacksuccess' ng-include> <h2>title</h2> content </div></div> the rub in jasmine tests in karma, can 1 test. if not work. here directive: module.directive("feedback", function(){ return { restrict : "ea", replace : false, transclude : true, require : "feedback", template : "<div class='feedback' ng-transclude></div>", con

css - @font-face works on localhost but not online -

i looked answer problem everywere, nothing works... my font works locally on browsers, when upload website, font works in firefox , ie? this css: @font-face { font-family: 'bebasneueregular'; src: url('http://www.ist-immobilien.at/fonts/beba/bebasneue-webfont.eot'); src: url('http://www.ist-immobilien.at/fonts/beba/bebasneue-webfont.eot?#iefix') format('eot'), url('http://www.ist-immobilien.at/fonts/beba/bebasneue-webfont.woff') format('woff'), url('http://www.ist-immobilien.at/fonts/beba/bebasneue-webfont.ttf') format('truetype'), url('http://www.ist-immobilien.at/fonts/beba/bebasneue-webfont.svg#webfontx0ynjqnl') format('svg'); font-weight: normal; font-style: normal; } i have used relative urls too, didn't make change. fonts on server.. don't know, whats problem.. the siteurl is: site url blue headers should font... in css, y

silverlight - How do I convert a Graphic to a different coordinate system in ArcGIS? -

i trying add functionality silverlight arcgis application allows shapefiles uploaded , displayed on map. whenever upload shapefile, displays correctly in wrong place, such shape should in texas being drawn in sahara. i'm pretty sure problem our map uses different coordinate system each shapefile, haven't been able find resources can convert shapefile coordinates. webmercator.fromgeographic works of shapefiles, causes application crash others. i've tried using geometryservice , have tried altering spatialreferences shapes, neither had noticeable effect. the prj file didn't work fromgeographic looks this: projcs["basic albers wgs84",geogcs["d_wgs_1984",datum["d_wgs_1984",spheroid["wgs_1984",6378137.0,298.257223563]],primem["greenwich",0.0],unit["degree",0.0174532925199433]],projection["albers"],parameter["false_easting",0.0],parameter["false_northing",0.0],parameter[&

PHP populate single array with no keys -

i have indexed array this: $indexed = array(0=>2,1=>7,3=>9) but need single array, without indexes, this: $notindexed = array(2,7,9) zend_form not accept $indexed parameter function populate() multi checkboxes works fine $notindexed how can dynamically transform $indexed $notindexed thanx answers $notindexed = array_values($indexed);

How do I prevent an infinite loop when serializing a 3-node reference in Java into JSON? -

in spring mvc application have 3 classes - content, category, , document - interrelated , must serialized json, when doing cause infinite loop. relationship such: content -> list<category> -> list<document> -> list<content> -> (etc.) where category property of content, etc. i'm trying serialize reference ends @ list (so content.categories.documents exposed view), not finding way go it. annotating jackson's @jsonmanagedreference , @jsonbackreference won't work because of these fields annotated such other relationships. not sure how go other possibly constructing model specific relevant view. edit: if helps, error got "org.springframework.http.converter.httpmessagenotwritableexception: not write json: infinite recursion (stackoverflowerror)" followed trace of reference chain. perhaps have @ @jsonidentityinfo annotation, can used handling cyclic dependencies ( this entry mentions it)? won't work collection s (ala

android - Which IDE for Phonegap? Is Eclipse enough? -

i jump phonegap , realize doesn't have ide of own. know use eclipse create android-centric phonegap apps, ios , perhaps windows phone , perhaps blackberry "versions" - can eclipse used of it? phonegappers use ide? does phonegap build make possible in eclipse, , throw cloud ios, etc., builds? i'm using intel-xdk , it's been great far. has ripple emulator embedded great test app quickly.

storekit - iOS: How to put a button on the top of SKStoreProductViewController -

i want put custom button on top of skstoreproductviewcontroller. tried below did not work. wondering if give me advices. skstoreproductviewcontroller *storeviewcontroller = [[skstoreproductviewcontroller alloc] init]; uibarbuttonitem *sharebutton = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemaction target:self action:@selector(showsharedialog)]; storeviewcontroller.navigationitem.rightbarbuttonitem = sharebutton; storeviewcontroller.delegate = self; [self presentviewcontroller:storeviewcontroller animated:yes completion:^() { [storeviewcontroller loadproductwithparameters:@{skstoreproductparameteritunesitemidentifier:appid} completionblock:^(bool result, nserror *error) {}]; }];

php - How can I open a file from another ftp and write? -

i tried open file in ftp , write coulnd how can that? $ftpstream = @ftp_connect('****'); //login ftp server $login = @ftp_login($ftpstream, '****', '***'); if($login) { echo "conectado"; $fp = fopen('file.txt', 'w'); fwrite($fp, '1'); fwrite($fp, '23'); fclose($fp); } the code have posted wrong. opens ftp stream ( ftp_connect ), writes file local file system ( fopen ). ftp stream won't allow write fwrite - need use commands transfer entire files. you can want fopen if use ftp:// scheme. for example: $fp = fopen("ftp://user:password@example.com/file.txt","w"); fwrite($fp, '1'); fwrite($fp, '23'); fclose($fp); alternativley, can write file local file system , use ftp stream transfer it: $file = 'somefile.txt'; // create file in local file system here. $remote_file = 'readme.txt'; // set basic connection $conn_id = ftp_connect

css - Add div next to other centered div -

Image
i want add div right of other div positioned in center. shown in image: i have html far: <div id= "top-menu-wrapper"> <div id="top-menu"> </div> <div id="social"> </div> </div> the css: #header #top-menu { display : inline-block; width : 764px; height : 55px; margin : auto; } #header #social { display : inline-block; width : 100px; height : 55px; margin-left : 25px; } #header #top-menu-wrapper { display : block; text-align : center; margin-bottom : 25px; } since widths fixed, calculate left offset of each div, , put left margin without using central alignment. or, if container fluid, center problematic div inside right-floated subcontainer width of (top container width - central div width) / 2) (that represents remaining spa

powershell - Fatal: Server unexpectedly closed network connection -

i trying run following command sql server agent job upload daily files our ftp server. tried connection local utility winscp 5.1.5 , connection ftp succeeds without problems, connection attempt script fails (following code , error). can me in right direction please? $error.clear(); $csv_file = "filepath" $sftp_cmd = "c:\psftp.exe" $user = "testuser" $pass = "pwd" $hst = "ftp3.xyz.com" $cmd = @( "put $csv_file", "bye" ) $cmd | & $sftp_cmd -pw $pass "$user@$hst" -batch i getting error fatal: server unexpectedly closed network connection. the command working fine me. however, question suggests you're trying connect ftp server. winscp can handle both scp/sftp , ftp connections, knowledge psftp supports sftp (a file transfer protocol based on ssh, not confused ftps ). if server not ssh server, need ftp client data transfer (e.g. ftp.exe shipped windows). if server ssh se

c# - Arranging in order with reference to a column -

Image
i have mysql database table ( using entity framework ) : here codes use retrieve , populate them on wpf : crud class file : //get records based on activityid , taskid. public ilist<model.questionhint> getrecords(int listtask, int listactivity) { ilist<model.questionhint> lstrecords = context.questionhints.tolist(); return lstrecords.where(a => a.taskid == listtask && a.activityid == listactivity).tolist(); } code behind : public mainwindow2() { initializecomponent(); populatequestion(1, 5); } private void populatequestion(int activityid, int taskid) { ilist<model.questionhint> lstquestionhints = qh.getrecords(taskid, activityid); foreach(model.questionhint qhm in lstquestionhints) { textblock tb = new textblock(); tb.text = qhm.questioncontent; tb.fontweight = fontweights.bold; tb.f

unit testing - Rails 4: Why do fixtures make this test fail? -

i have test below , if there fixtures model fails total_unapproved , new_total being equal instead of new_total being 1 less. if remove loading fixtures in test_helper.rb or comment them out runs expect. here's class function sets approvals true. works. def inviterequest.approve_invites(number) inv_reqs = inviterequest.where("approved = ?", false).first(number) inv_reqs.each |inv_req| inv_req.approved = true inv_req.save inv_req.send_approved_email end end here's test calls above function. require 'test_helper' class inviterequesttest < activesupport::testcase test "class method approve_invites(number) should approve 'number' inviterequests" # ensure there @ least 1 instance inv_req = inviterequest.create(email: "hobojoe@test.com") # set inviterequests.approved false inviterequest.all.each {|r| r.approved = false; r.save} total_unapproved = inviterequest.where("approved

c++ - rollover issue with unsigned int while checking if a number is within a range -

i trying check if received message number in given range. everytime message number gets incremented.so if expecting number 10, accept message number 10+ 5. sequence numbers 10 15. using unsigned int. when expected number 65532,i can accept 65532 + 10(so min = 65532 , max = 5). how check if number received in range? if use unsigned gf(2 k ) arithmetic value k [edit: addition , subtraction, doing full finite field more work; maybe should adopt other shorthand terminology?]. typically unsigned short k 16, unsigned int 32, , unsigned long long 64, in case @ least 16 (because uint_max @ least 65535). in kind of finite field arithmetic can subtract 2 numbers , compare result against limit. is, if range of "allowed values" x x+5 , actual value received y, then: unsigned int x, y, diff; ... diff = y - x; if (diff <= 5) { value in range } else { value out of range } this works fine long "in range" window not exceed 2 k-1 , , since k >

Is there a way to view the C code underlying Java? -

i know can view "source code" java on places grepcode, i'm looking way view c code java built on top of. feel question must have been asked many times, haven't been able find satisfactory answer. this not explicit purpose - want understand how programming language "built" little bit better. also, if show how view bytecode generated, too. oracle's official jdk 7 based on code the openjdk project , can download link. there's jdk 8 branch available same site. the java virtual machine (jvm) sort of imaginary computer executes *.class files. of time, jvm emulated program written in other language (like c++) runs on real computer. when run java program on windows machine, example, program java.exe written largely in c++, pretends jvm, , executes *.class files. java code like ++i; gets translated java compiler (which written in java!) jvm opcode like iinc 0 1 the jvm contains code (written in c++, or assembly) handle instructi

javascript - Is Multi level Clone solution in jQuery -

can 1 multi level clone solution can have multiple levels of nested cloned forms using sheepit jquery plugin? any appreciated. try for reference afteradd:function (data) { initializeautotab($('input.autotab', data)); initializedatepicker(data); } if using nested forms, must specify same afteradd nested options. regardless, alternative using live/on. also note want use afteradd instead of afterclone because afterclone seems before content added dom.

What does hash do in python? -

i saw example of code hash function applied tuple. result returns negative integer. wonder function does. google not help. found page explains how hash calculated not explain why need function. a hash fixed sized integer identifies particular value . each value need have it's own hash, same value same hash if it's not same object. >>> hash("look @ me!") 4343814758193556824 >>> f = "look @ me!" >>> hash(f) 4343814758193556824 hash values need created in such way resulting values evenly distributed reduce number of hash collisions get. hash collisions when 2 different values have same hash. therefore, relatively small changes result in different hashes. >>> hash("look @ me!!") 6941904779894686356 these numbers useful, enable quick look-up of values in large collection of values. examples of use in python's set , dict . in list , if want check if value in list, if x in values: , python nee

javascript - dojo.destroy() make node empty, not delete it -

i've got table, dynamically adding , deleting rows. when need remove element, it's not deleting, it's make emty. here's remove function: function remove() { dojo.foreach( dojo.query(".selectedmail"), function(selecttag) { dojo.destroy(selecttag); } ); } here's selecting function: var mybehavior = { ".row": { //onclick: dojo.addclass(evt.target, "buttondown") onmousedown: function(evt) { if(dojo.hasclass(evt.target, "selectedmail")) dojo.removeclass(evt.target, "selectedmail"); else dojo.addclass(evt.target, "selectedmail"); } } }; here's table: <table> <tbody id="tbody123">

html - How to insert dynamic array into the database in php? -

i working on dynamic array need insert these array in database.when insert dynamic array database instead of displaying in 1 row cover 3 row. coding insertion this array $asma[]=ga::select($ga->population,'total',3); this insertion query need insert detail in 6 column output comprises of 6 values . $voltage = array(); $duration = array(); $number = array(); foreach($asma $key => $value) { foreach ( $value $ind => $hobject ) { $voltage[] = $hobject->voltage; $duration[] = $hobject->duration; $number[] = $hobject->number; } }// endforeach for(i=0;i<row_count;i++) { $q = "insert ga (fe, fe1, fe2,fe3,fe4,fe5,fe6,f7,f8, timestamp,username ) values (%d, %d, %d,%d, %d, %d,%d, %d, %d, '%s' ,'$login_session')"; $qs = sprintf( $q, $voltage[$i],$duration[$i],$number[$i], date("y-m-d h:i:s") );

java - Get MYSQL last updated data or lastly inserted data -

i have problem this. i accessing database having on 100,000 data in new entry table. now want write listener, means if new record insert table somewhere else have notification . my question is: best , fastest way this? because day there should have around 500 new data in new entry table. is suitable check database every time using thread? im using java mysql. please advice me. i not sure whether there listener exists mysql changes. wouldn't straight forward these details. but there called ' the binary log ' in mysql, contains “events” describe database changes such table creation operations or changes table data. so 1 way track changes can polling these logs. challenge these logs written in binary format. mysql provides utility called mysqlbinlog process these logs in text format. here 1 java parser rescue, can read mysql binary logs: https://github.com/tangfl/jbinlog integrating bits , pieces , may able need.

sharepoint - Travese through all webs and intersect lists -

Image
i want traverse through webs , child sites, find lists same name , make intersection of them child list priority , show result in web part in repeater. lists contain title , name , link so far have folowing: using (spsite ospsite = new spsite("http://niki/default.aspx")) { spwebcollection sitewebs = ospsite.allwebs; foreach (spweb web in sitewebs) { web.allowunsafeupdates = true; try { splist list = null; try { list = web.lists[listname]; } catch { } if (list != null) { list.enablemoderation = true; splistitemcollection collectio

c++ - Usefulness of move constructor -

this question has answer here: what move semantics? 11 answers i found example on http://www.cprogramming.com/c++11/rvalue-references-and-move-semantics-in-c++11.html #include <iostream> using namespace std; class arraywrapper { public: // default constructor produces moderately sized array arraywrapper () : _p_vals( new int[ 64 ] ) , _size( 64 ) {} arraywrapper (int n) : _p_vals( new int[ n ] ) , _size( n ) {} // move constructor arraywrapper (arraywrapper&& other) : _p_vals( other._p_vals ) , _size( other._size ) { cout<<"move constructor"<<endl; other._p_vals = null; } // copy constructor arraywrapper (const arraywrapper&

mysqli - Syntax error but I don't see it? (PHP/MySQLi_Query) -

so have been working on different php scripts day, don't know if it's eyes , need break or what: wrote line connect mysql database, , check if username exists. error messages of course less helpful (even when searched don't seem apply working on or don't show anything. error 1 (before put in or die(mysqli_error($mycon)): warning: mysqli_num_rows() expects parameter 1 mysqli_result, boolean given in /home/icangame/public_html/dev/php/userregister.php on line 40 error 2 (after put in or die statement): you have error in sql syntax; check manual corresponds mysql server version right syntax use near '== `user`' @ line 1 code apples (will post more if want, it's big file.): $checktherow = mysqli_query($mycon, "select * users `username` == `$realusername`") or die(mysqli_error($mycon)); if (mysqli_num_rows($checktherow) == 0) { mysqli_query($mycon, "insert users (username, password, email) values ('$realusername

url - How to let placeManager.revealPlace open a request in a New Tab, in GWTP? -

in gwtp, can go new url by: placerequest request = new placerequest(nametokens.mytok).with("param1","123"); placemanager.revealplace(request); however, these above codes open new url (ex: abc.com#mytok;param1=123) current tab. question how let placemanager open new url new tab? there other solution can found on internet not sure one. can string url = window.location.createurlbuilder() .sethash("mytok;param1="+url.encodequerystring("123")) .buildstring(); window.open(url, "_blank", null); i think 2nd solution not elegant since have manually put param url ourselves, while in 1st one, params wrapped inside .with method. so how let placemanager.revealplace open request in new tab, in gwtp? why not just: string url = window.location.createurlbuilder().sethash(placemanager.buildhistorytoken(request)).buildstring(); window.open(url, "_blank", null);

android - loging with log4j stackoverflow error -

i trying add log statements in code. using logconfigurator, wrote following code in mainactivity - public class mainactivity extends activity { logger log = logger.getlogger(mainactivity.class); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); logconfigurator logconfigurator = new logconfigurator(); logconfigurator.setfilename(environment.getexternalstoragedirectory() + file.separator + "myapp" + file.separator + "logs" + file.separator + "log4j.txt"); logconfigurator.setrootlevel(level.debug); logconfigurator.setlevel("org.apache", level.error); logconfigurator.setfilepattern("%d %-5p [%c{2}]-[%l] %m%n"); logconfigurator.setmaxfilesize(1024 * 1024 * 5 * 1024 ); logconfigurator.setimmediateflush(true); logconfigurator.configure(); log.info("execution of method oncreate started");

visual studio 2010 - Creating a separate window against each click on push button -

i working on windows gui application.there 20 push buttons on window. against each button click, want open new window displaying information. can can display information since new , didn’t want try complicated, decided go idea of creating pop window against each button click. now problem facing since there 20 different windows, need create 20 different window callback functions? though there 1 control in pop window i.e. close sign, need have callback function. i had been trying idea looks senseless. there other option in can achieve desired functionality? waiting help. if of windows should behave same way, can create single window procedure (what you're calling callback function) shared of pop-up windows. window procedures not have unique individual windows, if multiple windows share same window procedure, react identically messages receive. for example: // message procedure pop-up windows. lresult callback mypopupwndproc(hwnd hwnd, uint msg, wparam wpar

configuration - Delphi XE3 Ctrl+Z undo caret movements too -

i'm new delphi , i've found strange behaviors of rad studio xe3 code editor. e.g., when press undo shortcut ( ctrl+z ), editor not undo last code editing, latest caret movements. mean: when open unit , browse through code, happens go clicking around, without editing code. well, if press ctrl+z, caret move points i've been clicking before. expecting nothing happen when press ctrl+z , if no edit performed! there way deactivate feature? i've cnwizards_1.0.0.638 installed. thanks. you cannot disable behavior completely, can reduce effect. turn on group undo editor option . consecutive cursor movements grouped single action. other types of consecutive actions grouped together, too, don't recall being issue me.

Strange flickering with WebView after setting android:hardwareAccelerated="true" -

strange flickering webview after setting android:hardwareaccelerated="true" , mwebview.setbackgroundcolor(color.transparent) a no one, no flicker. i have enabled hardware acceleration application , have disabled activity. additionally set background "null", mentioned above. works me now. approach (untested): set layer type software rendering , set background color.transparent (or "0"): webview.setlayertype(view.layer_type_software, null);

broadcastreceiver - android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE what's the use? -

i trying execute onreceive method when android starts can schedule task. unfortunately onreceive of bradcastreciever called @ boot if install app on root system. thought android.intent.action.action_external_applications_available should fix problem. but post seems not possible, though in tutorials feasible. android installlocation , boot_completed i should infer cannot such thing. is or there way broadcast @ startup app on sd. if not possible wonder what's use of android.intent.action.action_external_applications_available this manifest in case wnat take look. testing on android 2.3.7 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mypackage" android:installlocation="preferexternal" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="9"

python - Grouping Data by field in Django -

as chapters grouped season: season 1: chapter 1 chapter 2 chapter 3 chapter 4 season 2: chapter 1 chapter 2 chapter 3 example image http://i.stack.imgur.com/svaqm.png #models.py class serie(models.model): # optional fields def serie_chapter(self): return self.seriechapter_set.order_by("season","chapter") class seriechapter(models.model): serie = models.foreignkey(serie) name = models.charfield(max_length=100, unique=true) slug = models.slugfield(max_length=100, unique=true) season = models.integerfield(db_index=true, choices=choices_season) chapter = models.integerfield(choices=choices_episode) created_at = models.datetimefield(auto_now=true) so, can add chapters per season? thanks. you can add 1 more class class series_chapter(models.model): series=models.foreignkey(serie) chapter=models.foreignkey(seriechapter) in class seriechapter won't need serie=mo

html5 - How to markup "Related News" using microdata? -

Image
a news post like <article itemscope itemtype="http://schema.org/newsarticle"> <h1 itemprop="headline">awesome news</h1> <div itemprop="articlebody"> bla bla bla... </div> </article> what if include related news , markup them? <ul> <li><a href="related_news_1.html">related news 1</a></li> <li><a href="related_news_2.html">related news 2</a></li> <li><a href="related_news_3.html">related news 3</a></li> </ul> try using element webpage itemtype (from: http://schema.org/webpage , know using newsarticle in case, used article example): <div itemscope itemtype="http://schema.org/article"> <span itemprop="name">how tie reef knot</span> <span itemprop="author">john doe</span> article has been twe

How to build KDE Oxygen plugin on Qt 5? -

i'm moving project qt 4.8.4 qt 5.1. on platforms application looks native except (ironic) kde. know problem source - kde oxygen style (plugin) compiled on qt 4.8.4 can't used qt 5.1 . if plugin problem only, maybe building on qt 5.1 solve problem. downloaded kde workspace module kde include oxygen source. in <kde workspace src>/libs/oxygen have no idea how compile little lib. have oxygen plugin compiled on qt 5.1 or know steps how build it?

php - Newline In File -

i got problem... have php script named getdata.php <?php $filename = "data"; $data = file_get_contents($filename); $data = explode("\n", $data); print_r($data); ?> and data file name admin\nname guest when run php code get: array ( [0] => name admin\nname guest ) i want output array ( [0] => name admin [1] => name guest ) what should do? change this $data = explode("\n", $data); to $data = explode("\\n", $data); the issue in data file \n string of 2 characters \ , n , in explode invocation single control character \n . changing \\n it's same 2 characters data

visual c++ - Chromium Embedded (CEF3). How to resize new browser window? -

so i'm using cef v3.1180.823 , i'm trying make browser multiple tabs. for every new tab i'm: 1) creating new window style ws_popupwindow. hwnd hwndtab = createwindowex(null, w.lpszclassname, 0, ws_popupwindow, x, y, width, height, null, null, hinst, null); 2) creating new "g_handler" cefrefptr<clienthandler> cef_htab = new clienthandler(); 3) creating new browser cefbrowserhost::createbrowser(info, cef_htab.get(), _url, settings); 4) setting window child first (main) tab never closes setparent(hwndtab, g_handler->getmainhwnd()); 5) setting hwnd of new window main hwnd new handler cef_htab->setmainhwnd(hwndtab); my problem is : how resize of tabs when main window resizing? the default window procedure (i.e. procedure of main tab) has code: case wm_size: // minimizing resizes window 0x0 // causes our layout go // screwy, ignore it. if (wparam != size_minimized &&

font awesome - Adding Fontawesome to ckeditor -

i using fontawesome in website , have own cms edit website pages. develop dialog user can pick fontawesome icon ok add them in codeview of ckeditor. icons added content not shown in ckeditor designview. have changed ckeditor config file editor accepts tags (*). added fontawesome css file @import rule contents.css still no fontawesome icon visible in editor area. (*)config.js config.allowedcontent = true; config.protectedtags = 'i' ; config.protectedsource.push( /<i[\s\s]*?\>/g ); //allows beginning <i> tag config.protectedsource.push( /<\/i[\s\s]*?\>/g ); //allows ending </i> tag what can make work? config.protectedsource.push( /<i class[\s\s]*?\>/g ); config.protectedsource.push( /<\/i>/g ); what have interfere img tags. , or, after of config: ckeditor.dtd.$removeempty['i'] = false; both work well. sure have cleared cache when making changes. *edit 1 works while messing else up. no go solution. i stopp

r - Combine Data Frame with a List of Data Frames -

say have data frame x , list of 2 data frames l contains data frames y , z. what best way create third list m contains dfs x, y , z? i tried every column of x became element of m. m = c(x,l) i'm sure there's simple solution missing here. try this: m <- c(l,list(x=x))

c# - Display Success message on the same page when submit -

i'm using html.beginform in view page , parameters using formcollection controller want return success message on same viewpage result.i'm using following code, public string insertdetails(formcollection collection) { string result = "record inserted successfully!"; return result; } it shows success message on new page.how can resolve this? have return success message on same page? personally i'd pop result string viewbag. public actionresult insertdetails(formcollection collection) { //do logic insert details viewbag.result = "record inserted successfully!"; return view(); } then on web page: <p>@viewbag.result<p/>

android - Randomly Generating Patterns Using Hexagonal Images -

Image
okay have these images: basically i'm trying create "mosaic" of 5 12 hexagons, of them centralised, , of lines meet up. for example: i'm aware brute-force it, i'm developing android need faster, more efficient , less processor-intensive way of doing it. can provide me solution, or point me in right direction? a random idea had go deepak said defining class tracks state of each of 6 edges (say, in int[] neighbor in neighbor[0] states if top edge has neighbor, neighbor[1] states if top-right edge has neighbor, , on going clockwise) then each hexagon on screen, convert array integer via binary. based on integer, use lookup table determine hexagon image use + how should oriented/flipped, assign hexagon object image. for instance, let's take central hexagon 4 neighbors in first screenshot. array [1, 0, 1, 1, 0, 1] based on scheme mentioned above. take neighbor[0] least-significant bit (2^0) , neighbor[5] most-significant bit (

Please clarify the following Python NumPy array initialization and splicing examples -

i using python version 2.6 , learning numpy version 1.3. i have tried out several numpy array initialization , column splicing examples below, , added inline questions comments , list of findings in end. can explain me behind differences in behaviors. lots of inter-related questions , rather long post, each example small, feel free answer 1 or couple. import numpy np print "initializing number of numpy arrays:\n" a) initialize list of tuples a = np.zeros((3,),dtype=('i4,i4,a1')) a[:] = [(1, 2, 'a'), (3, 4, 'b'),(5, 6, 'a')] print "a: " print # print => [(1, 2, 'a') (3, 4, 'b') (5, 6, 'a')] print repr(a) # print => array([(1, 2, 'a'), (3, 4, 'b'), (5, 6, 'a')], # dtype=[('f0', '<i4'), ('f1', '<i4'), ('f2', '|s1')] print '\n' b) normal list of tuples b = []; b[:] = [(1, 2, &#

java - Override name attribute in own tag in spring-mvc -

i wrote own tag in tag library descriptor , implementation in java. public class protectedhidden extends abstracthtmlelementtag { @override protected int writetagcontent(tagwriter tagwriter) throws jspexception { string hash = (string) super.pagecontext.getsession().getattribute("csrftokenmanager.tokenval"); string oldvalue = getdisplaystring(getboundvalue(), getpropertyeditor()); string newvalue = desedeencryption.encrypt(oldvalue + "|" + hash.replace("-", ""), hash); string oldname = (string) super.getpath(); string newname = "zf_" + oldname; tagwriter.starttag("input"); writedefaultattributes(tagwriter); tagwriter.writeattribute("type", "hidden"); tagwriter.writeattribute("name", newname); tagwriter.writeattribute("value", processfieldvalue(getname(), newvalue, "hidden"));

ios - Navigate from one Detail View contorller to another Detail VC in Splitview -

i have multiple detialviewcontroller split view. have scenario need navigate 1 detailviewcontroller another. both in splitview in ipad. when try push or modal destination view, whole view appears not split view menu or master view controller on left. all need take @ this example apple there multiple detailviewcontrllers handles beautifully here find detailview manager manages detail view controller should shown per user inputs.i guess want. hope helps.

php - How do I randomly jumble sections of a URL seperated by "/"? -

i’m wondering how jumble sections of url / separator: http://fujifilm.in/en/products/consumer_products/digital_cameras/x/fujifilm_x_t1/ i’m looking combinations of results, like http://fujifilm.in/en/products/consumer_products/digital_cameras/x/fujifilm_x_t1/ http://fujifilm.in/en/products/consumer_products/digital_cameras/x http://fujifilm.in/en/products/consumer_products/digital_cameras http://fujifilm.in/en/products/consumer_products http://fujifilm.in/en/products http://fujifilm.in/en/ http://fujifilm.in/ http://fujifilm.in/en/fujifilm_x_t1/ http://fujifilm.in/en/products/fujifilm_x_t1/ http://fujifilm.in/en/products/consumer_products/fujifilm_x_t1/ http://fujifilm.in/en/products/consumer_products/digital_cameras/fujifilm_x_t1/ ................ ................ ................ how can this? this should started: $uri = 'http://fujifilm.in/en/products/consumer_products/digital_cameras/x/fujifilm_x_t1/'; $parts = parse_url($uri); $path = $parts['p

Python sad/happy face machine learning (Get rid of text) -

i use little advice on how make loop / if statement, can rid of unnecessary text in file. i got txt file, large 153mb. know how open in python, still not best taking stuff (text don't need) out of it. i posted example of txt file u can see under here: @xirwinshemmo follow :) hii... if u want make new friend add me on facebook! :) xx https:\/\/t.co\/rcyfvrmddg wanna if ever feel lonely or sad or bored, come , talk me. i'm free anytime :) hope not spy someone. hope real on neautral side. because trust. :-) @dessdim @bureemi not maybe :) \u201c@emilykathryn_17: funny how want , pray when want same thing god wants. :) #newheart #newdesires\u201d @philkomarny thank :) can follow me on twitter can dm you? rt @emrekavcoglu: @usher dj got fallin in love , yeah earth number 1 m\u00fcsic listen thank king :-) @ what want rid of @ + names, first one: @xirwinshemmo and have text "thanks follow :)" there links can't use like: https:\/\/t.co

c# - Issues deserialising JSON -

i have json data shown here: [ {"article": { "articleid":0, "engtitle":"area of interest", "engexcerpt":"", "engbody":"", "articletag": { "tagattribute1":"selection", "tagattribute2":"areaofinterest" } } } ] which me looks fine when gets passed method on deserializeobject called, results in error. here code have deserialize object: list<articlejson> lstarticlejson = jsonconvert.deserializeobject<list<articlejson>>(jsondata); and here relevant models: public class articlejson { public article article { get; set; } } public partial class article : basemodel { public article() { this.articletag = new hashset<articletag>(); } public string engtitle { get; set; } public string engexcerpt { ge

asp.net mvc - WebSecurity issue : Initialize database connection -

i got issue while trying put in place authentication system. i'm using asp.net mvc 4 , linq sql classes. first of all, there login view calls related controller. i'm doing connect , redirect users following roles. public class logincontroller : controller { // // get: /login/ t2a_dataclassesdatacontext db; public logincontroller() { db = new t2a_dataclassesdatacontext(); } public actionresult index() { return view(); } [httppost] public actionresult index(loginviewmodel lvm) { if (modelstate.isvalid) { if (websecurity.login(lvm.username, lvm.password, false)) { var login = u in db.users u.username == lvm.username select new user { username = u.username, password = u.password, isadmin = u.isadmin }; user user = (user)login; string role = user.isadmin == true ? "utilisateur" : "administrateur";

grep - Match code of concatenated strings with regex -

i need regex matches code fragments like: 'lo'.'re'.'m'.' ipsum'.' dol'.'or' i've no idea how start. how if know final string lorem ipsum dolor don't know positions or amount of '.' ? i'm trying find string in source files grep on command line. in code can example like. $random = 'lo'.'re'.'m'.' ipsum'.' dol'.'or'; you can use tr : s="'lo'.'re'.'m'.' ipsum'.' dol'.'or'" echo "$s" | tr -d "[.']" lorem ipsum dolor to validate grep: echo "$s" | tr -d "[.']" | grep -q 'lorem ipsum dolor' echo $? 0

How to write regex for c type inetger in lex? -

i trying write c parser code in lex %{ /* program job identifying c type integer , floats*/ %} %% [\t ]+ /* ignore whitespace */ ; [0-9][5]+ { printf ("\"%s\" out of range \n", yytext); } [-+][0-9][5] { printf ("\"%s\" c integers\n", yytext); } [-+]?[0-9]*\.?[0-9]+ { printf ("\"%s\" float\n", yytext); } \n echo; /* default anyway */ %% i facing problem in identifying c type integer because have limit i.e. 32767. have used regex i.e. digit length greater 5 in should yell "out of range" error it's hack , not perfect solution. this might provably impossible right. regular expressions make simplistic kind of recognition (a state machine no memory), , tokenization/lexical analysis. you're trying use type-checking, requires lot more horsepower. i'd save parser itself. far easier, symbol table filled in (to know kind of variab

Is there a way to have an "automatic" join in postgresql? -

i mean following: have 2 parent tables : table1 id primary key name text table2 id primary key ... and child table, used fo n-n relations : table_child id primary key id_1 int id_2 int where id_1 , id_2 in table_child refer column id in table1 , table2. now : perform request, join between table_1 , table_child on table1.id = table_child.id1, because need value of column table1.name. i'm wondering if there way avoid these joins, , declare somehow "pseudo" column name in table_child, not real column, link corresponding column in table_1, : * can acces value through table_child.name * synchronized value table1.name i hope explanation understandable... further comment above, answer you're looking like: create view table1_child_view select table1.name, table1_child.* table1_child inner join table1 on table1.id = table1_child.id_1 then can run queries on new view, such as: select name table1_child_view ...

Is there any way to publicly request 'Page Views' of any website URL from Google Analytics? -

i not sure if possible, nor find leads yet. i want able return total 'page views' number of website url, uses google analytics. ga api, can use logging-in limited websites authorized see stats. however, need display total page views requested page url (not entire domain & no information stored on server. is there way can achieve this? edit: after answers tom & blexy -- rephrase it. what're best ways estimate page views of url example.com/this-is-url , single/multiple sources, alexa? tia :) i think you're asking if there's way see ga data other sites - say, stackoverflow.com. if so, no, there no way access ga reporting sites google account not have access to.

c# - In CIL, why is BGE equal to CLT.UN followed by BRFALSE? -

in cli specifications ( ecma-335 , page 329), , on msdn , stated cil opcode bge equivalent performing clt.un followed brfalse . this baffles me. don't understand why equivalent unordered clt.un , , not regular clt . considering there bge.un , not state equivalent set of instructions. whould have expected bge equivalent [ clt , brfalse ], , bge.un equivalent [ clt.un , brfalse ]. is error in specifications or missing something? that pdf states: the effect of bge target instruction identical to: if stack operands integers, clt followed brfalse target if stack operands floating-point, clt.un followed brfalse target