Posts

Showing posts from January, 2013

asp.net mvc - Issue in Mvc Razor -

i have made on loop as: @foreach (var objcompanycontact in (list<balcentral.datamodel.visacasedestinationcountryemploymentcontact>)viewdata["visacasedestinationcountryemployment"]) { <table class="email_phone" style="width:100%"> <thead> <tr> <th></th> <th><label class="control-label-superscript">primary?</label></th> <th></th> </tr> </thead> <tr> <td>@*<

angularJS how to user accessible url routing? -

the basic routing method below, angular.module('myapp', ['myapp.filters', 'myapp.services', 'myapp.directives', 'myapp.controllers']). config(['$routeprovider', '$locationprovider', function($routeprovider, $locationprovider) { $routeprovider.when('/view1', {templateurl: 'partials/partial1.html', controller: 'myctrl1'}); $routeprovider.when('/view2', {templateurl: 'partials/partial2.html', controller: 'myctrl2'}); $routeprovider.otherwise({redirectto: '/view1'}); $locationprovider.html5mode(true); }]); i want make user can access view1 typing url "://host/view1" on browser. not work.. by using $routeprovider , $locationprovider, if user click "href=/view1" link, page routed host/view1. but if user access directly url "://host/view1" emit 404 error. make user can access /view1 directly url, have remove html5mode then, user ca

sql - the same result in php or mysql ,which ways is better? -

select * tablename.questions date_sub(curdate(), interval 7 day) <=date( from_unixtime(question_created)) order question_click_count desc ; to show 7days data can in php $day = mktime(0,0,0,date("m"),date("d")-7,date("y")); and query sql select * 'question' question_created < $day , xxxxxxx way better way? doing in database much faster doing in php. it's important consideration if it's happening inside of loop repeats 100000 times, if it's happening once not able tell difference.

javascript - What is the significance of this js code in apple “The 50 Billion Apps Countdown Promotion”? -

this promotion page: http://www.apple.com/itunes/50-billion-app-countdown/ and link js: http://www.apple.com.cn/v/itunes/50-billion-app-countdown/a/scripts/counter.js ac.ondomready(function() { var e = "j", t = new counter({ container: ac.element.selectall(".counter")[0], dataurl: "/itunes/store/counters/il6ark7ec." + e + "s", staticimagepath: "http://images.apple.com/itunes/shared/counter/images/counter_noscript.png", targetcount: 50000000000, stopattargetcount: true }); }); so splice string var e="j" "/itunes/store/counters/il6ark7ec." + e + "s" to http://www.apple.com.cn/itunes/store/counters/il6ark7ec.js is useful? or fun..? it's make harder looking scrape file , files linked within. naive approach through html source , download other files referenced within end css or js (probably using regular expression). string concat cause fail on partic

ios build for archive in Xcode 4 with no device -

i created adhoc provisioning files friend's device id , when else built app, friend able run on iphone. i don't own iphone myself. trying build , upload itunes. since don't have actual device followed advice here because build archive option grayed out. i selected ios device , build archive option became available build fails, though works fine on emulator. am doing wrong? note : in code signing chose iphone distribution archive builds relese configuration running in simulator builds debug configuration. need development , release code signing certificate , development , release provisioning profiles. every time update provisioning profile need refresh provisioning profile library in xcode organizer.

javascript - JS - jQuery dynamically add and remove fields -

i trying make dynamically duplicated field jquery : the html (php) code : <div id="widget_dup"> <p> <textarea class="code" cols="50" rows="5" id="o99_brsa_settings[brsa_dash_wdgt_content]" name="o99_brsa_settings[brsa_dash_wdgt_content]" value="<?php //echo $o99_brsa_options['brsa_dash_wdgt_content']; ?>"/><?php echo $o99_brsa_options['brsa_dash_wdgt_content']; ?></textarea> <label class="description" for="o99_brsa_settings[brsa_dash_wdgt_content]"> </br><?php _e('content 1st widget', 'o99-brsa-domain'); ?> </label> </p> </div> <div id="addscnt">add</div><div id="remscnt">remove</div> the js assembled snip

java - Hibernate Tools in Eclipse: Change in column values does not reflecting in the query result -

i using eclipse indigo , hibernate tools 3.3 testing hql queries. i have configured hibernate tools correctly. when querying db after changing values in column, old data coming in result. when closed configuration , again connect, getting updated result. is hibernate tools caching table values? if yes how disable that? what auto-commit/ commit config ?

Evaluate a postfix expression using a stack and array in C -

i still new , not quick on picking coding c. assignment have evaluate postfix expression array using stack. while sure have several problems code feel basic structure good. compiles without errors, have warnings. run , printout printf statements in main not in evaluation far can tell. not looking cheat or complete fix guidance appreciated please respond assuming know little. cheers #include <stdio.h> #include <stdlib.h> struct stacknode { int data; struct stacknode *nextptr; }; typedef struct stacknode stacknode; typedef stacknode *stacknodeptr; int evaluatepostfixexpression( char *expr ); int calculate( int op1, int op2, char operator ); void push( stacknodeptr *topptr, int value ); int pop( stacknodeptr *topptr ); int isempty( stacknodeptr topptr ); void printstack( stacknodeptr topptr ); char postfix[50]; int answer; void main() { printf("print postfix expression\n"); scanf("%s", postfix); evaluatepostfixexpression(po

include - Struts2 ActionContext and Response for chaining actions -

i have pretty complex problem struts2 chaining actions, in advance patience reading problem. try best describe clearly. below struts.xml: <?xml version="1.0" encoding="utf-8" ?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.0//en" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.enable.dynamicmethodinvocation" value="false" /> <constant name="struts.enable.slashesinactionnames" value="true" /> <constant name="struts.devmode" value="false" /> <package name="default" extends="struts-default" namespace="/"> <action name="test" class="com.bv.test.testaction1" > <result name="success" type="chain">y</result> </action> <

java - Interview follow up on Class Design by avoiding diamond case -

recently have been asked design question. there 2 classes horse , bird. need design new class called unicorn having methods of class horse , bird. horse bird | | unicorn since in java cant extend 2 classes (to avoid diamond problem) how achieve this? please guide. in advance. use façade pattern composition achieve this. unicorn class contain instances of both bird , horse , implement relevant methods calling them on these contained instances.

android - Weird textview.setText() inside adapter result -

in app i'm passing adapter (which extends arrayadapter>) such list: list<map<string, string>> . single record list looks like: {received=true, text=some sort of text} here's getview method: @override public view getview(int position, view convertview, viewgroup parent) { map<string, string> singlerecord = new hashmap<string, string>(); singlerecord = records.get(position); view rowview = convertview; if (rowview == null) { layoutinflater layoutinflater = context.getlayoutinflater(); rowview = layoutinflater.inflate(record_layout, null); } //to test method do: string to_put = singlerecord.get(key_text); log.e("adapter", to_put); //// textview singletext = (textview) rowview.findviewbyid(r.id.singleid); singletext.settext(singlerecord.get(key_text)); //viewholder.singletext.settext(tekst); return super.getview(position, convertview, parent); } as can see want tex

google app engine - HRD with no unapplied jobs on GAE Java Dev Server -

for testing purposes need run local app engine java development server high-replication datastore (hrd), no unapplied jobs. have same effect can in standalone unit tests following: localdatastoreservicetestconfig cfg = new localdatastoreservicetestconfig(); cfg.setapplyallhighrepjobpolicy() localservicetesthelper helper = new localservicetesthelper(cfg); helper.setup(); on dev server classes not available, there way have hrd no unapplied jobs on dev server? (hrd enabled dev app server jvm flag - ddatastore.default_high_rep_job_policy_unapplied_job_pct . if set zero, disable hrd , use master-slave datastore instead) i cannot use master-slave datastore, @ least objectify (4.0b) creates trouble cross-group transactions. fail following message: cross-group transaction need explicitly specified . you can set own job policy. use: public class alwaysapplyjobpolicy implements highrepjobpolicy { @override public boolean shouldapplynewjob(key arg0) { re

asp.net - HTML to Thumbnail -

is there way create image thumbnail specific html code, for example: specific div , nested divs (not whole page)? i reviewed question it's whole page screenshot not specific html code. my objective share on facebook since facebook accept 1 image.

ios - How to add UINavigation controller using ruby motion? -

i need guidance add uinavigation controller , add button in navigation using ruby motion. this pretty broad question, assuming you're pretty new ios development in general. you'll want reference uinavigationcontroller api documentation, found here: http://www.rubymotion.com/developer-center/api/uinavigationcontroller.html if you're looking easier way this, have @ promotion: https://github.com/clearsightstudio/promotion/ this abstracts uinavigationcontroller , allows focus on app programming rather managing navigation.

jquery - how to create floating internal links container -

i trying create page internal jumper links jump particular anchor tags or header tags within same page.. i want jumper links fixed on top being scrolled by, , scroll footer reaches footer.. and want scroll particular link without page refreshing click of quick links.. also want highlight current anchor link being scrolled.. i tried this, here came with.. function gotobyscroll(hash) { $(document.body).animate({ 'scrolltop': $(hash).offset().top }, 500); } var $links = $('#links'); var $content = $('#content'); height = $(window).height(); $(window).scroll(function(){ if ($(window).scrolltop() >= height ){ $links.css({ position:'fixed', top:'70px'}); $content.css({ marginleft: '80px'}); } else { $links.css({ position:'relative'}); $content.css({ marginleft: '9px'}); } }); // http://jsfiddle.net/mfs3j/13/ basically want create galaxy s4 review - verge you can

c# - How do I convert GBP to EUR? -

i have text box containing balance , text box want show balance in euros. when click convert button want able convert sterling euro. so how balance display in streling , how convert euro? any example code great or direct me site teach me this. the european central bank (ecb) provides currency exchange rates on daily basis in xml format link currency rates here use webrequest save xml , write wrapper class conversion and if want use xe.com use link , has 3 parameters 1.amount convert, 2. currency , 3. currency output of link <wml> <head> <meta http-equiv="cache-control" content="must-revalidate" forua="true"/> <meta http-equiv="cache-control" content="no-cache" forua="true"/> </head> <card title="xe converter"> <p mode="wrap" align="center"> xe converter </p> <p mode="nowrap" ali

compilation - Debugging information in GCC preprocessor output -

i inspecting preprocessed output generated gcc, , see lot of these in .i file generated using -save-temps flag: # 8 "/usr/include/i386-linux-gnu/gnu/stubs.h" 2 3 4 what numbers before , after absolute path of stubs.h mean? seems kind of debugging information inserted preprocessor , allows compiler issue error messages referring information. these lines not affect program itself, each number for? based on the documentation number before filename line number. numbers after file name flag , mean following: 1 indicates start of new file. 2 indicates returning file (after having included file). 3 indicates following text comes system header file, warnings should suppressed. 4 indicates following text should treated being wrapped in implicit extern "c" block.

android - Alternative to addPreferencesFromResource as its deprecated -

i create preference activity on app allow user start/stop background splash screen music follow : public class prefs extends preferenceactivity{ @suppresswarnings("deprecation") @override protected void oncreate(bundle savedinstancestate) { requestwindowfeature(window.feature_custom_title); // todo auto-generated method stub super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.prefs); } } and inside xml folder create prefs.xml : <?xml version="1.0" encoding="utf-8" ?> <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android"> <checkboxpreference android:title="splash music" android:defaultvalue="true" android:key="checkbox" android:summary="plese remove music "/> </preferencescreen> and code splash activity : public class splash extends activity{

osx - How can I keep track of a USB device across disconnections? -

i've got bunch of usb serial devices (these precise: http://plugable.com/products/pl2303-db9 ) and, if @ possible, "keep track" of them across unplug/replug events (even if replug event different usb port). the driver appears create bsd dialin/callout/tty device names usb location, changes depending on usb port plug them into. looking @ iokit property dictionaries between 2 identical devices plugged 2 separate usb ports, differences in sessionid , usb address , locationid , portnum or in values appear derived locationid . sessionid appears change, well, per session (i.e. different after every unplug/replug). since these devices return 0 iserialnumber , think i'm screwed here, figured i'd toss out here , see if has ideas. there maybe generic facility write "token" usb device can read back? don't see in quick skimming/googling of usb standard, facility trick... any ideas? unfortunately, there's no way (and if figure 1 out,

javascript - What is the difference between deep and shallow cloning? -

if use splice clone array gives me shallow copy, missing? seems multilevel arrays not depth of array if understand correctly. in shallow copy, if arrays (or object properties) references objects, references copied. var = [{name: "bob"}]; var b = a.slice(0); b[0].name = "tom"; alert(a[0].name); // "tom" a "deep" copy makes sure result contains new copies of referenced objects original data structure. performing deep copy can problematic, depending on nature of objects involved.

Creating an assigning an object in c++ -

hello new c++, i can create new instance of class using example example("123") i have 2 question i know cannot check if object null if(example ==null) because not pointer have other way that. i have method return object like: how can return null? example get_example() { if (example.getname().empty() { example example("345"); return example; } return null // cannot return null. } can this? example get_example() { example example; if (example.getname().empty() { example = example example("345"); return example; } return null // cannot return null. how } example = example example("345"); know stupid how can without pointer. use pointers, example *ex = null . construct default null_example , overload == example e; if (e == null_example) { e.init(); } but provide is_init() function. example e; if (!e.is_init()) { e.init(); } you get_examp

php - ajax - starting and ending sessions with onload and onunload -

i have signup page. on page, user input values checked asynchronously php backend against tables. my problem data model objects large; wise start session via ajax when enters page (onload), caches model objects other ajax requests client don't end recreating data model objects every request. when user navigates away page (onunload or whatever) ajax request send destroy session. it seems idea me because every asynchronous request made result of user interaction form doesn't recreate objects have been created before hand. would work in practice? (for details of worries see comments) update: the main issue raised create dangling session. fixed putting simple 5 minute timeout on session? for wondering, proved unbearably horrible idea. alright in principle managing sessions , making sure stays synchronous front end near impossible , in no way scalable, in turn made controller structure complicated nightmare debug (not mention had clear browser cache every

Python simple nested for loops -

i trying simple nested loop in python scan threshold-ed image detect white pixels , store location. problem although array reading 160*120 (19200) still takes 6s execute, code follows , or guidance appreciated: im = image.open('pygamepic') r, g, b = np.array(im).t x = np.zeros_like(b) height = len(x[0]) width = len(x) x[r > 120] = 255 x[g > 100] = 0 x[b > 100] = 0 row_array = np.zeros(shape = (19200,1)) col_array = np.zeros(shape = (19200,1)) z = 0 in range (0,width-1): j in range (0,height-1): if x[i][j] == 255: z = z+1 row_array[z] = col_array[z] = j first, shouldn't take 6 seconds. trying code on 160x120 image takes ~0.2 s me. that said, numpy performance, want avoid loops. it's simpler vectorize along except smallest axis , loop along that, when possible should try @ once. makes things both fa

Receiving "Error: InvalidStateError: DOM Exception 11" on HTML5 websocket when calling .send(data) using Node.js -

i trying develop small chat application using node.js. first node project getting error , i'm not sure how solve it. i have written simple chat server in node below. var port = 3000; var net = require('net'); var clients = []; var server = net.createserver(function (socket) { clients.push(socket); bindeventhandlers(socket); }); setinterval(function(){ console.log(clients.length); }, 2000); server.listen(port); console.log('server listening on localhost:' + port); function bindeventhandlers(socket) { socket.on('data', function(data){ broadcastdatatoallclient(data, socket); }); socket.on('close', function(){ clients.splice(clients.indexof(socket), 1); }); socket.on('error', function(){ console.log('known error << "it\'s feature!"'); }) } function broadcastdatatoallclient(data, socket) { (var client in clients) { if(clients[client] == socket){ continue; } client

In this Rails app view loop, how can I include CSS button styling? -

i want "complete" below have fake button styling, border , colored interior. what best way this? tried suffix class: 'btn btn-mini' doesn't work (for obvious reasons, it's not button). - @tasks.each |task| %tr %td= task.content - if @dayhash[task.day_id] == "today" - if task.start != nil && task.stop.nil? %td underway - elsif task.start !=nil , task.stop !=nil %td complete - elsif task.start !=nil , task.stop !=nil %td .btn.btn-mini complete

CodeIgniter - .htaccess file in captcha folder gets deleted -

i have codeigniter installed on wamp in root directory. problem comes in here: i've been trying out captcha's. captcha folder c:\wamp\www\captcha . problem .htaccess file inside captcha gets deleted when new captcha generated the content of .htacces file is: rewriteengine on rewriterule !.*\.jpg - [f,l] rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule (.*) - [f] i use return forbidden ..... message if .... .jpg file exists. at moment have in /view file. haven't yet implemented check/submit method. feel need overcome first. $this->load->helper('captcha'); $vals = array( 'img_path' => './captcha/', 'img_url' => 'http://localhost/captcha/', 'img_width' => '150', 'img_height' => 30, 'expiration' => 25 ); $cap = create_captcha($vals); echo $cap['image']; thanks in advance. answer quite simple ac

java - How to include HTML in JSP? -

i've searched question, there answers, not question. here jsp code: <body> <% if (manager.isvalid(request.getparameter("username"),request.getparameter("password"))){ out.print("<h1> welcome "); out.print(request.getparameter("username") + "</h1>"); } else { out.print("<h1> please try again </h1> <br />"); out.print("either username or password incorrect. please try again <br /> <br />"); } %> <%@ include file="loginform.html" %> but instead of this, want include "loginform.html" in "else" block. how can it? of course doesn't work, you'll guess want : <% if (manager.isvalid(request.getparameter("username"),request.getparameter("password"))){ out.print("<h1&g

python 2.7 - Octo.py only using between 0% and 3% of my CPUs -

i have been running python octo.py script word counting/author on series of files. script works -- tried on limited set of data , getting correct results. but when run on complete data set takes forever. running on windows xp laptop dual core 2.33 ghz , 2 gb ram. i opened cpu usage , shows processors running @ 0%-3% of maximum. what can force octo.py utilize more cpu? thanks. as application isn't cpu intensive, slow disk turns out bottleneck. old 5200 rpm laptop hard drives slow, which, in addition fragmentation , low ram (which impacts disk caching), make reading slow. in turns slows down processing , yields low cpu usage. can try defragmenting, compressing input files (as become smaller in disk size, processing speed increase) or other means of improving io.

android - Crashes when showing map on real device, running on emulator shows google play service missing -

when ever run app on emulator shows google play service missing.but when run same application on real device unexpectedly stops application making crash here code map ` <uses-sdk android:minsdkversion="8" android:targetsdkversion="8" /> <uses-permission android:name="android.permission.read_contacts" /> <application android:allowbackup="true" android:icon="@drawable/loc_finder" android:label="@string/app_name" android:theme="@style/apptheme" > <uses-library android:name="com.google.android.maps" /> <service android:name="jade.android.microruntimeservice" /> <activity android:name="com.example.location_finder.login_activity" android:label="@string/app_name" > <intent-filter> <action andro

asp.net mvc 4 - JQuery always returning false for checkbox value -

i'm working on c# mvc 4 project , having problems determining if checkbox checked using jquery. basically, need show , hide other controls on page based on value of checkbox. here cshtml code checkbox : @if (model.skucustomizations[i].hasstonechange) { <div class="two-col-label">@html.displaynamefor(m => m.skucustomizations[i].stone_haschange)</div> <div id="divstonechange" data-idx="@i" class="two-col-value"> <input type="checkbox" id="chkstone_@i" name="stonechange" checked="@model.skucustomizations[i].stone_haschange"> </div> <div class="last" /> } and here code try , pull checked value: $('#divstonechange').change(function () { var idx = $('#divstonechange').attr('data-idx') var stone = $('#chkstone' + idx).is(':checked') if (stone !

android - Query works on SQLite Browser but not from rawquery -

db.rawquery("select * inbox where(('2013-05-03' = strftime('%y-%m-%d', datetime(date/1000, 'unixepoch', 'localtime'))));",null); i able results in sqlite browser, not eclipse editor, can 1 please me on this.

symfony - Status with three choices -

i want make choice dropdown form 3 choices: -favored -intended -verified could'nt use boolean this. i have no idea how set annotations status field in entity. help? /** * @var boolean * * @orm\column(name="status", type="boolean") */ private $status; i don't know if have understood question in fact boolean field type symfony2/doctrine2 tinyint(1) in sql database. can put integer values -128 127. generally entities use "rule" : <?php class myentity { const status_favored = 1; const status_intented = 2; const status_verified = 3; /** * @var integer * * @orm\column(name="status", type="boolean") */ private $status; public function __construct() { $this->status = self::status_favored; } /** * ur form example */ public static function getstatusforchoiceformfield() {

c++ - How to pass AT commands to dongle? -

i need send sms via usb dongle, , possible through @ commands. but, have no idea how pass @ commands dongle. internet has no well. can please instruct me how pass @ commands dongle simple code snippet? most usb dongles show serial port on pc. can connect terminal program appropriate com port , send @ commands. sending sms works this, pressing enter after each line: at+cfun=1 --> full functionality at+cmgf=1 --> text mode sms at+cmgs="+12345678" --> phone number > text goes here --> sms text ctrl-z --> end sequence, 0x1a in hex programatically qt or other languages open serial connection appropriate port , send sequence this. also, keep in mind not usb dongles support this.

sql server - Get all records in SQL depending on user input -

i learning sql , came across difficulty. data table looks this dbo data id | name | surname | title | location ---------------------------------------- 1 | xxx | abc | def | london 2 | xxx | abc | def | oslo 3 | xxx | abc | def | new york now want id, name, title , surname , use query this: select id, name, surname, title data location = 'london' -- (this user input) but problem if user inputs all or world or empty string in where clause, want query return rows. possible writing query handle special scenarios above???? i using asp.net datasource <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:mainconnectionstring %>" selectcommand="select [name], [id], [surname], [title] [data] [location] = @location)" > <selectparameters> <asp:controlparameter controlid="label1" name="lo

overloading - Java method overload - ambiguity -

while doing runs test code in thread found out strange thing, if consider following program import java.util.arraylist; import java.util.list; public class overloadtest { public string test1(list l){ return "abc"; } public int test1(list<integer> l){ return 1; } public static void main(string [] args) { list l = new arraylist(); system.out.println(new overloadtest().test1(l)); } } i expecting java compiler show ambiguity error due byte-code erasure property, didn't. when tried run code, expecting test1(list) called , output "abc" surprise called test1(list<integer>) (output 1 ) i tried below list l = new arraylist(); l.add("a"); system.out.println(new overloadtest().test1(l)); but still found java calling test1(list<integer> param) method , when inspected param had string "a" ( how did java cast list<string> list<integer> ?)

Wordpress archive list with year, month, days, posts and comment counts -

Image
i willing achieve wordpress archive list this: 2013 may (2) 04 - love wordpress (3 comments) 01 - love wordpress (1 comment) february (1) 02 - love wordpress? 2012 ... from read elsewhere have create own query. not 1 may call developer. here's started with: <ul> <?php $args=array( 'post_type' => 'post', 'posts_per_page' => '500', /*no limit, how?*/ 'orderby' => 'date', 'order' => 'desc', ); query_posts($args); while (have_posts()) : the_post(); ?> <li><?php the_time('j'); ?> | <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php comments_number( '', '(1)', '(%)' ); ?></li> <?php endwhile; ?> </ul> you can see looks here: http://www.vie-nomade.com/archives/ i know need separate month, year. thanks.

VS 2008 MFC Feature Pack - How do I -

i have application i'm writing using mfc feature pack. uses document/view. since these classes derived "normal" mfc classes, these questions may not feature pack specific. when change made, add asterisk * name on tab, , word (modified) main window title using following code: tabval = "report_" + pdoc->rptdata.reportid.strip(); winval = tabval; if (changed) { tabval += " *"; winval += " (modified)"; } frame->settitle(tabval); frame->setwindowtext(tabval); name = mainframe->gettitle(); mainframe->setwindowtext(name + " - " + winval); but when changing between tabs, original text comes back. first question: how make change sticky? second question: there's tree view on left , properties window on right. switching between them (un)highlights title bars show 1 active. user can activate , interact document window, there doesn't seem way give visual feedback document window is, in fact, active. h

c++ - setSectionResizeMode only resizes for what is currently shown -

ui->tablewidget->horizontalheader()->setsectionresizemode(0, qheaderview::resizetocontents); ui->tablewidget->horizontalheader()->setsectionresizemode(1, qheaderview::stretch); video: http://youtu.be/kbpf9olxoq4 how can resize strings? edit: ui->tablewidget->resizecolumntocontents(0);

creating a weekly user registration report using php & mysql -

Image
i'm working on application , i'm stuck. client demands add chart comparing registration data of week against of last week. example, if have series array, like series: [{ name: 'last week', data: [2, 4, 3, 5, 0, 10, 12] }, { name: 'this week', data: [1, 0, 4, 3, 3, 5, 18] }] where data last week , week represents number of users registered in each day of week. intend pour contents of array chart thhis: i have chart implement this... problem structuring database, function detect days of week , update database number of registered users per day, , how pull data database such corresponds right day of week shown in chart.. i'm new php mysql. have checked stackoverflow problem , checked internet, find this post relating it , not want. please how suggest go this? help

c# - IsNumeric Helper Method for large numbers -

i'm trying create simple helper function determines if number numeric. should able handle 'null', negative numbers, , i'm trying without of vb's isnumeric. , having learned linq, thought perfect. the other thing i'd able pass string, integer, long, or other type, thinking having 'object' parameter want. sure, convert type string before calling helper method, possible ? here's code have far , need able change parameter! can't imagine wouldn't possible... ideas? private static bool isnumeric(string input) { if (input == null) throw new argumentnullexception("input"); if (string.isnullorempty(input)) return false; int periodcount = 0; //accept string w/ 1dec support values w/ float return input.trim() .tochararray() .where(c => { if (c == '.') periodcount++; return char.isdigit(c) && periodcount <= 1; }) .count() == input.trim().length; } there several thin

php - Refresh Iframe on last viewed page -

im working on basic site editor. view editable webpage iframe , when make changes iframe reloads index page of iframe. how can reload current page , not redirected index page? im using jquery reload iframe using .click , $.ajax success. $("#mainframe")[0].src = $("#mainframe")[0].src; i found works.... $("#myid")[0].src = $('#myid').contents().get(0).location.href;

linux - 404 Not Found - Can't get apache webserver to see UserDir -

so i'm trying set full lamp friends computer, , seems fine installation, can't apache find user's ~/public_html directory. entering localhost , /var/www directory or whatever works fine, success message, entering localhost/~user gives me 404. here's line added in apache2.conf file... 239 # add user directory public_html 240 userdir public_html ...and here's /etc/apach2/mods-enabled/userdir.conf file.... 1 <ifmodule mod_userdir.c> 2 userdir public_html 3 userdir disabled root 4 5 <directory /home/*/public_html> 6 allowoverride fileinfo authconfig limit indexes 7 options multiviews indexes symlinksifownermatch includesnoex ec 8 <limit post options> 9 order allow,deny 10 allow 11 </limit> 12 <limitexcept post options> 13 order den

java - How launch bluecove programmically -

i'm trying lunch bluetooth stack manually(after closing bluetooh stack). i after bluecoveimpl.java , find out bluetooth stack initialized in private bluetoothstack detectstack() method, trying call calling bluecoveimpl.instance().getbluetoothstack(); but exception occures: exception in thread "main" java.lang.error: illegal use of jsr-82 api @ com.intel.bluetooth.utils.islegalapicall(utils.java:296) @ com.intel.bluetooth.bluecoveimpl.getbluetoothstack(bluecoveimpl.java:1023) i tried bluecoveimpl.instance(); bluecoveimpl.getthreadbluetoothstackid(); but made no effect. how can launch bluecove? the method getbluetoothstack() does sort of security check calling utils.islegalapicall http://bluecove.googlecode.com/svn/trunk/bluecove/src/main/java/com/intel/bluetooth/utils.java this method checks if call done class out of these packages javax.bluetooth. getpackage(microeditionconnector.class.getname(

knockout.js - Clicked table row bound via knockoutjs gets not selected -

i want make simple table row selectable clicking on here: http://jsfiddle.net/rniemeyer/apzk8/6/ i applied above logic still nothing selected, wrong? the data displayed correctly, selecting not work. define(['services/dataservice'], function (dataservice) { var self = this; this.selected = ko.observable(); var schoolyears = ko.observablearray(); this.selectschoolyear = function (config) { self.selected(config); }; this.selected(schoolyears()[0]); var vm = { activate: activate, schoolyears: schoolyears, title: 'schoolyears' }; return vm; function activate(){ var schoolyearmodels = dataservice.getschoolyears(); var schoolyearviewmodels = []; (var = 0; < schoolyearmodels.length; i++){ var e = schoolyearmodels[i]; var schoolyearviewmodel = new schoolyearviewmodel(e.schoolyearid, e.schoolyearname, e.from, e.to, e.lastedited, self.sel